org.apache.solr.store.blockcache

## Class ReusedBufferedIndexOutput

- java.lang.Object
- - org.apache.lucene.store.DataOutput
  - - org.apache.lucene.store.IndexOutput
    - - org.apache.solr.store.blockcache.ReusedBufferedIndexOutput

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Direct Known Subclasses:
    CachedIndexOutput

      public abstract class ReusedBufferedIndexOutput
      extends IndexOutput

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected byte[]` | `buffer`
    `static int` | `BUFFER_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReusedBufferedIndexOutput(String resourceDescription, String name)`
    `ReusedBufferedIndexOutput(String resourceDescription, String name, int bufferSize)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `protected abstract void` | `closeInternal()`
    `protected void` | `flushBufferToCache()` Write the buffered bytes to cache
    `protected long` | `getBufferStart()`
    `long` | `getFilePointer()`
    `void` | `writeByte(byte b)`
    `void` | `writeBytes(byte[] b, int offset, int length)`
    `protected abstract void` | `writeInternal(byte[] b, int offset, int length)` Expert: implements buffer flushing to cache.

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

      `getChecksum, getName, toString`

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

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

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

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

- - ### Field Detail

    - #### BUFFER_SIZE

          public static final int BUFFER_SIZE

      See Also:
        Constant Field Values

    - #### buffer

          protected byte[] buffer

  - ### Constructor Detail

    - #### ReusedBufferedIndexOutput

          public ReusedBufferedIndexOutput(String resourceDescription,
                                           String name)

    - #### ReusedBufferedIndexOutput

          public ReusedBufferedIndexOutput(String resourceDescription,
                                           String name,
                                           int bufferSize)

  - ### Method Detail

    - #### getBufferStart

          protected long getBufferStart()

    - #### flushBufferToCache

          protected void flushBufferToCache()
                                     throws IOException

      Write the buffered bytes to cache
      Throws:
        `IOException`

    - #### closeInternal

          protected abstract void closeInternal()
                                         throws IOException

      Throws:
        `IOException`

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

    - #### writeInternal

          protected abstract void writeInternal(byte[] b,
                                                int offset,
                                                int length)
                                         throws IOException

      Expert: implements buffer flushing to cache. Writes bytes to the current position in the output.
      Parameters:
        `b` - the array of bytes to write
        `offset` - the offset in the array of bytes to write
        `length` - the number of bytes to write
      Throws:
        `IOException`

    - #### writeBytes

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

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

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