org.elasticsearch.common.lucene.versioned
Interface VersionedMap

All Known Implementing Classes:
ConcurrentVersionedMap, ConcurrentVersionedMapLong, NativeVersionedMap

@ThreadSafe
public interface VersionedMap

A versioned map, allowing to put version numbers associated with specific keys.

Note. versions can be assumed to be >= 0.


Method Summary
 boolean beforeVersion(int key, int versionToCheck)
          Returns true if the versionToCheck is smaller than the current version associated with the key.
 void clear()
          Clears the map.
 void putVersion(int key, int version)
          Puts (and replaces if it exists) the current key with the provided version.
 void putVersionIfAbsent(int key, int version)
          Puts the version with the key only if it is absent.
 

Method Detail

beforeVersion

boolean beforeVersion(int key,
                      int versionToCheck)
Returns true if the versionToCheck is smaller than the current version associated with the key. If there is no version associated with the key, then it should return true as well.


putVersion

void putVersion(int key,
                int version)
Puts (and replaces if it exists) the current key with the provided version.


putVersionIfAbsent

void putVersionIfAbsent(int key,
                        int version)
Puts the version with the key only if it is absent.


clear

void clear()
Clears the map.