*/
public static void doMetaSetPair(AdminClient adminClient,
List<Integer> nodeIds,
Object clusterValue,
Object storesValue) {
VectorClock updatedClusterVersion = null;
VectorClock updatedStoresVersion = null;
for(Integer nodeId: nodeIds) {
if(updatedClusterVersion == null && updatedStoresVersion == null) {
updatedClusterVersion = (VectorClock) adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
MetadataStore.CLUSTER_KEY)
.getVersion();
updatedStoresVersion = (VectorClock) adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
MetadataStore.STORES_KEY)
.getVersion();
} else {
updatedClusterVersion = updatedClusterVersion.merge((VectorClock) adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
MetadataStore.CLUSTER_KEY)
.getVersion());
updatedStoresVersion = updatedStoresVersion.merge((VectorClock) adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
MetadataStore.STORES_KEY)
.getVersion());
}
// TODO: This will work for now but we should take a step back
// and
// think about a uniform clock for the metadata values.
updatedClusterVersion = updatedClusterVersion.incremented(nodeIds.iterator().next(),
System.currentTimeMillis());
updatedStoresVersion = updatedStoresVersion.incremented(nodeIds.iterator().next(),
System.currentTimeMillis());
}
adminClient.metadataMgmtOps.updateRemoteMetadataPair(nodeIds,
MetadataStore.CLUSTER_KEY,
Versioned.value(clusterValue.toString(),