On 01.12.2017, at 22:47, Marshall Schor <[email protected]> wrote:
> 
> I'm wondering if some other approach could be done, that would treat these 
> kinds
> of use cases specially, and not have to give up the v3 benefits like GC in the
> general case.
> 
> A more general question: The v3 approach to serialization / deserialization is
> to serialize just those FSs which are indexed, or reachable from other
> serializable things. Does this work for webAnnot?  A consequence would be, 
> that
> deserializing a CAS produced by v2, which had a bunch of FSs which were not
> indexed, and not referenced by anything, would end up being GC'd.
> 
>    Whereas, in v2, they would be in the "cas" and gettable via their "address"
> (integer).
> 
> Is this (maybe made-up) use case something that goes on in WebAnnot?

WebAnno doesn't make use of the unreferenced FSes - there is no problem
if they are GCed. However, WebAnno relies on the fact that for v2 CASes
stored/loaded using CasCompleteSerializer have stable addresses/IDs.

The following should be possible:

* create a FS in the CAS
* let X be the ID of the FS
* save CAS to file
* load CAS to memory
* get the FS from the CAS via X

So X should be stable across the save/load cycle. In v2, this works
because there is no GC when using CasCompleteSerializer. WebAnno as
an alternative way of doing GC at times when the stability of the
IDs is not relevant: it temporarily saves the CAS into form 6 and
then loads it back - this does not only do GC, but also permits 
factoring in changes to the type system.

Cheers,

-- Richard

Reply via email to