Class MultiFileWriter

All Implemented Interfaces:, java.lang.AutoCloseable, Releasable, RefCounted

public class MultiFileWriter
extends AbstractRefCounted
implements Releasable
  • Constructor Details

    • MultiFileWriter

      public MultiFileWriter​(Store store, RecoveryState.Index indexState, java.lang.String tempFilePrefix, org.apache.logging.log4j.Logger logger, java.lang.Runnable ensureOpen)
  • Method Details

    • writeFileChunk

      public void writeFileChunk​(StoreFileMetaData fileMetaData, long position, BytesReference content, boolean lastChunk) throws
    • getOpenIndexOutput

      public getOpenIndexOutput​(java.lang.String key)
    • removeOpenIndexOutputs

      public removeOpenIndexOutputs​(java.lang.String name)
      remove and IndexOutput for a given file. It is the caller's responsibility to close it
    • openAndPutIndexOutput

      public openAndPutIndexOutput​(java.lang.String fileName, StoreFileMetaData metaData, Store store) throws
      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

    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface
      Specified by:
      close in interface Releasable
    • closeInternal

      protected void closeInternal()
      Specified by:
      closeInternal in class AbstractRefCounted
    • renameAllTempFiles

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