Interface PositionStore

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
FilePositionStore, NoPositionStore

public interface PositionStore extends Closeable
Interface to storage for tracking the read position in a file.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot io)
  • Method Summary

    Modifier and Type
    Method
    Description
    getPosition(String identifier)
    Get the read location in the file identified by a hash.
    void
    setPosition(String identifier, long position)
    Update the read offset from the beginning of the file for the specified file identifier.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • getPosition

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

      void setPosition(String identifier, long position)
      Update the read offset from the beginning of the file for the specified file identifier.
      Parameters:
      identifier - unique identifier for the file.
      position - the new read offset from the beginning of the file in bytes.