|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.IndexCommit org.apache.lucene.index.SnapshotDeletionPolicy.SnapshotCommitPoint
protected class SnapshotDeletionPolicy.SnapshotCommitPoint
Wraps a provided IndexCommit
and prevents it
from being deleted.
Field Summary | |
---|---|
protected IndexCommit |
cp
The IndexCommit we are preventing from deletion. |
Constructor Summary | |
---|---|
protected |
SnapshotDeletionPolicy.SnapshotCommitPoint(IndexCommit cp)
Creates a SnapshotCommitPoint wrapping the provided
IndexCommit . |
Method Summary | |
---|---|
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()
|
Methods inherited from class org.apache.lucene.index.IndexCommit |
---|
compareTo, equals, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IndexCommit cp
IndexCommit
we are preventing from deletion.
Constructor Detail |
---|
protected SnapshotDeletionPolicy.SnapshotCommitPoint(IndexCommit cp)
SnapshotCommitPoint
wrapping the provided
IndexCommit
.
Method Detail |
---|
public String toString()
toString
in class Object
protected boolean shouldDelete(String segmentsFileName)
public void delete()
IndexCommit
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 its onInit()
or
onCommit()
methods.
delete
in class IndexCommit
public Directory getDirectory()
IndexCommit
Directory
for the index.
getDirectory
in class IndexCommit
public Collection<String> getFileNames() throws IOException
IndexCommit
getFileNames
in class IndexCommit
IOException
public long getGeneration()
IndexCommit
getGeneration
in class IndexCommit
public String getSegmentsFileName()
IndexCommit
segments_N
) associated
with this commit point.
getSegmentsFileName
in class IndexCommit
public Map<String,String> getUserData() throws IOException
IndexCommit
IndexWriter.setCommitData(Map)
for this commit. Map is
String -> String.
getUserData
in class IndexCommit
IOException
public boolean isDeleted()
IndexCommit
IndexWriter
after invoking the
IndexDeletionPolicy
.
isDeleted
in class IndexCommit
public int getSegmentCount()
IndexCommit
getSegmentCount
in class IndexCommit
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |