Class MultiFileWriter

java.lang.Object
org.elasticsearch.core.AbstractRefCounted
org.elasticsearch.indices.recovery.MultiFileWriter
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable

public class MultiFileWriter extends org.elasticsearch.core.AbstractRefCounted implements org.elasticsearch.core.Releasable
  • Constructor Details

  • Method Details

    • writeFileChunk

      public void writeFileChunk(StoreFileMetadata fileMetadata, long position, ReleasableBytesReference content, boolean lastChunk) throws IOException
      Throws:
      IOException
    • getOpenIndexOutput

      public org.apache.lucene.store.IndexOutput getOpenIndexOutput(String key)
    • removeOpenIndexOutputs

      public org.apache.lucene.store.IndexOutput removeOpenIndexOutputs(String name)
      remove and IndexOutput for a given file. It is the caller's responsibility to close it
    • openAndPutIndexOutput

      public org.apache.lucene.store.IndexOutput openAndPutIndexOutput(String fileName, StoreFileMetadata metadata, Store store) throws IOException
      Creates an IndexOutput for the given file name. Note that the IndexOutput actually point at a temporary file.

      Note: You can use getOpenIndexOutput(String) with the same filename to retrieve the same IndexOutput at a later stage

      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • closeInternal

      protected void closeInternal()
      Specified by:
      closeInternal in class org.elasticsearch.core.AbstractRefCounted
    • renameAllTempFiles

      public void renameAllTempFiles() throws IOException
      renames all temporary files to their true name, potentially overriding existing files
      Throws:
      IOException