Class IndexStore.SnapshotIndexSet

  • All Implemented Interfaces:
    IndexSet
    Enclosing class:
    IndexStore

    private class IndexStore.SnapshotIndexSet
    extends java.lang.Object
    implements IndexSet
    The implementation of IndexSet which represents a mutable snapshot of the indices stored in this set.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ByteBuffer buf
      A snapshot of the allocation table.
      private int buf_length
      The length of the allocation table.
      private IntegerVector deleted_sectors
      The sectors that are to be deleted when a garbage collection cycle occurs.
      private java.util.ArrayList integer_lists
      The list of IndexIntegerList objects that have been returned via the 'getIndex(n)' method.
      private long set_id
      A unique id given to this index set.
    • Constructor Summary

      Constructors 
      Constructor Description
      SnapshotIndexSet​(byte[] in_buf, int length)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) IntegerVector allDeletedSectors()
      Returns the sectors that were deleted when this store committed.
      (package private) byte[] commit()
      Creates a new buffer for an index store if it is committed.
      void dispose()
      Cleans up and disposes the resources associated with this set of index.
      void finalize()  
      IndexStore.IndexIntegerList[] getAllLists()
      Returns all the lists that have been created by calls to 'getIndex'
      private ByteBuffer getByteBuffer()
      Returns the ByteBuffer for the snapshot of this store when it was created.
      (package private) long getID()
      Returns the unique id associated with this index store.
      IntegerListInterface getIndex​(int n)
      Returns a mutable object that implements IntegerListInterface for the given index number in this set of indices.
      (package private) boolean hasDeletedSectors()
      Returns true if this store has deleted items.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • set_id

        private long set_id
        A unique id given to this index set.
      • buf

        private ByteBuffer buf
        A snapshot of the allocation table.
      • buf_length

        private int buf_length
        The length of the allocation table.
      • integer_lists

        private java.util.ArrayList integer_lists
        The list of IndexIntegerList objects that have been returned via the 'getIndex(n)' method.
      • deleted_sectors

        private IntegerVector deleted_sectors
        The sectors that are to be deleted when a garbage collection cycle occurs.
    • Constructor Detail

      • SnapshotIndexSet

        public SnapshotIndexSet​(byte[] in_buf,
                                int length)
        Constructor.
    • Method Detail

      • getByteBuffer

        private ByteBuffer getByteBuffer()
        Returns the ByteBuffer for the snapshot of this store when it was created.
      • getID

        long getID()
        Returns the unique id associated with this index store.
      • hasDeletedSectors

        boolean hasDeletedSectors()
        Returns true if this store has deleted items.
      • allDeletedSectors

        IntegerVector allDeletedSectors()
        Returns the sectors that were deleted when this store committed.
      • commit

        byte[] commit()
        Creates a new buffer for an index store if it is committed. This also sets up the 'deleted_sectors' list which is a list of records deleted when this store commits.
      • getIndex

        public IntegerListInterface getIndex​(int n)
        Description copied from interface: IndexSet
        Returns a mutable object that implements IntegerListInterface for the given index number in this set of indices.
        Specified by:
        getIndex in interface IndexSet
      • dispose

        public void dispose()
        Description copied from interface: IndexSet
        Cleans up and disposes the resources associated with this set of index.
        Specified by:
        dispose in interface IndexSet
      • finalize

        public void finalize()
        Overrides:
        finalize in class java.lang.Object