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

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

public class FetchOnOpenJdbcIndexInput
extends IndexInput
implements JdbcIndexConfigurable

An IndexInput implementation that will read all the relevant data from the database when created, and will cache it untill it is closed.

Used for small file entries in the database like the segments file.

Author:
kimchy

Constructor Summary
FetchOnOpenJdbcIndexInput()
           
 
Method Summary
 void close()
           
 void configure(String name, JdbcDirectory jdbcDirectory, JdbcFileEntrySettings settings)
          Configures the newly created IndexInput or IndexOutput implementations.
 long getFilePointer()
           
 long length()
           
 byte readByte()
           
 void readBytes(byte[] b, int offset, int len)
           
 void seek(long pos)
           
 
Methods inherited from class org.apache.lucene.store.IndexInput
clone, 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

FetchOnOpenJdbcIndexInput

public FetchOnOpenJdbcIndexInput()
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
Parameters:
name - The name of the file entry
jdbcDirectory - The jdbc directory instance
settings - The relevant file entry settings
Throws:
IOException

readByte

public byte readByte()
              throws IOException
Specified by:
readByte in class IndexInput
Throws:
IOException

readBytes

public void readBytes(byte[] b,
                      int offset,
                      int len)
               throws IOException
Specified by:
readBytes in class IndexInput
Throws:
IOException

close

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

getFilePointer

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

seek

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

length

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


Copyright (c) 2004-2008 The Compass Project.