Package org.apache.solr.update
Class VersionInfo
- java.lang.Object
-
- org.apache.solr.update.VersionInfo
-
public class VersionInfo extends Object
-
-
Constructor Summary
Constructors Constructor Description VersionInfo(UpdateLog ulog, int nBuckets)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
blockUpdates()
VersionBucket
bucket(int hash)
static SchemaField
getAndCheckVersionField(IndexSchema schema)
Gets and returns theCommonParams.VERSION_FIELD
from the specified schema, after verifying that it is indexed, stored, and single-valued.Long
getMaxVersionFromIndex(org.apache.lucene.search.IndexSearcher searcher)
Returns the highest version from the index, or 0L if no versions can be found in the index.long
getNewClock()
long
getOldClock()
int
getVersionBucketLockTimeoutMs()
SchemaField
getVersionField()
Long
getVersionFromIndex(org.apache.lucene.util.BytesRef idBytes)
Returns the latest version from the index, searched by the given id (bytes) as seen from the realtime searcher.void
lockForUpdate()
Long
lookupVersion(org.apache.lucene.util.BytesRef idBytes)
void
reload()
void
seedBucketsWithHighestVersion(long highestVersion)
void
unblockUpdates()
void
unlockForUpdate()
void
updateClock(long clock)
-
-
-
Constructor Detail
-
VersionInfo
public VersionInfo(UpdateLog ulog, int nBuckets)
-
-
Method Detail
-
getAndCheckVersionField
public static SchemaField getAndCheckVersionField(IndexSchema schema) throws SolrException
Gets and returns theCommonParams.VERSION_FIELD
from the specified schema, after verifying that it is indexed, stored, and single-valued. If any of these pre-conditions are not met, it throws a SolrException with a user suitable message indicating the problem.- Throws:
SolrException
-
getVersionBucketLockTimeoutMs
public int getVersionBucketLockTimeoutMs()
-
reload
public void reload()
-
getVersionField
public SchemaField getVersionField()
-
lockForUpdate
public void lockForUpdate()
-
unlockForUpdate
public void unlockForUpdate()
-
blockUpdates
public void blockUpdates()
-
unblockUpdates
public void unblockUpdates()
-
getNewClock
public long getNewClock()
-
getOldClock
public long getOldClock()
-
updateClock
public void updateClock(long clock)
-
bucket
public VersionBucket bucket(int hash)
-
lookupVersion
public Long lookupVersion(org.apache.lucene.util.BytesRef idBytes)
-
getVersionFromIndex
public Long getVersionFromIndex(org.apache.lucene.util.BytesRef idBytes)
Returns the latest version from the index, searched by the given id (bytes) as seen from the realtime searcher. Returns null if no document can be found in the index for the given id.
-
getMaxVersionFromIndex
public Long getMaxVersionFromIndex(org.apache.lucene.search.IndexSearcher searcher) throws IOException
Returns the highest version from the index, or 0L if no versions can be found in the index.- Throws:
IOException
-
seedBucketsWithHighestVersion
public void seedBucketsWithHighestVersion(long highestVersion)
-
-