Class WorkPlan

java.lang.Object
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
  • Constructor Details

  • Method Details

    • 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
      invalid reference
      #getPlannedLuceneWork(SearchFactoryImplementor)
      would return. This is meant for resource control for auto flushing of large pending batches.
      Returns:
      the approximation
      See Also:
    • 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: