org.apache.solr.store.blockcache
Class ReusedBufferedIndexOutput

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

public abstract class ReusedBufferedIndexOutput
extends IndexOutput


Field Summary
protected  byte[] buffer
           
static int BUFFER_SIZE
           
 
Constructor Summary
ReusedBufferedIndexOutput()
           
ReusedBufferedIndexOutput(int bufferSize)
           
 
Method Summary
protected  Object clone()
           
 void close()
           
protected abstract  void closeInternal()
           
 void flush()
           
protected abstract  void flushInternal()
           
protected  long getBufferStart()
           
 long getFilePointer()
           
 long length()
           
 void seek(long pos)
           
protected abstract  void seekInternal(long pos)
           
 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
setLength
 
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeInt, writeLong, writeShort, writeString, writeStringSet, writeStringStringMap, writeVInt, writeVLong
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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()

ReusedBufferedIndexOutput

public ReusedBufferedIndexOutput(int bufferSize)
Method Detail

getBufferStart

protected long getBufferStart()

flushInternal

protected abstract void flushInternal()
                               throws IOException
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in class IndexOutput
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 class IndexOutput
Throws:
IOException

getFilePointer

public long getFilePointer()
Specified by:
getFilePointer in class IndexOutput

seekInternal

protected abstract void seekInternal(long pos)
                              throws IOException
Throws:
IOException

seek

public void seek(long pos)
          throws IOException
Specified by:
seek in class IndexOutput
Throws:
IOException

length

public long length()
            throws IOException
Specified by:
length in class IndexOutput
Throws:
IOException

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

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


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