org.apache.lucene.store.jdbc.index
Class RAMAndFileJdbcIndexOutput
java.lang.Object
org.apache.lucene.store.IndexOutput
org.apache.lucene.store.jdbc.index.RAMAndFileJdbcIndexOutput
- All Implemented Interfaces:
- JdbcIndexConfigurable
- Direct Known Subclasses:
- OracleRAMAndFileJdbcIndexOutput
public class RAMAndFileJdbcIndexOutput
- extends IndexOutput
- implements JdbcIndexConfigurable
An IndexOutput implementation that initially writes the data to a memory buffer. Once it exceeds
the configured threshold (INDEX_OUTPUT_THRESHOLD_SETTING, will start working with a temporary file,
releasing the previous buffer.
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INDEX_OUTPUT_THRESHOLD_SETTING
public static final String INDEX_OUTPUT_THRESHOLD_SETTING
- The threshold setting name. See
JdbcFileEntrySettings.setLongSetting(String, long).
Should be set in bytes.
- See Also:
- Constant Field Values
DEFAULT_THRESHOLD
public static final long DEFAULT_THRESHOLD
- The default value for the threshold (in bytes). Currently 16K.
- See Also:
- Constant Field Values
RAMAndFileJdbcIndexOutput
public RAMAndFileJdbcIndexOutput()
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 entryjdbcDirectory - The jdbc directory instancesettings - The relevant file entry settings
- Throws:
IOException
writeByte
public void writeByte(byte b)
throws IOException
- Specified by:
writeByte in class IndexOutput
- Throws:
IOException
writeBytes
public void writeBytes(byte[] b,
int offset,
int length)
throws IOException
- Specified by:
writeBytes in class IndexOutput
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush in class IndexOutput
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in class IndexOutput
- Throws:
IOException
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointer in class IndexOutput
seek
public void seek(long pos)
throws IOException
- Specified by:
seek in class IndexOutput
- Throws:
IOException
length
public long length()
throws IOException
- Specified by:
length in class IndexOutput
- Throws:
IOException
createFileJdbcIndexOutput
protected FileJdbcIndexOutput createFileJdbcIndexOutput()
createRamJdbcIndexOutput
protected RAMJdbcIndexOutput createRamJdbcIndexOutput()
Copyright (c) 2004-2008 The Compass Project.