Class CASImpl.SharedViewData

  • Enclosing class:
    CASImpl

    static class CASImpl.SharedViewData
    extends java.lang.Object
    • Field Detail

      • id2fs

        private final Id2FS id2fs
        map from FS ids to FSs.
      • reuseId

        private int reuseId
        set to > 0 to reuse an id, 0 otherwise
      • baseCAS

        private final CASImpl baseCAS
      • featureCodesInIndexKeys

        private final java.util.BitSet featureCodesInIndexKeys
        These fields are here, not in TypeSystemImpl, because different CASes may have different indexes but share the same type system They hold the same data (constant per CAS) but are accessed with different indexes
      • sofaNbr2ViewMap

        java.util.ArrayList<CASImpl> sofaNbr2ViewMap
        A map from Sofa numbers to CAS views. number 0 - not used number 1 - used for view named "_InitialView" number 2-n used for other views Note: this is not reset with "Cas Reset" because views (really, their associated index repos) take a lot of setup for the indexes. However, the maximum view count is reset; so creation of new views "reuses" these pre-setup indexRepos associated with these views.
      • sofaNameSet

        private java.util.Set<java.lang.String> sofaNameSet
        a set of instantiated sofaNames
      • initialSofaCreated

        private boolean initialSofaCreated
      • viewCount

        int viewCount
      • jcasClassLoader

        private java.lang.ClassLoader jcasClassLoader
      • previousJCasClassLoader

        private java.lang.ClassLoader previousJCasClassLoader
        Only support one level of PEAR nesting; for more general approach, make this a deque
      • suspendPreviousJCasClassLoader

        private java.lang.ClassLoader suspendPreviousJCasClassLoader
        Save area for suspending this while we create a base instance
      • id2tramp

        private JCasHashMap id2tramp
        A map from IDs to already created trampoline FSs for the base FS with that id. These are used when in a Pear and retrieving a FS (via index or deref) and you want the Pear version for that ID. There are potentially multiple maps - one per PEAR Classpath
      • id2base

        private JCasHashMap id2base
        a map from IDs of FSs that have a Pear version, to the base (non-Pear) version used to locate the base version for adding to indexes
      • cl2id2tramp

        private final java.util.Map<java.lang.ClassLoader,​JCasHashMap> cl2id2tramp
      • generators

        private FsGenerator3[] generators
        The current (active, switches at Pear boundaries) FsGenerators (excluding array-generators) key = type code read-only, unsynchronized for this CAS Cache for setting this kept in TypeSystemImpl, by classloader - shared among all CASs that use that Type System and class loader -- in turn, initialized from FSClassRegistry, once per classloader / typesystem combo Pear generators are mostly null except for instances where the PEAR has redefined the JCas cover class
      • baseGenerators

        private FsGenerator3[] baseGenerators
        When generating a new instance of a FS in a PEAR where there's an alternate JCas class impl, generate the base version, and make the alternate a trampoline to it. Note: in future, if it is known that this FS is never used outside of this PEAR, then can skip generating the double version
      • flushEnabled

        private boolean flushEnabled
      • trackingMark

        private MarkerImpl trackingMark
        This tracks the changes for delta cas May also in the future support Journaling by component, allowing determination of which component in a flow created/updated a FeatureStructure (not implmented) TrackingMarkers are held on to by things outside of the Cas, to support switching from one tracking marker to another (currently not used, but designed to support Component Journaling). We track changes on a granularity of features and for features which are arrays, which element of the array (This last to enable efficient delta serializations of giant arrays of things, where you've only updated a few items) The FsChange doesn't store the changed data, only stores the ref info needed to get to what was changed.
      • modifiedPreexistingFSs

        private java.util.Map<TOP,​CASImpl.FsChange> modifiedPreexistingFSs
        Track modified preexistingFSs Note this is a map, keyed by the FS, so all changes are merged when added
      • trackingMarkList

        private java.util.List<MarkerImpl> trackingMarkList
        This list currently only contains at most 1 element. If Journaling is implemented, it may contain an element per component being journaled.
      • fssTobeAddedback

        private final java.util.ArrayList<FSsTobeAddedback> fssTobeAddedback
        This stack corresponds to nested protectIndexes contexts. Normally should be very shallow.
      • fsTobeAddedbackSingle

        private final FSsTobeAddedback.FSsTobeAddedbackSingle fsTobeAddedbackSingle
        This version is for single fs use, by binary deserializers and by automatic mode Only one user at a time is allowed.
      • fsTobeAddedbackSingleInUse

        boolean fsTobeAddedbackSingleInUse
        Set to true while this is in use.
      • disableAutoCorruptionCheck

        boolean disableAutoCorruptionCheck
        temporarily set to true by deserialization routines doing their own management of this check
      • fsIdGenerator

        private int fsIdGenerator
        The fsId of the last created FS used to generate FSIDs, increments by 1 for each use. First id == 1
      • lastFsV2Size

        private int lastFsV2Size
        The version 2 size on the main heap of the last created FS
      • fsIdLastValue

        java.util.concurrent.atomic.AtomicInteger fsIdLastValue
        used to "capture" the fsIdGenerator value for a read-only CAS to be visible in other threads
      • casResets

        private final java.util.concurrent.atomic.AtomicInteger casResets
      • casId

        private final java.lang.String casId
      • emptyFloatArray

        private FloatArray emptyFloatArray
      • emptyFSArrayMap

        private final java.util.Map<Type,​FSArray> emptyFSArrayMap
      • emptyStringArray

        private StringArray emptyStringArray
      • emptyDoubleArray

        private DoubleArray emptyDoubleArray
      • emptyLongArray

        private LongArray emptyLongArray
      • emptyShortArray

        private ShortArray emptyShortArray
      • emptyByteArray

        private ByteArray emptyByteArray
      • bcsd

        private final BinaryCasSerDes bcsd
        Created at startup time, lives as long as the CAS lives Serves to reference code for binary cas ser/des that used to live in this class, but was moved out
      • csds

        private CommonSerDesSequential csds
        Created when doing binary or form4 non-delta (de)serialization, used in subsequent delta ser/deserialization Created when doing binary or form4 non-delta ser/deserialization, used in subsequent delta (de)serialization Reset with CasReset or deltaMergesComplete API call
      • llstringSet

        private StringSet llstringSet
        A StringSet used only to support ll_get/setInt api get adds string to this and returns the int handle set retrieves the string, given the handle lazy initialized
      • lllongSet

        private LongSet lllongSet
        A LongSet used only to support v2 ll_get/setInt api get adds long to this and returns the int handle set retrieves the long, given the handle lazy initialized
      • traceFScreationSb

        private final java.lang.StringBuilder traceFScreationSb
      • traceCowSb

        private final java.lang.StringBuilder traceCowSb
      • traceFSid

        private int traceFSid
      • traceFSisCreate

        private boolean traceFSisCreate
      • nextId2Addr

        private int nextId2Addr
      • initialHeapSize

        private final int initialHeapSize
      • isId2Fs

        private boolean isId2Fs
        if true, modify fs creation to save in id2fs map modify deserializers to create fss with ids the same as the serialized form ( or the V2 "address" imputed from that) modify serializers to include reachables only found via id2fs table not static because is updated (see ll_enableV2IdRefs)
      • switchControl

        private final java.util.Deque<CASImpl.SwitchControl> switchControl
        a stack used to remember and restore previous state of cas lock and class loaders when switching classloaders and locking the cas https://issues.apache.org/jira/browse/UIMA-6057
      • casState

        private final java.util.EnumSet<CasState> casState
        C A S S T A T E management * Cas state is implemented in a way to allow the Java to efficiently * access the state test without synchronization or "voliatile" memory accessing, * while at the same time, allowing for an occasional cross-thread memory invalidation * when the state is changed. This is done using a MutableCallSite plus that * objects "syncAll" method. *
      • noArgBoolean

        private static final java.lang.invoke.MethodType noArgBoolean
      • mh_return_false

        private static final java.lang.invoke.MethodHandle mh_return_false
      • mh_return_true

        private static final java.lang.invoke.MethodHandle mh_return_true
      • is_updatable_callsite

        private final java.lang.invoke.MutableCallSite is_updatable_callsite
      • is_readable_callsite

        private final java.lang.invoke.MutableCallSite is_readable_callsite
      • is_updatable

        private final java.lang.invoke.MethodHandle is_updatable
      • is_readable

        private final java.lang.invoke.MethodHandle is_readable
      • is_updatable_callsites

        private final java.lang.invoke.MutableCallSite[] is_updatable_callsites
      • is_readable_callsites

        private final java.lang.invoke.MutableCallSite[] is_readable_callsites
      • current_one_thread_access

        private volatile java.lang.Thread current_one_thread_access
    • Constructor Detail

    • Method Detail

      • updateCallSite

        private void updateCallSite​(boolean desired_state,
                                    java.lang.invoke.MethodHandle tester,
                                    java.lang.invoke.MutableCallSite c,
                                    java.lang.invoke.MethodHandle mh,
                                    java.lang.invoke.MutableCallSite[] cs)
      • setCasState

        private boolean setCasState​(CasState state,
                                    java.lang.Thread thread)
      • clearCasState

        private boolean clearCasState​(CasState state)
      • clearCasReset

        void clearCasReset()
      • clearSofaInfo

        void clearSofaInfo()
        called by resetNoQuestions and cas complete reinit
      • clear

        void clear()
        Called from CasComplete deserialization (reinit). Skips the resetNoQuestions operation of flushing the indexes, since these will be reinitialized with potentially new definitions. Clears additional data related to having the - type system potentially change - the features belonging to indexes change
      • resetNoQuestions

        private void resetNoQuestions​(boolean flushIndexRepos)
      • flushIndexRepositoriesAllViews

        private void flushIndexRepositoriesAllViews()
      • clearNonSharedInstanceData

        private void clearNonSharedInstanceData()
      • clearTrackingMarks

        private void clearTrackingMarks()
      • switchClassLoader

        void switchClassLoader​(java.lang.ClassLoader newClassLoader,
                               boolean wasLocked)
      • restoreClassLoader

        void restoreClassLoader​(boolean empty_switchControl,
                                CASImpl.SwitchControl switchControlInstance)
      • getNextFsId

        private int getNextFsId​(TOP fs)
        The logic for this is: - normal - add 1 to the value of the previous which is kept in fsIdGenerator Update fsIdGenerator to be this id. (maybe) set lastFsV2Size to the size of this FS in v2 - pear trampolines: use the exact same id as the main fs. This value is in reuseId. In this case, no computation of "next" is done - isId2Fs This is set if in special mode to emulate v2 addresses. - used for backwards compatibility when LowLevelCas getFSForRef calls in use - used for debugging v2 vs v3 runs - causes fsId to be set to a value which should match the v2 address Side effect: when doing v2 emulation, updates the lastFsV2Size
        Parameters:
        fs - - the fs, used to compute its "size" on the v2 heap when emulating v2 addresses
        Returns:
        the id to use
      • peekNextFsId

        int peekNextFsId()
        Returns:
        the lastUsedFsId + the size of that or 1
      • lastFsV2IdIncr

        int lastFsV2IdIncr()
      • getViewFromSofaNbr

        private CASImpl getViewFromSofaNbr​(int nbr)
      • getInitialView

        CASImpl getInitialView()
      • setViewForSofaNbr

        void setViewForSofaNbr​(int nbr,
                               CASImpl view)