Class CommonSerDesSequential

java.lang.Object
org.apache.uima.cas.impl.CommonSerDesSequential

public class CommonSerDesSequential extends Object
Common de/serialization for plain binary and compressed binary form 4 which both used to walk the cas using the sequential, incrementing id approach Lifecycle: There is 0/1 instance per CAS, representing the FSs at some point in time in that CAS. Creation: serialization (for delta serialization, the csds made when deserialization was done is reused, if available Updates cannot add to the reachables). non-delta deserialization delta deserialization uses previous one Reset: CAS Reset API call (for optimization - used after all delta deserializations into a particular CAS are complete. Logical constraints: - delta de/serialization must use an existing version of this, -- set during a previous non-delta de/serialization -- or created just in time via a scan of the cas
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final Int2ObjHashMap<TOP,TOP>
    a map from the modelled (v2 style) FS addr to the V3 FS created when serializing (non-delta), deserializing (non-delta) augmented when deserializing(delta) used when deserializing (delta and non-delta) retained after deserializing (in case of subsequent delta (multiple) deserializations being combined) For delta, the addr is the modeled addr for the full CAS including both above and below the line.
    private final CASImpl
    The associated CAS
    (package private) final Obj2IntIdentityHashMap<TOP>
    a map from a fs to its addr in the modeled heap, == v2 style addr created during serialization and deserialization used during serialization to create addr info for index info serialization For delta, the addr is the modeled addr for the full CAS including both above and below the line.
    private int
    The first free (available) simulated heap addr, also the last addr + length of that
    private final List<TOP>
     
    private final List<TOP>
    The FSs in this list are not necessarily sequential, but is in ascending (simulated heap) order, needed for V2 compatibility of serialized forms.
    static final boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    addFS(TOP fs, int addr)
    Must call in fs sorted order
    (package private) void
    addFS1(TOP fs, int addr)
     
    (package private) void
    addFSunordered(TOP fs, int addr)
    For out of order calls
    (package private) void
     
    (package private) int
     
    (package private) List<TOP>
     
    boolean
     
    private void
     
    (package private) void
    setHeapEnd(int heapEnd)
     
    (package private) List<TOP>
    setup(MarkerImpl mark, int fromAddr)
    Scan all indexed + reachable FSs, sorted, and - create two maps from those to/from the int offsets in the simulated main heap - add all the (filtered - above the mark) FSs to the sortedFSs - set the heapEnd

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TRACE_SETUP

      public static final boolean TRACE_SETUP
      See Also:
    • fs2addr

      final Obj2IntIdentityHashMap<TOP> fs2addr
      a map from a fs to its addr in the modeled heap, == v2 style addr created during serialization and deserialization used during serialization to create addr info for index info serialization For delta, the addr is the modeled addr for the full CAS including both above and below the line.
    • addr2fs

      final Int2ObjHashMap<TOP,TOP> addr2fs
      a map from the modelled (v2 style) FS addr to the V3 FS created when serializing (non-delta), deserializing (non-delta) augmented when deserializing(delta) used when deserializing (delta and non-delta) retained after deserializing (in case of subsequent delta (multiple) deserializations being combined) For delta, the addr is the modeled addr for the full CAS including both above and below the line.
    • sortedFSs

      private final List<TOP> sortedFSs
      The FSs in this list are not necessarily sequential, but is in ascending (simulated heap) order, needed for V2 compatibility of serialized forms. This is populated either during deserialization, or for serialization, from indexed + reachable. Before accessing this, any pending items must be merged (sorting done lazily)
    • pending

      private final List<TOP> pending
    • baseCas

      private final CASImpl baseCas
      The associated CAS
    • heapEnd

      private int heapEnd
      The first free (available) simulated heap addr, also the last addr + length of that
  • Constructor Details

    • CommonSerDesSequential

      public CommonSerDesSequential(CASImpl cas)
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • addFS

      void addFS(TOP fs, int addr)
      Must call in fs sorted order
      Parameters:
      fs -
    • addFS1

      void addFS1(TOP fs, int addr)
    • addFSunordered

      void addFSunordered(TOP fs, int addr)
      For out of order calls
      Parameters:
      fs -
    • clear

      void clear()
    • setup

      List<TOP> setup(MarkerImpl mark, int fromAddr)
      Scan all indexed + reachable FSs, sorted, and - create two maps from those to/from the int offsets in the simulated main heap - add all the (filtered - above the mark) FSs to the sortedFSs - set the heapEnd
      Parameters:
      mark - null or the mark
      fromAddr - often 1 but sometimes the mark next fsid
      Returns:
      all (not filtered) FSs sorted
    • getSortedFSs

      List<TOP> getSortedFSs()
      Returns:
      sorted FSs above mark if mark set, otherwise all, sorted
    • getHeapEnd

      int getHeapEnd()
    • setHeapEnd

      void setHeapEnd(int heapEnd)
    • merge

      private void merge()