org.apache.blur.store.buffer
Class ReusedBufferedIndexInput

java.lang.Object
  extended by org.apache.lucene.store.DataInput
      extended by org.apache.lucene.store.IndexInput
          extended by org.apache.blur.store.buffer.ReusedBufferedIndexInput
All Implemented Interfaces:
Closeable, Cloneable
Direct Known Subclasses:
HdfsIndexInput

public abstract class ReusedBufferedIndexInput
extends org.apache.lucene.store.IndexInput

Base implementation class for buffered IndexInput.


Field Summary
static int BUFFER_SIZE
          Default buffer size set to 1024
static int MERGE_BUFFER_SIZE
          A buffer size for merges set to 8192, 4k in Lucene
 
Constructor Summary
ReusedBufferedIndexInput(String resourceDesc)
           
ReusedBufferedIndexInput(String resourceDesc, int bufferSize)
          Inits BufferedIndexInput with a specific bufferSize
ReusedBufferedIndexInput(String resourceDesc, org.apache.lucene.store.IOContext context)
           
 
Method Summary
static int bufferSize(org.apache.lucene.store.IOContext context)
          Returns default buffer sizes for the given IOContext
 ReusedBufferedIndexInput clone()
           
 void close()
           
 int getBufferSize()
          Returns buffer size.
 long getFilePointer()
           
 byte readByte()
           
 void readBytes(byte[] b, int offset, int len)
           
 void readBytes(byte[] b, int offset, int len, boolean useBuffer)
           
 int readInt()
           
 long readLong()
           
 short readShort()
           
 int readVInt()
           
 long readVLong()
           
 void seek(long pos)
           
 
Methods inherited from class org.apache.lucene.store.IndexInput
length, toString
 
Methods inherited from class org.apache.lucene.store.DataInput
readString, readStringSet, readStringStringMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MERGE_BUFFER_SIZE

public static final int MERGE_BUFFER_SIZE
A buffer size for merges set to 8192, 4k in Lucene

See Also:
Constant Field Values

BUFFER_SIZE

public static final int BUFFER_SIZE
Default buffer size set to 1024

See Also:
Constant Field Values
Constructor Detail

ReusedBufferedIndexInput

public ReusedBufferedIndexInput(String resourceDesc)

ReusedBufferedIndexInput

public ReusedBufferedIndexInput(String resourceDesc,
                                org.apache.lucene.store.IOContext context)

ReusedBufferedIndexInput

public ReusedBufferedIndexInput(String resourceDesc,
                                int bufferSize)
Inits BufferedIndexInput with a specific bufferSize

Method Detail

close

public final void close()
                 throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class org.apache.lucene.store.IndexInput
Throws:
IOException

readByte

public final byte readByte()
                    throws IOException
Specified by:
readByte in class org.apache.lucene.store.DataInput
Throws:
IOException

getBufferSize

public final int getBufferSize()
Returns buffer size. @see #setBufferSize


readBytes

public final void readBytes(byte[] b,
                            int offset,
                            int len)
                     throws IOException
Specified by:
readBytes in class org.apache.lucene.store.DataInput
Throws:
IOException

readBytes

public final void readBytes(byte[] b,
                            int offset,
                            int len,
                            boolean useBuffer)
                     throws IOException
Overrides:
readBytes in class org.apache.lucene.store.DataInput
Throws:
IOException

readShort

public final short readShort()
                      throws IOException
Overrides:
readShort in class org.apache.lucene.store.DataInput
Throws:
IOException

readInt

public final int readInt()
                  throws IOException
Overrides:
readInt in class org.apache.lucene.store.DataInput
Throws:
IOException

readLong

public final long readLong()
                    throws IOException
Overrides:
readLong in class org.apache.lucene.store.DataInput
Throws:
IOException

readVInt

public final int readVInt()
                   throws IOException
Overrides:
readVInt in class org.apache.lucene.store.DataInput
Throws:
IOException

readVLong

public final long readVLong()
                     throws IOException
Overrides:
readVLong in class org.apache.lucene.store.DataInput
Throws:
IOException

getFilePointer

public final long getFilePointer()
Specified by:
getFilePointer in class org.apache.lucene.store.IndexInput

seek

public final void seek(long pos)
                throws IOException
Specified by:
seek in class org.apache.lucene.store.IndexInput
Throws:
IOException

clone

public ReusedBufferedIndexInput clone()
Overrides:
clone in class org.apache.lucene.store.IndexInput

bufferSize

public static int bufferSize(org.apache.lucene.store.IOContext context)
Returns default buffer sizes for the given IOContext



Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.