Module org.apache.lucene.core
Package org.apache.lucene.index
Class SnapshotDeletionPolicy.SnapshotCommitPoint
java.lang.Object
org.apache.lucene.index.IndexCommit
org.apache.lucene.index.SnapshotDeletionPolicy.SnapshotCommitPoint
- All Implemented Interfaces:
Comparable<IndexCommit>
- Enclosing class:
- SnapshotDeletionPolicy
Wraps a provided
IndexCommit
and prevents it from being deleted.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IndexCommit
TheIndexCommit
we are preventing from deletion. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates aSnapshotCommitPoint
wrapping the providedIndexCommit
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Delete this commit point.Returns theDirectory
for the index.Returns all index files referenced by this commit point.long
Returns the generation (the _N in segments_N) for this IndexCommitint
Returns number of segments referenced by this commit.Get the segments file (segments_N
) associated with this commit point.Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)
for this commit.boolean
Returns true if this commit should be deleted; this is only used byIndexWriter
after invoking theIndexDeletionPolicy
.toString()
Methods inherited from class org.apache.lucene.index.IndexCommit
compareTo, equals, getReader, hashCode
-
Field Details
-
cp
TheIndexCommit
we are preventing from deletion.
-
-
Constructor Details
-
SnapshotCommitPoint
Creates aSnapshotCommitPoint
wrapping the providedIndexCommit
.
-
-
Method Details
-
toString
-
delete
public void delete()Description copied from class:IndexCommit
Delete this commit point. This only applies when using the commit point in the context of IndexWriter's IndexDeletionPolicy.Upon calling this, the writer is notified that this commit point should be deleted.
Decision that a commit-point should be deleted is taken by the
IndexDeletionPolicy
in effect and therefore this should only be called by itsonInit()
oronCommit()
methods.- Specified by:
delete
in classIndexCommit
-
getDirectory
Description copied from class:IndexCommit
Returns theDirectory
for the index.- Specified by:
getDirectory
in classIndexCommit
-
getFileNames
Description copied from class:IndexCommit
Returns all index files referenced by this commit point.- Specified by:
getFileNames
in classIndexCommit
- Throws:
IOException
-
getGeneration
public long getGeneration()Description copied from class:IndexCommit
Returns the generation (the _N in segments_N) for this IndexCommit- Specified by:
getGeneration
in classIndexCommit
-
getSegmentsFileName
Description copied from class:IndexCommit
Get the segments file (segments_N
) associated with this commit point.- Specified by:
getSegmentsFileName
in classIndexCommit
-
getUserData
Description copied from class:IndexCommit
Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)
for this commit. Map isString -> String
.- Specified by:
getUserData
in classIndexCommit
- Throws:
IOException
-
isDeleted
public boolean isDeleted()Description copied from class:IndexCommit
Returns true if this commit should be deleted; this is only used byIndexWriter
after invoking theIndexDeletionPolicy
.- Specified by:
isDeleted
in classIndexCommit
-
getSegmentCount
public int getSegmentCount()Description copied from class:IndexCommit
Returns number of segments referenced by this commit.- Specified by:
getSegmentCount
in classIndexCommit
-