On 12/1/2017 5:39 PM, Richard Eckart de Castilho wrote: > 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 This could be made to work, but as I've said before, it would prevent future GC's from happening on the loaded FSs, should some updates occur which made them unreachable.
Is this acceptable? I don't think I'd want this as the "normal" mode of deserialization. Perhaps we could have some kind of a -Duima.xxxx flag that turned on this mode for those cases which needed it. WDYT? -Marshall > 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
