org.hibernate.search.backend.impl.lucene

## Class ScheduledCommitPolicy

- java.lang.Object
- - org.hibernate.search.backend.impl.lucene.AbstractCommitPolicy
  - - org.hibernate.search.backend.impl.lucene.ScheduledCommitPolicy

- All Implemented Interfaces:
    CommitPolicy

      public final class ScheduledCommitPolicy
      extends AbstractCommitPolicy

  Commit policy that will commit at a regular intervals defined by configuration or immediately on explicit flush requests
  Author:
    gustavonalle

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_DELAY_MS`

    - ### Fields inherited from class org.hibernate.search.backend.impl.lucene.AbstractCommitPolicy

      `indexWriterHolder`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScheduledCommitPolicy(org.hibernate.search.backend.impl.lucene.IndexWriterHolder indexWriterHolder, String indexName, int delay, ErrorHandler errorHandler)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getDelay()`
    `ScheduledExecutorService` | `getScheduledExecutorService()` Exposed as public method for tests only
    `void` | `onChangeSetApplied(boolean someFailureHappened, boolean streaming)` A changeset was applied to the index
    `void` | `onClose()` Backend shutting down
    `void` | `onFlush()` An explicit flush was requested

    - ### Methods inherited from class org.hibernate.search.backend.impl.lucene.AbstractCommitPolicy

      `getIndexWriter, getIndexWriter`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_DELAY_MS

          public static final int DEFAULT_DELAY_MS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ScheduledCommitPolicy

          public ScheduledCommitPolicy(org.hibernate.search.backend.impl.lucene.IndexWriterHolder indexWriterHolder,
                                       String indexName,
                                       int delay,
                                       ErrorHandler errorHandler)

  - ### Method Detail

    - #### getDelay

          public int getDelay()

    - #### onChangeSetApplied

          public void onChangeSetApplied(boolean someFailureHappened,
                                         boolean streaming)

      Description copied from interface: `CommitPolicy`
      A changeset was applied to the index
      Parameters:
        `someFailureHappened` - true if any failure happened
        `streaming` - true if changesets are part of a stream of operations

    - #### getScheduledExecutorService

          public ScheduledExecutorService getScheduledExecutorService()

      Exposed as public method for tests only
      Returns:
        The executor used by this policy, newly created if necessary.

    - #### onFlush

          public void onFlush()

      Description copied from interface: `CommitPolicy`
      An explicit flush was requested

    - #### onClose

          public void onClose()

      Description copied from interface: `CommitPolicy`
      Backend shutting down
      Specified by:
        `onClose` in interface `CommitPolicy`
      Overrides:
        `onClose` in class `AbstractCommitPolicy`

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