Class MultiFileWriter

org.elasticsearch.core.AbstractRefCounted
org.elasticsearch.indices.recovery.MultiFileWriter
All Implemented Interfaces:
, , org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable

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

    Constructors
    Constructor
    Description
    MultiFileWriter​(Store store, RecoveryState.Index indexState,  tempFilePrefix, org.apache.logging.log4j.Logger logger,  ensureOpen)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    org.apache.lucene.store.IndexOutput
     key)
     
    org.apache.lucene.store.IndexOutput
     fileName, StoreFileMetadata metadata, Store store)
    Creates an IndexOutput for the given file name.
    org.apache.lucene.store.IndexOutput
     name)
    remove and IndexOutput for a given file.
    void
    renames all temporary files to their true name, potentially overriding existing files
    void
    writeFileChunk​(StoreFileMetadata fileMetadata, long position, ReleasableBytesReference content, boolean lastChunk)
     

    Methods inherited from class org.elasticsearch.core.AbstractRefCounted

    alreadyClosed, decRef, getName, incRef, refCount, touch, tryIncRef

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

    • MultiFileWriter

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

    • writeFileChunk

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

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

      public org.apache.lucene.store.IndexOutput removeOpenIndexOutputs( 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( 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

      Throws:
    • close

      public void close()
      Specified by:
       in interface 
      Specified by:
       in interface 
      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
      renames all temporary files to their true name, potentially overriding existing files
      Throws: