Class ReusedBufferedIndexOutput

java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.store.IndexOutput
org.apache.solr.blockcache.ReusedBufferedIndexOutput
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
CachedIndexOutput

public abstract class ReusedBufferedIndexOutput extends org.apache.lucene.store.IndexOutput
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected byte[]
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReusedBufferedIndexOutput(String resourceDescription, String name)
     
    ReusedBufferedIndexOutput(String resourceDescription, String name, int bufferSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected abstract void
     
    protected void
    Write the buffered bytes to cache
    protected long
     
    long
     
    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

    alignFilePointer, alignOffset, getChecksum, getName, toString

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

    copyBytes, writeBytes, writeGroupVInts, writeGroupVInts, 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 Details

    • BUFFER_SIZE

      public static final int BUFFER_SIZE
      See Also:
    • buffer

      protected byte[] buffer
  • Constructor Details

    • ReusedBufferedIndexOutput

      public ReusedBufferedIndexOutput(String resourceDescription, String name)
    • ReusedBufferedIndexOutput

      public ReusedBufferedIndexOutput(String resourceDescription, String name, int bufferSize)
  • Method Details

    • 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 AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class org.apache.lucene.store.IndexOutput
      Throws:
      IOException
    • getFilePointer

      public long getFilePointer()
      Specified by:
      getFilePointer in class org.apache.lucene.store.IndexOutput
    • writeByte

      public void writeByte(byte b) throws IOException
      Specified by:
      writeByte in class org.apache.lucene.store.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 org.apache.lucene.store.DataOutput
      Throws:
      IOException