Module org.apache.lucene.misc
Package org.apache.lucene.misc.store
Class ByteWritesTrackingDirectoryWrapper
java.lang.Object
org.apache.lucene.store.Directory
org.apache.lucene.store.FilterDirectory
org.apache.lucene.misc.store.ByteWritesTrackingDirectoryWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
FilterDirectory that tracks write amplification factor-
Field Summary
FieldsFields inherited from class org.apache.lucene.store.FilterDirectory
in -
Constructor Summary
ConstructorsConstructorDescriptionByteWritesTrackingDirectoryWrapper(Directory in, boolean trackTempOutput) Constructor with option to track tempOutput -
Method Summary
Modifier and TypeMethodDescriptionprivate IndexOutputcreateByteTrackingOutput(IndexOutput output, IOContext.Context context) createOutput(String name, IOContext ioContext) Creates a new, empty file in the directory and returns anIndexOutputinstance for appending data to this file.createTempOutput(String prefix, String suffix, IOContext ioContext) Creates a new, empty, temporary file in the directory and returns anIndexOutputinstance for appending data to this file.longlongMethods inherited from class org.apache.lucene.store.FilterDirectory
close, deleteFile, ensureOpen, fileLength, getDelegate, getPendingDeletions, listAll, obtainLock, openInput, rename, sync, syncMetaData, toString, unwrapMethods inherited from class org.apache.lucene.store.Directory
copyFrom, getTempFileName, openChecksumInput
-
Field Details
-
flushedBytes
-
mergedBytes
-
trackTempOutput
public final boolean trackTempOutput
-
-
Constructor Details
-
ByteWritesTrackingDirectoryWrapper
-
ByteWritesTrackingDirectoryWrapper
Constructor with option to track tempOutput- Parameters:
in- input DirectorytrackTempOutput- if true, will also track temporary outputs created by this directory
-
-
Method Details
-
createOutput
Description copied from class:DirectoryCreates a new, empty file in the directory and returns anIndexOutputinstance for appending data to this file.This method must throw
FileAlreadyExistsExceptionif the file already exists.- Overrides:
createOutputin classFilterDirectory- Parameters:
name- the name of the file to create.- Throws:
IOException- in case of I/O error
-
createTempOutput
public IndexOutput createTempOutput(String prefix, String suffix, IOContext ioContext) throws IOException Description copied from class:DirectoryCreates a new, empty, temporary file in the directory and returns anIndexOutputinstance for appending data to this file.The temporary file name (accessible via
IndexOutput.getName()) will start withprefix, end withsuffixand have a reserved file extension.tmp.- Overrides:
createTempOutputin classFilterDirectory- Throws:
IOException
-
createByteTrackingOutput
-
getFlushedBytes
public long getFlushedBytes() -
getMergedBytes
public long getMergedBytes()
-