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

java.lang.Object
  extended by org.apache.lucene.store.IndexOutput
      extended by org.apache.lucene.store.ConfigurableBufferedIndexOutput
          extended by org.apache.lucene.store.jdbc.index.JdbcBufferedIndexOutput
              extended by org.apache.lucene.store.jdbc.index.AbstractJdbcIndexOutput
                  extended by org.apache.lucene.store.jdbc.index.FileJdbcIndexOutput
All Implemented Interfaces:
JdbcIndexConfigurable
Direct Known Subclasses:
OracleFileJdbcIndexOutput

public class FileJdbcIndexOutput
extends AbstractJdbcIndexOutput

An IndexOutput implemenation that writes all the data to a temporary file, and when closed, flushes the file to the database.

Usefull for large files that are known in advance to be larger then the acceptable threshold configured in RAMAndFileJdbcIndexOutput.

Author:
kimchy

Field Summary
 
Fields inherited from class org.apache.lucene.store.jdbc.index.AbstractJdbcIndexOutput
jdbcDirectory, name
 
Fields inherited from class org.apache.lucene.store.jdbc.index.JdbcBufferedIndexOutput
BUFFER_SIZE_SETTING
 
Fields inherited from class org.apache.lucene.store.ConfigurableBufferedIndexOutput
bufferSize, DEFAULT_BUFFER_SIZE
 
Constructor Summary
FileJdbcIndexOutput()
           
 
Method Summary
 void configure(String name, JdbcDirectory jdbcDirectory, JdbcFileEntrySettings settings)
          Configures the newly created IndexInput or IndexOutput implementations.
protected  void doAfterClose()
           
protected  void doBeforeClose()
           
protected  void flushBuffer(byte[] b, int offset, int len)
          Expert: implements buffer write.
 long length()
          The number of bytes in the file.
protected  InputStream openInputStream()
           
 void seek(long pos)
          Random-access methods
 
Methods inherited from class org.apache.lucene.store.jdbc.index.AbstractJdbcIndexOutput
close
 
Methods inherited from class org.apache.lucene.store.ConfigurableBufferedIndexOutput
flush, getFilePointer, initBuffer, writeByte, writeBytes
 
Methods inherited from class org.apache.lucene.store.IndexOutput
copyBytes, writeBytes, writeChars, writeChars, writeInt, writeLong, writeString, writeVInt, writeVLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileJdbcIndexOutput

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

flushBuffer

protected void flushBuffer(byte[] b,
                           int offset,
                           int len)
                    throws IOException
Description copied from class: ConfigurableBufferedIndexOutput
Expert: implements buffer write. Writes bytes at the current position in the output.

Specified by:
flushBuffer in class ConfigurableBufferedIndexOutput
Parameters:
b - the bytes to write
offset - the offset in the byte array
len - the number of bytes to write
Throws:
IOException

seek

public void seek(long pos)
          throws IOException
Random-access methods

Overrides:
seek in class ConfigurableBufferedIndexOutput
Throws:
IOException
See Also:
ConfigurableBufferedIndexOutput.getFilePointer()

length

public long length()
            throws IOException
Description copied from class: ConfigurableBufferedIndexOutput
The number of bytes in the file.

Specified by:
length in class ConfigurableBufferedIndexOutput
Throws:
IOException

openInputStream

protected InputStream openInputStream()
                               throws IOException
Specified by:
openInputStream in class AbstractJdbcIndexOutput
Throws:
IOException

doBeforeClose

protected void doBeforeClose()
                      throws IOException
Overrides:
doBeforeClose in class AbstractJdbcIndexOutput
Throws:
IOException

doAfterClose

protected void doAfterClose()
                     throws IOException
Overrides:
doAfterClose in class AbstractJdbcIndexOutput
Throws:
IOException


Copyright (c) 2004-2008 The Compass Project.