org.apache.solr.store.blockcache

## Class CachedIndexOutput

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

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class CachedIndexOutput
      extends ReusedBufferedIndexOutput

  Cache the blocks as they are written. The cache file name is the name of the file until the file is closed, at which point the cache is updated to include the last modified date (which is unknown until that point).
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from class org.apache.solr.store.blockcache.ReusedBufferedIndexOutput

      `buffer, BUFFER_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CachedIndexOutput(BlockDirectory directory, IndexOutput dest, int blockSize, String name, Cache cache, int bufferSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeInternal()`
    `long` | `getChecksum()`
    `void` | `writeInternal(byte[] b, int offset, int length)` Expert: implements buffer flushing to cache.

    - ### Methods inherited from class org.apache.solr.store.blockcache.ReusedBufferedIndexOutput

      `close, flushBufferToCache, getBufferStart, getFilePointer, writeByte, writeBytes`

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

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

- - ### Constructor Detail

    - #### CachedIndexOutput

          public CachedIndexOutput(BlockDirectory directory,
                                   IndexOutput dest,
                                   int blockSize,
                                   String name,
                                   Cache cache,
                                   int bufferSize)

  - ### Method Detail

    - #### closeInternal

          public void closeInternal()
                             throws IOException

      Specified by:
        `closeInternal` in class `ReusedBufferedIndexOutput`
      Throws:
        `IOException`

    - #### writeInternal

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

      Description copied from class: `ReusedBufferedIndexOutput`
      Expert: implements buffer flushing to cache. Writes bytes to the current position in the output.
      Specified by:
        `writeInternal` in class `ReusedBufferedIndexOutput`
      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`

    - #### getChecksum

          public long getChecksum()
                           throws IOException

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

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