Class ByteSizeCachingDirectory

java.lang.Object
org.apache.lucene.store.Directory
org.apache.lucene.store.FilterDirectory
org.elasticsearch.index.store.ByteSizeDirectory
org.elasticsearch.index.store.ByteSizeCachingDirectory
All Implemented Interfaces:
Closeable, AutoCloseable

public final class ByteSizeCachingDirectory extends ByteSizeDirectory
  • Method Details

    • estimateSizeInBytes

      public long estimateSizeInBytes() throws IOException
      Specified by:
      estimateSizeInBytes in class ByteSizeDirectory
      Returns:
      the size of the directory
      Throws:
      IOException - if an I/O error occurs
    • estimateDataSetSizeInBytes

      public long estimateDataSetSizeInBytes() throws IOException
      Specified by:
      estimateDataSetSizeInBytes in class ByteSizeDirectory
      Returns:
      the size of the total data set of the directory (which can differ from {ByteSizeDirectory.estimateSizeInBytes()})
      Throws:
      IOException - if an I/O error occurs
    • createOutput

      public org.apache.lucene.store.IndexOutput createOutput(String name, org.apache.lucene.store.IOContext context) throws IOException
      Overrides:
      createOutput in class org.apache.lucene.store.FilterDirectory
      Throws:
      IOException
    • createTempOutput

      public org.apache.lucene.store.IndexOutput createTempOutput(String prefix, String suffix, org.apache.lucene.store.IOContext context) throws IOException
      Overrides:
      createTempOutput in class org.apache.lucene.store.FilterDirectory
      Throws:
      IOException
    • deleteFile

      public void deleteFile(String name) throws IOException
      Overrides:
      deleteFile in class org.apache.lucene.store.FilterDirectory
      Throws:
      IOException
    • markEstimatedSizeAsStale

      public void markEstimatedSizeAsStale()
      Mark the cached size as stale so that it is guaranteed to be refreshed the next time.
    • unwrapDirectory

      public static ByteSizeCachingDirectory unwrapDirectory(org.apache.lucene.store.Directory dir)