Class VersionsAndSeqNoResolver
- java.lang.Object
-
- org.elasticsearch.common.lucene.uid.VersionsAndSeqNoResolver
-
public final class VersionsAndSeqNoResolver extends java.lang.Object
Utility class to resolve the Lucene doc ID, version, seqNo and primaryTerms for a given uid.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VersionsAndSeqNoResolver.DocIdAndSeqNo
Wraps anLeafReaderContext
, a doc ID relative to the context doc base and a seqNo.static class
VersionsAndSeqNoResolver.DocIdAndVersion
Wraps anLeafReaderContext
, a doc ID relative to the context doc base and a version.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static VersionsAndSeqNoResolver.DocIdAndSeqNo
loadDocIdAndSeqNo(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Term term)
Load the internal doc ID and sequence number for the uid from the reader, returning null if the uid wasn't found, a doc ID and the associated seqNo otherwisestatic VersionsAndSeqNoResolver.DocIdAndVersion
loadDocIdAndVersion(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Term term)
Load the internal doc ID and version for the uid from the reader, returning null if the uid wasn't found, a doc ID and a version otherwisestatic long
loadPrimaryTerm(VersionsAndSeqNoResolver.DocIdAndSeqNo docIdAndSeqNo, java.lang.String uidField)
Load the primaryTerm associated with the givenVersionsAndSeqNoResolver.DocIdAndSeqNo
static long
loadVersion(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Term term)
Load the version for the uid from the reader, returningVersions.NOT_FOUND
if no matching doc exists, the version associated with the provided uid otherwise
-
-
-
Method Detail
-
loadDocIdAndVersion
public static VersionsAndSeqNoResolver.DocIdAndVersion loadDocIdAndVersion(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Term term) throws java.io.IOException
Load the internal doc ID and version for the uid from the reader, returning- null if the uid wasn't found,
- a doc ID and a version otherwise
- Throws:
java.io.IOException
-
loadDocIdAndSeqNo
public static VersionsAndSeqNoResolver.DocIdAndSeqNo loadDocIdAndSeqNo(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Term term) throws java.io.IOException
Load the internal doc ID and sequence number for the uid from the reader, returning- null if the uid wasn't found,
- a doc ID and the associated seqNo otherwise
- Throws:
java.io.IOException
-
loadPrimaryTerm
public static long loadPrimaryTerm(VersionsAndSeqNoResolver.DocIdAndSeqNo docIdAndSeqNo, java.lang.String uidField) throws java.io.IOException
Load the primaryTerm associated with the givenVersionsAndSeqNoResolver.DocIdAndSeqNo
- Throws:
java.io.IOException
-
loadVersion
public static long loadVersion(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Term term) throws java.io.IOException
Load the version for the uid from the reader, returningVersions.NOT_FOUND
if no matching doc exists,- the version associated with the provided uid otherwise
- Throws:
java.io.IOException
-
-