[
https://issues.apache.org/jira/browse/UIMA-5662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16293004#comment-16293004
]
Marshall Schor commented on UIMA-5662:
--------------------------------------
I generally share your view on ThreadLocal - it has poor visibility
properties...
The number of APIs being modified could be quite large. These would be APIs I
guess taking an additional boolean argument. We've done several iterations on
these APIs, and have multiple styles. The last one IIRC is the CasIOUtils,
with the load(...) in many forms. These are mostly cover apis that translate
into other public api alternative calls. Additional arguments would need to be
passed down through multiple layers of these. So this ends up being lots of
user-facing APIs needing additional args times lots of "layers" in the API
calls.
I guess I was dreading getting all of this right... and so, on balance, I
thought the ThreadLocal approach would be a safer, more reliable, change. The
reason it's a "thread-local" is to support multi-threaded apps, where only some
threads want this; the threads could easily be working on different CASes, and
have nothing in particular to do with each other (more like a kind of scale-up
within a single machine having many CPUs)..
> uv3 support CAS deserialization subsequent low level access
> -----------------------------------------------------------
>
> Key: UIMA-5662
> URL: https://issues.apache.org/jira/browse/UIMA-5662
> Project: UIMA
> Issue Type: Improvement
> Components: Core Java Framework
> Affects Versions: 3.0.0SDK-beta
> Reporter: Marshall Schor
> Assignee: Marshall Schor
> Priority: Minor
> Fix For: 3.0.0SDK
>
>
> Some users depend 1) constant v2-ids for FSs preserved in deserialization and
> serialization, and 2) low level cas API access to these.
> V3 normally doesn't maintain tables linking ids to FSs, as these (unless weak
> refs are used) prevent GC of unreachable FSs.
> Based on a mode, set by -Duima.deserialize_perserve_ids, and also
> controllable by new config option per deserialize call, alter the
> deserialization for those deserializers which know about v2 ids, to put these
> into the map used for low-level CAS access, using the actual v2 ids, and
> change the v3 next available id for future new FSs to be 1 beyond the end.
> The -Duima.deserialize-preserve_ids global setting is needed to handle the
> use case of some annotators using low-level APIs, when part of a pipeline is
> "remoted".
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)