Class NoPositionStore

java.lang.Object
com.arpnetworking.metrics.common.tailer.NoPositionStore
All Implemented Interfaces:
PositionStore, Closeable, AutoCloseable

public class NoPositionStore extends Object implements PositionStore
A PositionStore that always returns absent.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot io)
  • Constructor Details

    • NoPositionStore

      public NoPositionStore()
  • Method Details

    • getPosition

      public Optional<Long> getPosition(String identifier)
      Description copied from interface: PositionStore
      Get the read location in the file identified by a hash.
      Specified by:
      getPosition in interface PositionStore
      Parameters:
      identifier - unique identifier for the file.
      Returns:
      Optional.absent if the file was not found, otherwise a byte offset
    • setPosition

      public void setPosition(String identifier, long position)
      Description copied from interface: PositionStore
      Update the read offset from the beginning of the file for the specified file identifier.
      Specified by:
      setPosition in interface PositionStore
      Parameters:
      identifier - unique identifier for the file.
      position - the new read offset from the beginning of the file in bytes.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException