protected class SnapshotDeletionPolicy.SnapshotCommitPoint extends IndexCommit
IndexCommit and prevents it
from being deleted.| Modifier and Type | Field and Description |
|---|---|
protected IndexCommit |
cp
The
IndexCommit we are preventing from deletion. |
| Modifier | Constructor and Description |
|---|---|
protected |
SnapshotDeletionPolicy.SnapshotCommitPoint(IndexCommit cp)
Creates a
SnapshotCommitPoint wrapping the provided
IndexCommit. |
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Delete this commit point.
|
Directory |
getDirectory()
Returns the
Directory for the index. |
Collection<String> |
getFileNames()
Returns all index files referenced by this commit point.
|
long |
getGeneration()
Returns the generation (the _N in segments_N) for this
IndexCommit
|
int |
getSegmentCount()
Returns number of segments referenced by this commit.
|
String |
getSegmentsFileName()
Get the segments file (
segments_N) associated
with this commit point. |
Map<String,String> |
getUserData()
Returns userData, previously passed to
IndexWriter.setCommitData(Map) for this commit. |
boolean |
isDeleted()
Returns true if this commit should be deleted; this is
only used by
IndexWriter after invoking the
IndexDeletionPolicy. |
protected boolean |
shouldDelete(String segmentsFileName)
Returns true if this segment can be deleted.
|
String |
toString() |
compareTo, equals, hashCodeprotected IndexCommit cp
IndexCommit we are preventing from deletion.protected SnapshotDeletionPolicy.SnapshotCommitPoint(IndexCommit cp)
SnapshotCommitPoint wrapping the provided
IndexCommit.protected boolean shouldDelete(String segmentsFileName)
public void delete()
IndexCommitUpon 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 its onInit() or
onCommit() methods.
delete in class IndexCommitpublic Directory getDirectory()
IndexCommitDirectory for the index.getDirectory in class IndexCommitpublic Collection<String> getFileNames() throws IOException
IndexCommitgetFileNames in class IndexCommitIOExceptionpublic long getGeneration()
IndexCommitgetGeneration in class IndexCommitpublic String getSegmentsFileName()
IndexCommitsegments_N) associated
with this commit point.getSegmentsFileName in class IndexCommitpublic Map<String,String> getUserData() throws IOException
IndexCommitIndexWriter.setCommitData(Map) for this commit. Map is
String -> String.getUserData in class IndexCommitIOExceptionpublic boolean isDeleted()
IndexCommitIndexWriter after invoking the
IndexDeletionPolicy.isDeleted in class IndexCommitpublic int getSegmentCount()
IndexCommitgetSegmentCount in class IndexCommitCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.