Class FileHandleAccessor

java.lang.Object
com.illumon.iris.db.util.file.FileHandleAccessor
Direct Known Subclasses:
LocalFileAccessor, TrackedSeekableByteChannel

public abstract class FileHandleAccessor
extends Object
Base class for accessors that wrap a FileHandle with support for interruption and asynchronous close.
  • Field Details

  • Constructor Details

    • FileHandleAccessor

      protected FileHandleAccessor​(@NotNull FileHandleFactory.FileToHandleFunction fileHandleCreator, @NotNull File file)
      Create an accessor that gets handles for file from fileHandleCreator.
      Parameters:
      fileHandleCreator - The function used to make file handles
      file - The abstract path name to access
  • Method Details

    • refreshFileHandle

      protected final FileHandle refreshFileHandle​(FileHandle previousLocalHandle)
      Replace the file handle with a new one if the closed handle passed in is still current, and return the (possibly changed) current value.
      Parameters:
      previousLocalHandle - The closed handle that calling code would like to replace
      Returns:
      The current file handle, possibly newly created