org.sakaiproject.search.optimize.impl
Class IndexOptimizeTransactionImpl

java.lang.Object
  extended by org.sakaiproject.search.transaction.impl.IndexTransactionImpl
      extended by org.sakaiproject.search.optimize.impl.IndexOptimizeTransactionImpl
All Implemented Interfaces:
IndexOptimizeTransaction, IndexTransaction

public class IndexOptimizeTransactionImpl
extends IndexTransactionImpl
implements IndexOptimizeTransaction

A transaction holder for Index Optimizations

Author:
ieb

Field Summary
 
Fields inherited from class org.sakaiproject.search.transaction.impl.IndexTransactionImpl
manager, transactionId, transactionState
 
Fields inherited from interface org.sakaiproject.search.transaction.api.IndexTransaction
STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWN, TRANSACTION_ACTIVE, TRANSACTION_STATUS
 
Constructor Summary
IndexOptimizeTransactionImpl(TransactionManagerImpl manager, JournalSettings journalSettings, Map<String,Object> m)
           
 
Method Summary
protected  void doAfterCommit()
           
protected  void doAfterRollback()
           
 org.apache.lucene.index.IndexWriter getIndexWriter()
          get an index writer based on the transaction ID.
 File[] getOptimizableSegments()
          Get the list of segments being optimised
 org.apache.lucene.index.IndexWriter getPermanentIndexWriter()
          get the permanent index writer associated with this transaction, if it has been set
 org.apache.lucene.index.IndexWriter getTemporaryIndexWriter()
          Get the index writer associated with this transaction
 void setOptimizableSegments(File[] optimzableSegments)
          Set the list of segments being optimised
 void setPermanentIndexWriter(org.apache.lucene.index.IndexWriter pw)
          Set the index writer of the permanent index associated with this transaction
 
Methods inherited from class org.sakaiproject.search.transaction.impl.IndexTransactionImpl
clear, close, commit, doAfterClose, doAfterOpen, doAfterPrepare, doBeforeClose, doBeforeCommit, doBeforeOpen, doBeforePrepare, doBeforeRollback, get, getStatus, getTransactionId, open, prepare, put, rollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.search.transaction.api.IndexTransaction
clear, close, commit, get, getStatus, getTransactionId, open, prepare, put, rollback
 

Constructor Detail

IndexOptimizeTransactionImpl

public IndexOptimizeTransactionImpl(TransactionManagerImpl manager,
                                    JournalSettings journalSettings,
                                    Map<String,Object> m)
                             throws IndexTransactionException
Parameters:
m -
impl -
Throws:
IndexTransactionException
Method Detail

doAfterRollback

protected void doAfterRollback()
                        throws IndexTransactionException
Overrides:
doAfterRollback in class IndexTransactionImpl
Throws:
IndexTransactionException
See Also:
IndexTransactionImpl.doAfterRollback()

doAfterCommit

protected void doAfterCommit()
                      throws IndexTransactionException
Overrides:
doAfterCommit in class IndexTransactionImpl
Throws:
IndexTransactionException
See Also:
IndexTransactionImpl.doAfterCommit()

getIndexWriter

public org.apache.lucene.index.IndexWriter getIndexWriter()
                                                   throws IndexTransactionException
get an index writer based on the transaction ID. This is temporary segment into which other transient segments will be merged.

Throws:
IndexTransactionException
See Also:
org.sakaiproject.search.component.service.index.transactional.api.IndexUpdateTransaction#getIndexWriter()

getOptimizableSegments

public File[] getOptimizableSegments()
Description copied from interface: IndexOptimizeTransaction
Get the list of segments being optimised

Specified by:
getOptimizableSegments in interface IndexOptimizeTransaction
Returns:
See Also:
IndexOptimizeTransaction.getOptimizableSegments()

getPermanentIndexWriter

public org.apache.lucene.index.IndexWriter getPermanentIndexWriter()
Description copied from interface: IndexOptimizeTransaction
get the permanent index writer associated with this transaction, if it has been set

Specified by:
getPermanentIndexWriter in interface IndexOptimizeTransaction
Returns:
See Also:
IndexOptimizeTransaction.getPermanentIndexWriter()

getTemporaryIndexWriter

public org.apache.lucene.index.IndexWriter getTemporaryIndexWriter()
                                                            throws IndexTransactionException
Description copied from interface: IndexOptimizeTransaction
Get the index writer associated with this transaction

Specified by:
getTemporaryIndexWriter in interface IndexOptimizeTransaction
Returns:
Throws:
IndexTransactionException
See Also:
IndexOptimizeTransaction.getTemporaryIndexWriter()

setOptimizableSegments

public void setOptimizableSegments(File[] optimzableSegments)
Description copied from interface: IndexOptimizeTransaction
Set the list of segments being optimised

Specified by:
setOptimizableSegments in interface IndexOptimizeTransaction
See Also:
IndexOptimizeTransaction.setOptimizableSegments(java.io.File[])

setPermanentIndexWriter

public void setPermanentIndexWriter(org.apache.lucene.index.IndexWriter pw)
Description copied from interface: IndexOptimizeTransaction
Set the index writer of the permanent index associated with this transaction

Specified by:
setPermanentIndexWriter in interface IndexOptimizeTransaction
See Also:
IndexOptimizeTransaction.setPermanentIndexWriter(org.apache.lucene.index.IndexWriter)


Copyright © 2003-2012 Sakai Project. All Rights Reserved.