org.apache.lucene.store.jdbc.index
Class FetchPerTransactionJdbcIndexInput
java.lang.Object
org.apache.lucene.store.IndexInput
org.apache.lucene.store.ConfigurableBufferedIndexInput
org.apache.lucene.store.jdbc.index.JdbcBufferedIndexInput
org.apache.lucene.store.jdbc.index.FetchPerTransactionJdbcIndexInput
- All Implemented Interfaces:
- Cloneable, JdbcIndexConfigurable
public class FetchPerTransactionJdbcIndexInput
- extends JdbcBufferedIndexInput
Caches blobs per transaction. Only supported for dialects that supports blobs per transaction (see
Dialect.supportTransactionalScopedBlobs()
.
Note, using this index input requires calling the releaseBlobs(java.sql.Connection)
when the transaction
ends. It is automatically taken care of if using TransactionAwareDataSourceProxy
.
If using JTA for example, a transcation synchronization should be registered with JTA to clear the blobs.
- Author:
- kimchy
FetchPerTransactionJdbcIndexInput
public FetchPerTransactionJdbcIndexInput()
releaseBlobs
public static void releaseBlobs(Connection connection)
releaseBlobs
public static void releaseBlobs(Connection connection,
JdbcTable table,
String name)
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 entryjdbcDirectory
- The jdbc directory instancesettings
- 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 intooffset
- the offset in the array to start storing byteslength
- 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.