org.sakaiproject.search.optimize.shared.impl
Class OptimizeSharedTransactionListenerImpl

java.lang.Object
  extended by org.sakaiproject.search.optimize.shared.impl.OptimizeSharedTransactionListenerImpl
All Implemented Interfaces:
OptimizeTransactionListener, TransactionListener

public class OptimizeSharedTransactionListenerImpl
extends Object
implements OptimizeTransactionListener

An OptimizationTransactionListener that optimizes the index. It first collects the segments that could be optimized. If there are more than the mergeSize then it will perform the merge into a temporary segment and if that is successfull that index will be merged in the commit phase into the permanent index

Author:
ieb

Constructor Summary
OptimizeSharedTransactionListenerImpl()
           
 
Method Summary
 void close(IndexTransaction transaction)
           
 void commit(IndexTransaction transaction)
          commit closes the temporary segment, and merges it into the permanent segment.
 void destroy()
           
 JournalSettings getJournalSettings()
           
 void init()
           
 void open(IndexTransaction transaction)
          Open the index, but throw a NoOptimizationReqiredException if there are not enough segments to perfom a merge on
 void prepare(IndexTransaction transaction)
          Perform the merge operation on the segments into the target shared segment
 void rollback(IndexTransaction transaction)
          Roll back the optimize operation
 void setJournalSettings(JournalSettings journalSettings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimizeSharedTransactionListenerImpl

public OptimizeSharedTransactionListenerImpl()
Method Detail

init

public void init()

destroy

public void destroy()

close

public void close(IndexTransaction transaction)
           throws IndexTransactionException
Specified by:
close in interface TransactionListener
Throws:
IndexTransactionException
See Also:
TransactionListener.close(org.sakaiproject.search.transaction.api.IndexTransaction)

commit

public void commit(IndexTransaction transaction)
            throws IndexTransactionException
commit closes the temporary segment, and merges it into the permanent segment. Both the temporary and permanent were opened in the prepare phase

Specified by:
commit in interface TransactionListener
Throws:
IndexTransactionException
See Also:
TransactionListener.commit(org.sakaiproject.search.transaction.api.IndexTransaction)

open

public void open(IndexTransaction transaction)
          throws IndexTransactionException
Open the index, but throw a NoOptimizationReqiredException if there are not enough segments to perfom a merge on

Specified by:
open in interface TransactionListener
Throws:
IndexTransactionException
See Also:
TransactionListener.open(org.sakaiproject.search.transaction.api.IndexTransaction)

prepare

public void prepare(IndexTransaction transaction)
             throws IndexTransactionException
Perform the merge operation on the segments into the target shared segment

Specified by:
prepare in interface TransactionListener
Throws:
IndexJournalException
IndexTransactionException
See Also:
TransactionListener.prepare(org.sakaiproject.search.transaction.api.IndexTransaction)

rollback

public void rollback(IndexTransaction transaction)
              throws IndexTransactionException
Roll back the optimize operation

Specified by:
rollback in interface TransactionListener
Throws:
IndexTransactionException
See Also:
TransactionListener.rollback(org.sakaiproject.search.transaction.api.IndexTransaction)

getJournalSettings

public JournalSettings getJournalSettings()
Returns:
the journalSettings

setJournalSettings

public void setJournalSettings(JournalSettings journalSettings)
Parameters:
journalSettings - the journalSettings to set


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