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

java.lang.Object
  extended by org.apache.lucene.store.IndexOutput
      extended by org.apache.lucene.store.jdbc.index.JdbcBufferedIndexOutput
          extended by org.apache.lucene.store.jdbc.index.RAMJdbcIndexOutput
All Implemented Interfaces:
JdbcIndexConfigurable

public class RAMJdbcIndexOutput
extends JdbcBufferedIndexOutput

An IndexOutput implemenation that stores all the data written to it in memory, and flushes it to the database when the output is closed.

Useful for small file entries like the segment file.

Author:
kimchy

Field Summary
 
Fields inherited from class org.apache.lucene.store.jdbc.index.JdbcBufferedIndexOutput
BUFFER_SIZE_SETTING, bufferSize, DEFAULT_BUFFER_SIZE
 
Constructor Summary
RAMJdbcIndexOutput()
           
 
Method Summary
 void close()
          Closes this stream to further operations.
 void configure(String name, JdbcDirectory jdbcDirectory, JdbcFileEntrySettings settings)
          Configures the newly created IndexInput or IndexOutput implementations.
 void flushBuffer(byte[] src, int len)
          Expert: implements buffer write.
 void flushToIndexOutput(IndexOutput indexOutput)
           
 long length()
          The number of bytes in the file.
 void seek(long pos)
          Sets current position in this file, where the next write will occur.
 
Methods inherited from class org.apache.lucene.store.jdbc.index.JdbcBufferedIndexOutput
flush, getFilePointer, writeByte, writeBytes
 
Methods inherited from class org.apache.lucene.store.IndexOutput
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

RAMJdbcIndexOutput

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

flushBuffer

public void flushBuffer(byte[] src,
                        int len)
Description copied from class: JdbcBufferedIndexOutput
Expert: implements buffer write. Writes bytes at the current position in the output.

Specified by:
flushBuffer in class JdbcBufferedIndexOutput
Parameters:
src - the bytes to write
len - the number of bytes to write

close

public void close()
           throws IOException
Description copied from class: JdbcBufferedIndexOutput
Closes this stream to further operations.

Overrides:
close in class JdbcBufferedIndexOutput
Throws:
IOException

seek

public void seek(long pos)
          throws IOException
Description copied from class: JdbcBufferedIndexOutput
Sets current position in this file, where the next write will occur.

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

length

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

Specified by:
length in class JdbcBufferedIndexOutput

flushToIndexOutput

public void flushToIndexOutput(IndexOutput indexOutput)
                        throws IOException
Throws:
IOException


Copyright (c) 2004-2006 The Compass Project.