Module org.elasticsearch.server
Package org.elasticsearch.index.engine
Interface Engine.IndexCommitListener
- Enclosing class:
Engine
public static interface Engine.IndexCommitListener
-
Method Summary
Modifier and TypeMethodDescriptionvoidonIndexCommitDelete(ShardId shardId, org.apache.lucene.index.IndexCommit deletedCommit) This method is invoked after the policy deleted the givenIndexCommit.voidonNewCommit(ShardId shardId, Store store, long primaryTerm, Engine.IndexCommitRef indexCommitRef, Set<String> additionalFiles) This method is invoked each time a new Lucene commit is created through this engine.
-
Method Details
-
onNewCommit
void onNewCommit(ShardId shardId, Store store, long primaryTerm, Engine.IndexCommitRef indexCommitRef, Set<String> additionalFiles) This method is invoked each time a new Lucene commit is created through this engine. Note that commits are notified in order. TheEngine.IndexCommitRefprevents theEngine.IndexCommitReffiles to be deleted from disk until the reference is closed. As such, the listener must close the reference as soon as it is done with it.- Parameters:
shardId- theShardIdof shardstore- the index shard storeprimaryTerm- the shard's primary term valueindexCommitRef- a reference on the newly created index commitadditionalFiles- the set of filenames that are added by the new commit
-
onIndexCommitDelete
This method is invoked after the policy deleted the givenIndexCommit. A listener is never notified of a deleted commit until the correspondingEngine.IndexCommitRefreceived throughonNewCommit(org.elasticsearch.index.shard.ShardId, org.elasticsearch.index.store.Store, long, org.elasticsearch.index.engine.Engine.IndexCommitRef, java.util.Set<java.lang.String>)has been closed; closing which in turn can call this method directly.- Parameters:
shardId- theShardIdof sharddeletedCommit- the deletedIndexCommit
-