|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.IndexCommit
public abstract class IndexCommit
Expert: represents a single commit into an index as seen by the
IndexDeletionPolicy
or IndexReader
.
Changes to the content of an index are made visible
only after the writer who made that change commits by
writing a new segments file
(segments_N
). This point in time, when the
action of writing of a new segments file to the directory
is completed, is an index commit.
Each index commit point has a unique segments file associated with it. The segments file associated with a later index commit point would have a larger N.
Constructor Summary | |
---|---|
IndexCommit()
|
Method Summary | |
---|---|
int |
compareTo(IndexCommit commit)
|
abstract void |
delete()
Delete this commit point. |
boolean |
equals(Object other)
Two IndexCommits are equal if both their Directory and versions are equal. |
abstract Directory |
getDirectory()
Returns the Directory for the index. |
abstract Collection<String> |
getFileNames()
Returns all index files referenced by this commit point. |
abstract long |
getGeneration()
Returns the generation (the _N in segments_N) for this IndexCommit |
abstract int |
getSegmentCount()
Returns number of segments referenced by this commit. |
abstract String |
getSegmentsFileName()
Get the segments file ( segments_N ) associated
with this commit point. |
long |
getTimestamp()
Deprecated. If you need to track commit time of an index, you can store it in the commit data (see IndexWriter.commit(Map) |
abstract Map<String,String> |
getUserData()
Returns userData, previously passed to IndexWriter.commit(Map) for this commit. |
abstract long |
getVersion()
Deprecated. use getGeneration() instead |
int |
hashCode()
|
abstract boolean |
isDeleted()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexCommit()
Method Detail |
---|
public abstract String getSegmentsFileName()
segments_N
) associated
with this commit point.
public abstract Collection<String> getFileNames() throws IOException
IOException
public abstract Directory getDirectory()
Directory
for the index.
public abstract void delete()
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.
public abstract boolean isDeleted()
public abstract int getSegmentCount()
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
@Deprecated public abstract long getVersion()
getGeneration()
instead
IndexReader.getVersion()
would
return if it were opened on this commit.
public abstract long getGeneration()
@Deprecated public long getTimestamp() throws IOException
IndexWriter.commit(Map)
IOException
public abstract Map<String,String> getUserData() throws IOException
IndexWriter.commit(Map)
for this commit. Map is
String -> String.
IOException
public int compareTo(IndexCommit commit)
compareTo
in interface Comparable<IndexCommit>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |