Class BlobIdTracker

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, BlobTracker

    public class BlobIdTracker
    extends java.lang.Object
    implements java.io.Closeable, BlobTracker
    Tracks the blob ids available or added in the blob store using the BlobIdTracker.BlobIdStore .
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.io.File recs)
      Adds the ids in the given file.
      void add​(java.lang.String id)
      Adds the given id.
      void add​(java.util.Iterator<java.lang.String> recs)
      Adds the given ids.
      static BlobIdTracker build​(java.lang.String path, java.lang.String repositoryId, long snapshotIntervalSecs, SharedDataStore datastore)  
      void close()
      Closes the tracker and the underlying store.
      java.util.Iterator<java.lang.String> get()
      Retrieves all the reference files available in the DataStore and merges them to the local store and then returns an iterator over it.
      java.io.File get​(java.lang.String path)
      Fetches a File object which having all the sorted records.
      BlobIdTracker.ActiveDeletionTracker getDeleteTracker()  
      void remove​(java.io.File recs)
      Remove the ids in the given file and deletes the file.
      void remove​(java.io.File recs, BlobTracker.Options options)
      Remove the ids in the given file and deletes the file.
      void remove​(java.util.Iterator<java.lang.String> recs)
      Remove the given ids.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • build

        public static BlobIdTracker build​(java.lang.String path,
                                          java.lang.String repositoryId,
                                          long snapshotIntervalSecs,
                                          SharedDataStore datastore)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • remove

        public void remove​(java.io.File recs,
                           BlobTracker.Options options)
                    throws java.io.IOException
        Description copied from interface: BlobTracker
        Remove the ids in the given file and deletes the file.
        Specified by:
        remove in interface BlobTracker
        Throws:
        java.io.IOException
      • remove

        public void remove​(java.io.File recs)
                    throws java.io.IOException
        Description copied from interface: BlobTracker
        Remove the ids in the given file and deletes the file.
        Specified by:
        remove in interface BlobTracker
        Throws:
        java.io.IOException
      • remove

        public void remove​(java.util.Iterator<java.lang.String> recs)
                    throws java.io.IOException
        Description copied from interface: BlobTracker
        Remove the given ids.
        Specified by:
        remove in interface BlobTracker
        Throws:
        java.io.IOException
      • add

        public void add​(java.lang.String id)
                 throws java.io.IOException
        Description copied from interface: BlobTracker
        Adds the given id.
        Specified by:
        add in interface BlobTracker
        Parameters:
        id - the record id to be tracked
        Throws:
        java.io.IOException
      • add

        public void add​(java.util.Iterator<java.lang.String> recs)
                 throws java.io.IOException
        Description copied from interface: BlobTracker
        Adds the given ids.
        Specified by:
        add in interface BlobTracker
        Throws:
        java.io.IOException
      • add

        public void add​(java.io.File recs)
                 throws java.io.IOException
        Description copied from interface: BlobTracker
        Adds the ids in the given file.
        Specified by:
        add in interface BlobTracker
        Throws:
        java.io.IOException
      • get

        public java.util.Iterator<java.lang.String> get()
                                                 throws java.io.IOException
        Retrieves all the reference files available in the DataStore and merges them to the local store and then returns an iterator over it. This way the ids returned are as recent as the snapshots taken on all instances/repositories connected to the DataStore.

        The iterator returned ia a Closeable instance and should be closed by calling #close().

        Specified by:
        get in interface BlobTracker
        Returns:
        iterator over all the blob ids available
        Throws:
        java.io.IOException
      • get

        public java.io.File get​(java.lang.String path)
                         throws java.io.IOException
        Description copied from interface: BlobTracker
        Fetches a File object which having all the sorted records. The lifecycle of the returned File handle is the responsibility of the handler.
        Specified by:
        get in interface BlobTracker
        Returns:
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Closes the tracker and the underlying store.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException