Package org.apache.uima.cas.impl
Class CommonSerDesSequential
java.lang.Object
org.apache.uima.cas.impl.CommonSerDesSequential
Common de/serialization for plain binary and compressed binary form 4
which both used to walk the cas using the sequential, incrementing id approach
Lifecycle:
There is 0/1 instance per CAS, representing the FSs at some point in time in that CAS.
Creation:
serialization (for delta serialization,
the csds made when deserialization was done is reused, if available
Updates cannot add to the reachables).
non-delta deserialization
delta deserialization uses previous one
Reset:
CAS Reset
API call (for optimization - used after all delta deserializations into a particular CAS are complete.
Logical constraints:
- delta de/serialization must use an existing version of this,
-- set during a previous non-delta de/serialization
-- or created just in time via a scan of the cas
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Int2ObjHashMap
<TOP, TOP> a map from the modelled (v2 style) FS addr to the V3 FS created when serializing (non-delta), deserializing (non-delta) augmented when deserializing(delta) used when deserializing (delta and non-delta) retained after deserializing (in case of subsequent delta (multiple) deserializations being combined) For delta, the addr is the modeled addr for the full CAS including both above and below the line.private final CASImpl
The associated CAS(package private) final Obj2IntIdentityHashMap
<TOP> a map from a fs to its addr in the modeled heap, == v2 style addr created during serialization and deserialization used during serialization to create addr info for index info serialization For delta, the addr is the modeled addr for the full CAS including both above and below the line.private int
The first free (available) simulated heap addr, also the last addr + length of thatThe FSs in this list are not necessarily sequential, but is in ascending (simulated heap) order, needed for V2 compatibility of serialized forms.static final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Must call in fs sorted order(package private) void
(package private) void
addFSunordered
(TOP fs, int addr) For out of order calls(package private) void
clear()
(package private) int
boolean
isEmpty()
private void
merge()
(package private) void
setHeapEnd
(int heapEnd) setup
(MarkerImpl mark, int fromAddr) Scan all indexed + reachable FSs, sorted, and - create two maps from those to/from the int offsets in the simulated main heap - add all the (filtered - above the mark) FSs to the sortedFSs - set the heapEnd
-
Field Details
-
TRACE_SETUP
public static final boolean TRACE_SETUP- See Also:
-
fs2addr
a map from a fs to its addr in the modeled heap, == v2 style addr created during serialization and deserialization used during serialization to create addr info for index info serialization For delta, the addr is the modeled addr for the full CAS including both above and below the line. -
addr2fs
a map from the modelled (v2 style) FS addr to the V3 FS created when serializing (non-delta), deserializing (non-delta) augmented when deserializing(delta) used when deserializing (delta and non-delta) retained after deserializing (in case of subsequent delta (multiple) deserializations being combined) For delta, the addr is the modeled addr for the full CAS including both above and below the line. -
sortedFSs
The FSs in this list are not necessarily sequential, but is in ascending (simulated heap) order, needed for V2 compatibility of serialized forms. This is populated either during deserialization, or for serialization, from indexed + reachable. Before accessing this, any pending items must be merged (sorting done lazily) -
pending
-
baseCas
The associated CAS -
heapEnd
private int heapEndThe first free (available) simulated heap addr, also the last addr + length of that
-
-
Constructor Details
-
CommonSerDesSequential
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
addFS
Must call in fs sorted order- Parameters:
fs
-
-
addFS1
-
addFSunordered
For out of order calls- Parameters:
fs
-
-
clear
void clear() -
setup
Scan all indexed + reachable FSs, sorted, and - create two maps from those to/from the int offsets in the simulated main heap - add all the (filtered - above the mark) FSs to the sortedFSs - set the heapEnd- Parameters:
mark
- null or the markfromAddr
- often 1 but sometimes the mark next fsid- Returns:
- all (not filtered) FSs sorted
-
getSortedFSs
- Returns:
- sorted FSs above mark if mark set, otherwise all, sorted
-
getHeapEnd
int getHeapEnd() -
setHeapEnd
void setHeapEnd(int heapEnd) -
merge
private void merge()
-