voldemort.client.scheduler
Class AsyncMetadataVersionManager

java.lang.Object
  extended by voldemort.client.scheduler.AsyncMetadataVersionManager
All Implemented Interfaces:
java.lang.Runnable

public class AsyncMetadataVersionManager
extends java.lang.Object
implements java.lang.Runnable

The AsyncMetadataVersionManager is used to track the Metadata version on the cluster and if necessary Re-bootstrap the client. During initialization, it will retrieve the current version of the cluster.xml and then periodically check whether this has been updated. During init if the initial version turns out to be null, it means that no change has been done to that store since it was created. In this case, we assume version '0'. At the moment, this only tracks the cluster.xml changes. TODO: Extend this to track other stuff (like stores.xml)

Author:
csoman

Field Summary
static java.lang.String CLUSTER_VERSION_KEY
           
 boolean isActive
           
static java.lang.String STORES_VERSION_KEY
           
static java.lang.String VERSIONS_METADATA_STORE
           
 
Constructor Summary
AsyncMetadataVersionManager(SystemStoreRepository sysRepository, java.util.concurrent.Callable<java.lang.Void> storeClientThunk, java.lang.String storeName)
           
 
Method Summary
 java.lang.Long fetchNewVersion(java.lang.String versionKey, java.lang.Long curVersion, java.util.Properties versionProps)
           
 java.lang.Long getClusterMetadataVersion()
           
 java.lang.Long getCurrentVersion(java.lang.String versionKey, java.util.Properties versionProps)
           
 java.lang.Long getStoreMetadataVersion()
           
 void run()
           
 void updateMetadataVersions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLUSTER_VERSION_KEY

public static final java.lang.String CLUSTER_VERSION_KEY
See Also:
Constant Field Values

STORES_VERSION_KEY

public static java.lang.String STORES_VERSION_KEY

VERSIONS_METADATA_STORE

public static final java.lang.String VERSIONS_METADATA_STORE
See Also:
Constant Field Values

isActive

public boolean isActive
Constructor Detail

AsyncMetadataVersionManager

public AsyncMetadataVersionManager(SystemStoreRepository sysRepository,
                                   java.util.concurrent.Callable<java.lang.Void> storeClientThunk,
                                   java.lang.String storeName)
Method Detail

getCurrentVersion

public java.lang.Long getCurrentVersion(java.lang.String versionKey,
                                        java.util.Properties versionProps)

fetchNewVersion

public java.lang.Long fetchNewVersion(java.lang.String versionKey,
                                      java.lang.Long curVersion,
                                      java.util.Properties versionProps)

run

public void run()
Specified by:
run in interface java.lang.Runnable

getClusterMetadataVersion

public java.lang.Long getClusterMetadataVersion()

getStoreMetadataVersion

public java.lang.Long getStoreMetadataVersion()

updateMetadataVersions

public void updateMetadataVersions()


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu