Class OffsetRepository


  • public class OffsetRepository
    extends java.lang.Object
    Offset collection repository (use for logbook and metadata database)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String COLLECTION_NAME  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void createOrUpdateOffset​(int tenant, java.lang.String strategy, java.lang.String collection, long offset)
      Create or update offset
      long findOffsetBy​(int tenant, java.lang.String strategy, java.lang.String collection)
      Get current offset
      • Methods inherited from class java.lang.Object

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

    • Constructor Detail

      • OffsetRepository

        public OffsetRepository​(MongoDbAccess mongoDbAccess,
                                java.lang.String collectionName)
      • OffsetRepository

        public OffsetRepository​(MongoDbAccess mongoDbAccess)
        Constructor
        Parameters:
        mongoDbAccess - mongoDbAccess
    • Method Detail

      • createOrUpdateOffset

        public void createOrUpdateOffset​(int tenant,
                                         java.lang.String strategy,
                                         java.lang.String collection,
                                         long offset)
        Create or update offset
        Parameters:
        tenant - the tenant
        strategy - the strategy id
        collection - the collection name
      • findOffsetBy

        public long findOffsetBy​(int tenant,
                                 java.lang.String strategy,
                                 java.lang.String collection)
        Get current offset
        Parameters:
        tenant - the tenant
        strategy - the strategy id
        collection - the collection name we want to reconstruct, bat can be any other unique name (graph)
        Returns:
        the offset value for collection/tenant, 0L if not found