org.hibernate.search.engine.impl
Class WorkPlan

java.lang.Object
  extended by org.hibernate.search.engine.impl.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, Hardy Ferentschik

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()
           
 void processContainedInAndPrepareExecution()
          Makes sure that all additional work needed because of containedIn is added to the work plan.
<T> void
recurseContainedIn(T value, DepthValidator depth)
          Used for recursive processing of containedIn
 int size()
          Returns an approximation of the amount of work in the queue.
 
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 - The work instance to add to the work plan

clear

public void clear()
Removes all scheduled work


size

public int size()
Returns an approximation of the amount of work in the queue. This is meant for resource control for auto flushing of large pending batches.

Returns:
the approximation
See Also:
Environment.QUEUEINGPROCESSOR_BATCHSIZE

processContainedInAndPrepareExecution

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


recurseContainedIn

public <T> void recurseContainedIn(T value,
                                   DepthValidator depth)
Used for recursive processing of containedIn

Parameters:
value - the entity to be processed

getPlannedLuceneWork

public List<LuceneWork> getPlannedLuceneWork()
Returns:
returns the current plan converted as a list of LuceneWork


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