org.apache.solr.update

## Class CommitTracker

- java.lang.Object
- - org.apache.solr.update.CommitTracker

- All Implemented Interfaces:
    Runnable

      public final class CommitTracker
      extends Object
      implements Runnable

  Helper class for tracking autoCommit state. Note: This is purely an implementation detail of autoCommit and will definitely change in the future, so the interface should not be relied-upon Note: all access must be synchronized. Public for tests.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `DOC_COMMIT_DELAY_MS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommitTracker(String name, SolrCore core, int docsUpperBound, int timeUpperBound, boolean openSearcher, boolean softCommit)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addedDocument(int commitWithin)` Indicate that documents have been added
    `void` | `cancelPendingCommit()`
    `void` | `close()`
    `void` | `deletedDocument(int commitWithin)` Indicate that documents have been deleted
    `void` | `didCommit()` Inform tracker that a commit has occurred
    `void` | `didRollback()` Inform tracker that a rollback has occurred, cancel any pending commits
    `int` | `getCommitCount()`
    `boolean` | `getOpenSearcher()`
    `long` | `getTimeUpperBound()`
    `void` | `run()` This is the worker part for the ScheduledFuture
    `void` | `scheduleCommitWithin(long commitMaxTime)` schedule individual commits
    `void` | `setOpenSearcher(boolean openSearcher)`
    `void` | `setTimeUpperBound(long timeUpperBound)`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### DOC_COMMIT_DELAY_MS

          public final int DOC_COMMIT_DELAY_MS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CommitTracker

          public CommitTracker(String name,
                               SolrCore core,
                               int docsUpperBound,
                               int timeUpperBound,
                               boolean openSearcher,
                               boolean softCommit)

  - ### Method Detail

    - #### getOpenSearcher

          public boolean getOpenSearcher()

    - #### close

          public void close()

    - #### scheduleCommitWithin

          public void scheduleCommitWithin(long commitMaxTime)

      schedule individual commits

    - #### cancelPendingCommit

          public void cancelPendingCommit()

    - #### addedDocument

          public void addedDocument(int commitWithin)

      Indicate that documents have been added

    - #### deletedDocument

          public void deletedDocument(int commitWithin)

      Indicate that documents have been deleted

    - #### didCommit

          public void didCommit()

      Inform tracker that a commit has occurred

    - #### didRollback

          public void didRollback()

      Inform tracker that a rollback has occurred, cancel any pending commits

    - #### run

          public void run()

      This is the worker part for the ScheduledFuture
      Specified by:
        `run` in interface `Runnable`

    - #### getCommitCount

          public int getCommitCount()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getTimeUpperBound

          public long getTimeUpperBound()

    - #### setTimeUpperBound

          public void setTimeUpperBound(long timeUpperBound)

    - #### setOpenSearcher

          public void setOpenSearcher(boolean openSearcher)

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.