org.hibernate.search.engine.impl

## Class WorkPlan

- java.lang.Object
- - 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, Martin Braun

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WorkPlan(ExtendedSearchIntegrator extendedIntegrator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addWork(Work 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, ContainedInRecursionContext context, String tenantId)` 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(ExtendedSearchIntegrator extendedIntegrator)

  - ### Method Detail

    - #### addWork

          public void addWork(Work work)

      Adds a work to be performed as part of the final plan.
      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,
                                             ContainedInRecursionContext context,
                                             String tenantId)

      Used for recursive processing of containedIn
      Type Parameters:
        `T` - the type of the entity
      Parameters:
        `value` - the entity to be processed
        `context` - the validator for the depth constraints
        `tenantId` - the tenant identifier. It can be null.

    - #### getPlannedLuceneWork

          public List<LuceneWork> getPlannedLuceneWork()

      Returns:
        returns the current plan converted as a list of `LuceneWork`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved