IndexDeletionPolicyWrapper (Solr 3.6.2 API)
Keywords: org.apache.solr.core.IndexDeletionPolicyWrapper class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.core
Class IndexDeletionPolicyWrapper

    java.lang.Object
      org.apache.solr.core.IndexDeletionPolicyWrapper

All Implemented Interfaces:
  IndexDeletionPolicy

    public class IndexDeletionPolicyWrapper

extends Object
implements IndexDeletionPolicy

A wrapper for an IndexDeletionPolicy instance.

Provides features for looking up IndexCommit given a version. Allows reserving index commit points for certain amounts of time to support features such as index replication or snapshooting directly out of a live index directory.

Version:
  $Id: IndexDeletionPolicyWrapper.java 1201265 2011-11-12 14:09:28Z mikemccand $
See Also:
  `IndexDeletionPolicy`

Constructor Summary
`IndexDeletionPolicyWrapper(IndexDeletionPolicy deletionPolicy)`

Method Summary
`IndexCommit` | `getCommitPoint(Long version)`
`Map<Long,IndexCommit>` | `getCommits()` Gets the commit points for the index.
`IndexCommit` | `getLatestCommit()` Gets the most recent commit point It is recommended to reserve a commit point for the duration of usage so that it is not deleted by the underlying deletion policy
`IndexDeletionPolicy` | `getWrappedDeletionPolicy()`
`void` | `onCommit(List list)` Internal use for Lucene...
`void` | `onInit(List list)` Internal use for Lucene...
`void` | `releaseCommitPoint(Long indexCommitVersion)` Release a previously saved commit point
`void` | `saveCommitPoint(Long indexCommitVersion)` Permanently prevent this commit point from being deleted.
`void` | `setReserveDuration(Long indexVersion, long reserveTime)` Set the duration for which commit point is to be reserved by the deletion policy.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### IndexDeletionPolicyWrapper

    public IndexDeletionPolicyWrapper(IndexDeletionPolicy deletionPolicy)

Method Detail

### getLatestCommit

    public IndexCommit getLatestCommit()

  Gets the most recent commit point

  It is recommended to reserve a commit point for the duration of usage so that it is not deleted by the underlying deletion policy

  Returns:
    the most recent commit point

### getWrappedDeletionPolicy

    public IndexDeletionPolicy getWrappedDeletionPolicy()

### setReserveDuration

    public void setReserveDuration(Long indexVersion,
                                   long reserveTime)

  Set the duration for which commit point is to be reserved by the deletion policy.

  Parameters:
    `indexVersion` - version of the commit point to be reserved
    `reserveTime` - time in milliseconds for which the commit point is to be reserved

### saveCommitPoint

    public void saveCommitPoint(Long indexCommitVersion)

  Permanently prevent this commit point from being deleted. A counter is used to allow a commit point to be correctly saved and released multiple times.

### releaseCommitPoint

    public void releaseCommitPoint(Long indexCommitVersion)

  Release a previously saved commit point

### onInit

    public void onInit(List list)
                throws IOException

  Internal use for Lucene... do not explicitly call.

  Specified by:
    `onInit` in interface `IndexDeletionPolicy`
  Throws:
    `IOException`

### onCommit

    public void onCommit(List list)
                  throws IOException

  Internal use for Lucene... do not explicitly call.

  Specified by:
    `onCommit` in interface `IndexDeletionPolicy`
  Throws:
    `IOException`

### getCommitPoint

    public IndexCommit getCommitPoint(Long version)

  Parameters:
    `version` - the version of the commit point
  Returns:
    a commit point corresponding to the given version

### getCommits

    public Map<Long,IndexCommit> getCommits()

  Gets the commit points for the index. This map instance may change between commits and commit points may be deleted. It is recommended to reserve a commit point for the duration of usage

  Returns:
    a Map of version to commit points

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD