org.neo4j.index.impl.lucene
Class LuceneDataSource

java.lang.Object
  extended by org.neo4j.kernel.impl.transaction.xaframework.XaDataSource
      extended by org.neo4j.kernel.impl.transaction.xaframework.LogBackedXaDataSource
          extended by org.neo4j.index.impl.lucene.LuceneDataSource

public class LuceneDataSource
extends LogBackedXaDataSource

An XaDataSource optimized for the LuceneIndexImplementation. This class is public because the XA framework requires it.


Field Summary
static byte[] DEFAULT_BRANCH_ID
           
static String DEFAULT_NAME
           
static org.apache.lucene.analysis.Analyzer KEYWORD_ANALYZER
           
static org.apache.lucene.analysis.Analyzer LOWER_CASE_WHITESPACE_ANALYZER
          Default Analyzer for fulltext parsing.
static org.apache.lucene.util.Version LUCENE_VERSION
           
static org.apache.lucene.analysis.Analyzer WHITESPACE_ANALYZER
           
 
Constructor Summary
LuceneDataSource(Map<Object,Object> params)
          Constructs this data source.
 
Method Summary
 void close()
          Closes this data source.
 long getCreationTime()
          Returns a timestamp when this data source was created.
 long getCurrentLogVersion()
          Returns the current version of this data source.
 long getLastCommittedTxId()
           
 long getRandomIdentifier()
          Returns a random identifier that gets generated when the data source is created.
 XaConnection getXaConnection()
          Creates a XA connection to the resource this data source represents.
 XaContainer getXaContainer()
           
 ClosableIterable<File> listStoreFiles(boolean includeLogicalLogs)
           
 void setLastCommittedTxId(long txId)
           
 
Methods inherited from class org.neo4j.kernel.impl.transaction.xaframework.LogBackedXaDataSource
deleteLogicalLog, getFileName, getLogExtractor, getLogicalLog, getLogicalLogLength, getMasterForCommittedTx, getPreparedTransaction, getPreparedTransaction, hasLogicalLog, isLogicalLogKept, keepLogicalLogs, rotateLogicalLog, setAutoRotate, setKeepLogicalLogsIfSpecified, setLogicalLogAtCreationTime, setLogicalLogTargetSize
 
Methods inherited from class org.neo4j.kernel.impl.transaction.xaframework.XaDataSource
applyCommittedTransaction, applyPreparedTransaction, getBranchId, getName, setBranchId, setName, setRecovered, shouldKeepLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LUCENE_VERSION

public static final org.apache.lucene.util.Version LUCENE_VERSION

DEFAULT_NAME

public static final String DEFAULT_NAME
See Also:
Constant Field Values

DEFAULT_BRANCH_ID

public static final byte[] DEFAULT_BRANCH_ID

LOWER_CASE_WHITESPACE_ANALYZER

public static final org.apache.lucene.analysis.Analyzer LOWER_CASE_WHITESPACE_ANALYZER
Default Analyzer for fulltext parsing.


WHITESPACE_ANALYZER

public static final org.apache.lucene.analysis.Analyzer WHITESPACE_ANALYZER

KEYWORD_ANALYZER

public static final org.apache.lucene.analysis.Analyzer KEYWORD_ANALYZER
Constructor Detail

LuceneDataSource

public LuceneDataSource(Map<Object,Object> params)
                 throws InstantiationException
Constructs this data source.

Parameters:
params - XA parameters.
Throws:
InstantiationException - if the data source couldn't be instantiated
Method Detail

close

public void close()
Description copied from class: XaDataSource
Closes this data source. Calling getXaConnection after this method has been invoked is illegal.

Specified by:
close in class XaDataSource

getXaConnection

public XaConnection getXaConnection()
Description copied from class: XaDataSource
Creates a XA connection to the resource this data source represents.

Specified by:
getXaConnection in class XaDataSource
Returns:
A connection to an XA resource

getCreationTime

public long getCreationTime()
Description copied from class: XaDataSource
Returns a timestamp when this data source was created. Note this is not the timestamp for the creation of the data source object instance, if the data source is for example a database timestamp is meant to be when the database was created.

Creation time together with random identifier can be used to uniqley identify a data source (since it is possible to have multiple sources of same type).

Overrides:
getCreationTime in class XaDataSource
Returns:
timestamp when this datasource was created

getRandomIdentifier

public long getRandomIdentifier()
Description copied from class: XaDataSource
Returns a random identifier that gets generated when the data source is created. Note with "created" we mean first time data source is created and not object creation.

Creation time together with the random identifier can be used to uniquely identify a data source (since it is possible to have multiple sources of the same type).

Overrides:
getRandomIdentifier in class XaDataSource
Returns:
random identifier for this data source

getCurrentLogVersion

public long getCurrentLogVersion()
Description copied from class: XaDataSource
Returns the current version of this data source. A invoke to the XaDataSource.rotateLogicalLog() when XaDataSource.keepLogicalLogs(boolean) is set to true will result in a log with that version created.

Overrides:
getCurrentLogVersion in class XaDataSource
Returns:
the current version of the logical log

getLastCommittedTxId

public long getLastCommittedTxId()
Overrides:
getLastCommittedTxId in class XaDataSource

setLastCommittedTxId

public void setLastCommittedTxId(long txId)
Overrides:
setLastCommittedTxId in class XaDataSource

getXaContainer

public XaContainer getXaContainer()
Overrides:
getXaContainer in class XaDataSource

listStoreFiles

public ClosableIterable<File> listStoreFiles(boolean includeLogicalLogs)
                                      throws IOException
Overrides:
listStoreFiles in class XaDataSource
Throws:
IOException


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.