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:
java.lang.Comparable<IndexCommit>
- Enclosing class:
- SnapshotDeletionPolicy
private class SnapshotDeletionPolicy.SnapshotCommitPoint extends IndexCommit
Wraps a providedIndexCommit
and prevents it from being deleted.
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexCommit
cp
TheIndexCommit
we are preventing from deletion.
-
Constructor Summary
Constructors Modifier Constructor Description protected
SnapshotCommitPoint(IndexCommit cp)
Creates aSnapshotCommitPoint
wrapping the providedIndexCommit
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Delete this commit point.Directory
getDirectory()
Returns theDirectory
for the index.java.util.Collection<java.lang.String>
getFileNames()
Returns all index files referenced by this commit point.long
getGeneration()
Returns the generation (the _N in segments_N) for this IndexCommitint
getSegmentCount()
Returns number of segments referenced by this commit.java.lang.String
getSegmentsFileName()
Get the segments file (segments_N
) associated with this commit point.java.util.Map<java.lang.String,java.lang.String>
getUserData()
Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)
for this commit.boolean
isDeleted()
Returns true if this commit should be deleted; this is only used byIndexWriter
after invoking theIndexDeletionPolicy
.java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.index.IndexCommit
compareTo, equals, getReader, hashCode
-
-
-
-
Field Detail
-
cp
protected IndexCommit cp
TheIndexCommit
we are preventing from deletion.
-
-
Constructor Detail
-
SnapshotCommitPoint
protected SnapshotCommitPoint(IndexCommit cp)
Creates aSnapshotCommitPoint
wrapping the providedIndexCommit
.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
public Directory getDirectory()
Description copied from class:IndexCommit
Returns theDirectory
for the index.- Specified by:
getDirectory
in classIndexCommit
-
getFileNames
public java.util.Collection<java.lang.String> getFileNames() throws java.io.IOException
Description copied from class:IndexCommit
Returns all index files referenced by this commit point.- Specified by:
getFileNames
in classIndexCommit
- Throws:
java.io.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
public java.lang.String getSegmentsFileName()
Description copied from class:IndexCommit
Get the segments file (segments_N
) associated with this commit point.- Specified by:
getSegmentsFileName
in classIndexCommit
-
getUserData
public java.util.Map<java.lang.String,java.lang.String> getUserData() throws java.io.IOException
Description copied from class:IndexCommit
Returns userData, previously passed toIndexWriter.setLiveCommitData(Iterable)
for this commit. Map isString -> String
.- Specified by:
getUserData
in classIndexCommit
- Throws:
java.io.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
-
-