org.apache.lucene.util

## Class ThrottledIndexOutput

- java.lang.Object
- - org.apache.lucene.store.DataOutput
  - - org.apache.lucene.store.IndexOutput
    - - org.apache.lucene.util.ThrottledIndexOutput

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class ThrottledIndexOutput
      extends IndexOutput

  Intentionally slow IndexOutput for testing.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_MIN_WRITTEN_BYTES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, IndexOutput delegate)`
    `ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput delegate)`
    `ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `copyBytes(DataInput input, long numBytes)`
    `long` | `getChecksum()`
    `protected long` | `getDelay(boolean closing)`
    `long` | `getFilePointer()`
    `static int` | `mBitsToBytes(int mbits)`
    `ThrottledIndexOutput` | `newFromDelegate(IndexOutput output)`
    `void` | `writeByte(byte b)`
    `void` | `writeBytes(byte[] b, int offset, int length)`

    - ### Methods inherited from class org.apache.lucene.store.IndexOutput

      `getName, toString`

    - ### Methods inherited from class org.apache.lucene.store.DataOutput

      `writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong`

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

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

- - ### Field Detail

    - #### DEFAULT_MIN_WRITTEN_BYTES

          public static final int DEFAULT_MIN_WRITTEN_BYTES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ThrottledIndexOutput

          public ThrottledIndexOutput(int bytesPerSecond,
                                      long delayInMillis,
                                      IndexOutput delegate)

    - #### ThrottledIndexOutput

          public ThrottledIndexOutput(int bytesPerSecond,
                                      long delays,
                                      int minBytesWritten,
                                      IndexOutput delegate)

    - #### ThrottledIndexOutput

          public ThrottledIndexOutput(int bytesPerSecond,
                                      long flushDelayMillis,
                                      long closeDelayMillis,
                                      long seekDelayMillis,
                                      long minBytesWritten,
                                      IndexOutput delegate)

  - ### Method Detail

    - #### newFromDelegate

          public ThrottledIndexOutput newFromDelegate(IndexOutput output)

    - #### mBitsToBytes

          public static final int mBitsToBytes(int mbits)

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `IndexOutput`
      Throws:
        `IOException`

    - #### getFilePointer

          public long getFilePointer()

      Specified by:
        `getFilePointer` in class `IndexOutput`

    - #### writeByte

          public void writeByte(byte b)
                         throws IOException

      Specified by:
        `writeByte` in class `DataOutput`
      Throws:
        `IOException`

    - #### writeBytes

          public void writeBytes(byte[] b,
                                 int offset,
                                 int length)
                          throws IOException

      Specified by:
        `writeBytes` in class `DataOutput`
      Throws:
        `IOException`

    - #### getDelay

          protected long getDelay(boolean closing)

    - #### copyBytes

          public void copyBytes(DataInput input,
                                long numBytes)
                         throws IOException

      Overrides:
        `copyBytes` in class `DataOutput`
      Throws:
        `IOException`

    - #### getChecksum

          public long getChecksum()
                           throws IOException

      Specified by:
        `getChecksum` in class `IndexOutput`
      Throws:
        `IOException`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.