Marshall Schor created UIMA-4677:
------------------------------------
Summary: UV3 Internal support for Feature Structure IDs
Key: UIMA-4677
URL: https://issues.apache.org/jira/browse/UIMA-4677
Project: UIMA
Issue Type: Sub-task
Components: Core Java Framework
Reporter: Marshall Schor
Assignee: Marshall Schor
Fix For: 3.0.0SDKexp
Feature Structures have IDs; these show up in externalized formats. In v2,
these were the int heap address. In V3, these are incrementing ints, starting
at 1.
Support is needed (for backwards compatibility, and perhaps other uses) to go
from an "id" to the Java Feature Structure. The id's are dense, except for
those which might be reclaimed by the garbage collector. We support the
reverse map from ids to Feature Structures using a list of Feature Structures,
kept in creation order. Since IDs continually increment, all addition is done
at the end.
To allow garbage collection to work, this table references the Feature
Structures via WeakReferences. The table supports also a version where GC for
Feature Structures is disabled; this might be needed for some applications
where users held onto low level ints and expected to be able to get the Feature
Structures from them, even if they weren't reachable via some non-GC'd Java
Object.
When operated in gc-enabled mode, the binary search to find an element is
modified to skip any WeakReferences whose data has been garbage collected.
Furthermore, the table is reorganized occasionally to reclaim no-longer-used
WeakReference.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)