org.elasticsearch.common.lucene.versioned
Class ConcurrentVersionedMapLong

java.lang.Object
  extended by org.elasticsearch.common.lucene.versioned.ConcurrentVersionedMapLong
All Implemented Interfaces:
VersionedMap

@ThreadSafe
public class ConcurrentVersionedMapLong
extends java.lang.Object
implements VersionedMap

An implementation of VersionedMap based on ConcurrentMapLong.


Constructor Summary
ConcurrentVersionedMapLong()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentVersionedMapLong

public ConcurrentVersionedMapLong()
Method Detail

beforeVersion

public boolean beforeVersion(int key,
                             int versionToCheck)
Description copied from interface: VersionedMap
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.

Specified by:
beforeVersion in interface VersionedMap

putVersion

public void putVersion(int key,
                       int version)
Description copied from interface: VersionedMap
Puts (and replaces if it exists) the current key with the provided version.

Specified by:
putVersion in interface VersionedMap

putVersionIfAbsent

public void putVersionIfAbsent(int key,
                               int version)
Description copied from interface: VersionedMap
Puts the version with the key only if it is absent.

Specified by:
putVersionIfAbsent in interface VersionedMap

clear

public void clear()
Description copied from interface: VersionedMap
Clears the map.

Specified by:
clear in interface VersionedMap