ByteWritesTrackingDirectoryWrapper (Lucene 10.5.0 misc API)
Description: declaration: package: org.apache.lucene.misc.store, class: ByteWritesTrackingDirectoryWrapper

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`

public final class ByteWritesTrackingDirectoryWrapper extends FilterDirectory
`FilterDirectory` that tracks write amplification factor

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final boolean`
  `trackTempOutput`

  ### Fields inherited from class org.apache.lucene.store.FilterDirectory

  `in`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ByteWritesTrackingDirectoryWrapper(Directory in)`
  `ByteWritesTrackingDirectoryWrapper(Directory in, boolean trackTempOutput)`
  Constructor with option to track tempOutput

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IndexOutput`
  `createOutput(String name, IOContext ioContext)`
  `IndexOutput`
  `createTempOutput(String prefix, String suffix, IOContext ioContext)`
  `long`
  `getFlushedBytes()`
  `long`
  `getMergedBytes()`

  ### 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### trackTempOutput

    public final boolean trackTempOutput

- ## Constructor Details

  - ### ByteWritesTrackingDirectoryWrapper

    public ByteWritesTrackingDirectoryWrapper(Directory in)

  - ### ByteWritesTrackingDirectoryWrapper

    public ByteWritesTrackingDirectoryWrapper(Directory in, boolean trackTempOutput)
    Constructor with option to track tempOutput
    Parameters:
      `in` - input Directory
      `trackTempOutput` - if true, will also track temporary outputs created by this directory

- ## Method Details

  - ### createOutput

    public IndexOutput createOutput(String name, IOContext ioContext) throws IOException
    Overrides:
      `createOutput` in class `FilterDirectory`
    Throws:
      `IOException`

  - ### createTempOutput

    public IndexOutput createTempOutput(String prefix, String suffix, IOContext ioContext) throws IOException
    Overrides:
      `createTempOutput` in class `FilterDirectory`
    Throws:
      `IOException`

  - ### getFlushedBytes

    public long getFlushedBytes()

  - ### getMergedBytes

    public long getMergedBytes()