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 IndexOutput
createByteTrackingOutput
(IndexOutput output, IOContext.Context context) createOutput
(String name, IOContext ioContext) Creates a new, empty file in the directory and returns anIndexOutput
instance for appending data to this file.createTempOutput
(String prefix, String suffix, IOContext ioContext) Creates a new, empty, temporary file in the directory and returns anIndexOutput
instance for appending data to this file.long
long
Methods inherited from class org.apache.lucene.store.FilterDirectory
close, deleteFile, ensureOpen, fileLength, getDelegate, getPendingDeletions, listAll, obtainLock, openInput, rename, sync, syncMetaData, toString, unwrap
Methods 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:Directory
Creates a new, empty file in the directory and returns anIndexOutput
instance for appending data to this file.This method must throw
FileAlreadyExistsException
if the file already exists.- Overrides:
createOutput
in 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:Directory
Creates a new, empty, temporary file in the directory and returns anIndexOutput
instance for appending data to this file.The temporary file name (accessible via
IndexOutput.getName()
) will start withprefix
, end withsuffix
and have a reserved file extension.tmp
.- Overrides:
createTempOutput
in classFilterDirectory
- Throws:
IOException
-
createByteTrackingOutput
-
getFlushedBytes
public long getFlushedBytes() -
getMergedBytes
public long getMergedBytes()
-