org.hibernate.search.engine
Class WorkPlan

java.lang.Object
  extended by org.hibernate.search.engine.WorkPlan

public class WorkPlan
extends Object

Represents the set of changes going to be applied to the index for the entities. A stream of Work is feed as input, a list of LuceneWork is output, and in the process we try to reduce the number of output operations to the minimum needed to reach the same final state.

Since:
3.3
Author:
Sanne Grinovero

Constructor Summary
WorkPlan(SearchFactoryImplementor searchFactoryImplementor)
           
 
Method Summary
<T> void
addWork(Work<T> work)
          Adds a work to be performed as part of the final plan.
 void clear()
          Removes all scheduled work
 List<LuceneWork> getPlannedLuceneWork()
          Converts the current plan into a list of LuceneWork, something that the backends can actually perform to execute the plan.
 void processContainedInAndPrepareExecution()
          Makes sure that all additional work needed because of containedIn is added to the work plan.
 int size()
          Returns an approximation of the amount of work that #getPlannedLuceneWork(SearchFactoryImplementor) would return.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkPlan

public WorkPlan(SearchFactoryImplementor searchFactoryImplementor)
Method Detail

addWork

public <T> void addWork(Work<T> work)
Adds a work to be performed as part of the final plan.

Type Parameters:
T - the type of the work, or of the affected entity
Parameters:
work -

clear

public void clear()
Removes all scheduled work


size

public int size()
Returns an approximation of the amount of work that #getPlannedLuceneWork(SearchFactoryImplementor) would return. This is meant for resource control for auto flushing of large pending batches.

Returns:
the approximation
See Also:
Environment.WORKER_BATCHSIZE

processContainedInAndPrepareExecution

public void processContainedInAndPrepareExecution()
Makes sure that all additional work needed because of containedIn is added to the work plan.


getPlannedLuceneWork

public List<LuceneWork> getPlannedLuceneWork()
Converts the current plan into a list of LuceneWork, something that the backends can actually perform to execute the plan.

Returns:


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved