org.apache.lucene.store.jdbc.index
Class FetchOnBufferReadJdbcIndexInput

java.lang.Object
  extended by org.apache.lucene.store.IndexInput
      extended by org.apache.lucene.store.ConfigurableBufferedIndexInput
          extended by org.apache.lucene.store.jdbc.index.JdbcBufferedIndexInput
              extended by org.apache.lucene.store.jdbc.index.FetchOnBufferReadJdbcIndexInput
All Implemented Interfaces:
Cloneable, JdbcIndexConfigurable

public class FetchOnBufferReadJdbcIndexInput
extends JdbcBufferedIndexInput

An IndexInput implementation, that for every buffer refill will go and fetch the data from the database.

Author:
kimchy

Field Summary
 
Fields inherited from class org.apache.lucene.store.jdbc.index.JdbcBufferedIndexInput
BUFFER_SIZE_SETTING
 
Fields inherited from class org.apache.lucene.store.ConfigurableBufferedIndexInput
buffer, BUFFER_SIZE, bufferLength, bufferPosition, bufferSize, bufferStart
 
Constructor Summary
FetchOnBufferReadJdbcIndexInput()
           
 
Method Summary
 void close()
           
 void configure(String name, JdbcDirectory jdbcDirectory, JdbcFileEntrySettings settings)
          Configures the newly created IndexInput or IndexOutput implementations.
 long length()
           
protected  void readInternal(byte[] b, int offset, int length)
          Expert: implements buffer refill.
protected  void refill()
           
protected  void seekInternal(long pos)
          Expert: implements seek.
 
Methods inherited from class org.apache.lucene.store.ConfigurableBufferedIndexInput
clone, getBufferSize, getFilePointer, readByte, readBytes, seek, setBufferSize
 
Methods inherited from class org.apache.lucene.store.IndexInput
readBytes, readChars, readInt, readLong, readString, readVInt, readVLong, setModifiedUTF8StringsMode, skipChars
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FetchOnBufferReadJdbcIndexInput

public FetchOnBufferReadJdbcIndexInput()
Method Detail

configure

public void configure(String name,
                      JdbcDirectory jdbcDirectory,
                      JdbcFileEntrySettings settings)
               throws IOException
Description copied from interface: JdbcIndexConfigurable
Configures the newly created IndexInput or IndexOutput implementations.

Specified by:
configure in interface JdbcIndexConfigurable
Overrides:
configure in class JdbcBufferedIndexInput
Parameters:
name - The name of the file entry
jdbcDirectory - The jdbc directory instance
settings - The relevant file entry settings
Throws:
IOException

refill

protected void refill()
               throws IOException
Overrides:
refill in class ConfigurableBufferedIndexInput
Throws:
IOException

readInternal

protected void readInternal(byte[] b,
                            int offset,
                            int length)
                     throws IOException
Description copied from class: ConfigurableBufferedIndexInput
Expert: implements buffer refill. Reads bytes from the current position in the input.

Specified by:
readInternal in class ConfigurableBufferedIndexInput
Parameters:
b - the array to read bytes into
offset - the offset in the array to start storing bytes
length - the number of bytes to read
Throws:
IOException

seekInternal

protected void seekInternal(long pos)
                     throws IOException
Description copied from class: ConfigurableBufferedIndexInput
Expert: implements seek. Sets current position in this file, where the next ConfigurableBufferedIndexInput.readInternal(byte[],int,int) will occur.

Specified by:
seekInternal in class ConfigurableBufferedIndexInput
Throws:
IOException
See Also:
ConfigurableBufferedIndexInput.readInternal(byte[],int,int)

close

public void close()
           throws IOException
Specified by:
close in class IndexInput
Throws:
IOException

length

public long length()
Specified by:
length in class IndexInput


Copyright (c) 2004-2008 The Compass Project.