Package org.apache.uima.cas.impl
Class Id2FS
java.lang.Object
org.apache.uima.cas.impl.Id2FS
A map from ints representing FS id's (or "addresses") to those FSs There is one map instance per
CAS (all views).
The map is not populated, normally. It is only populated when there is a need to
be able to map from the id to the FS, or to prevent the FS from being GC'd
-- The low level CAS apis for creating FSs have this need, because they return the id, and this
won't prevent the FS from being GC'd.
Removes not supported; they happen when the map is reset / cleared This corresponds to the v2
property of "once created, a FS cannot be reclaimed (until reset)"
Threading: to support read-only views, concurrent with updates, needs to be thread safe
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Map<Id2FS.MeasureCaller, Id2FS.MeasureCaller> private final JCasHashMapprivate final intprivate static final boolean(package private) static final booleanprivate static final intprivate static intprivate static final Stringprivate static Map<Id2FS.MeasureCaller, Id2FS.MeasureCaller> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidclear()adjusts the underlying array down in size if grew beyond the reset heap size valueprivate static voiddumpCallers(String title, Map<Id2FS.MeasureCaller, Id2FS.MeasureCaller> map) (package private) TOPget(int id) iterator()private void(package private) voidput but assert wasn't there before(package private) void(package private) voidmake an id map to an fs, asserting there was a previous mapping for this id(package private) voidSkips the assert that the item wasn't already present(package private) intsize()(package private) void(package private) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
MEASURE
static final boolean MEASURE- See Also:
-
MEASURE_STACK_SIZE
private static final int MEASURE_STACK_SIZE- See Also:
-
callers
-
walkableCallers
-
REPORT_FS_PINNING
- See Also:
-
IS_REPORT_PINNING
private static final boolean IS_REPORT_PINNING -
pinning_count
private static int pinning_count -
id2fs
-
initialSize
private final int initialSize
-
-
Constructor Details
-
Id2FS
public Id2FS(int initialHeapSize)
-
-
Method Details
-
maybeReport
private void maybeReport() -
put
put but assert wasn't there before -
putUnconditionally
Skips the assert that the item wasn't already present- Parameters:
fs- the fs to add
-
putChange
make an id map to an fs, asserting there was a previous mapping for this id- Parameters:
id- -fs- -
-
put
-
get
-
size
int size() -
clear
void clear()adjusts the underlying array down in size if grew beyond the reset heap size value -
traceWeakGets
void traceWeakGets() -
trace
-
dumpCallers
-
iterator
-