use of com.ms.silverking.cloud.toporing.InstantiatedRingTree in project SilverKing by Morgan-Stanley.
the class SKAdmin method replicaSetExcludedByExclusions.
private boolean replicaSetExcludedByExclusions(ExclusionSet es) throws KeeperException, IOException {
InstantiatedRingTree curTree;
ResolvedReplicaMap replicaMap;
List<Set<IPAndPort>> excludedReplicaSets;
curTree = readCurrentTree();
replicaMap = curTree.getResolvedMap(ringConfig.getRingParentName(), new ReplicaNaiveIPPrioritizer());
excludedReplicaSets = replicaMap.getExcludedReplicaSets(es.asIPAndPortSet(0));
if (excludedReplicaSets.size() != 0) {
Log.warning("Exclusion set excludes at least one replica set:");
for (Set<IPAndPort> s : excludedReplicaSets) {
Log.warningf("%s", s);
}
return true;
}
return false;
}
use of com.ms.silverking.cloud.toporing.InstantiatedRingTree in project SilverKing by Morgan-Stanley.
the class DebugKey method readTree.
private InstantiatedRingTree readTree(Triple<String, Long, Long> ring) throws IOException, KeeperException {
MetaClient ringMC;
long ringConfigVersion;
long configInstanceVersion;
InstantiatedRingTree ringTree;
ringConfigVersion = ring.getTail().getV1();
configInstanceVersion = ring.getTail().getV2();
ringMC = metaUtil.getRingMC();
ringTree = SingleRingZK.readTree(ringMC, ringConfigVersion, configInstanceVersion);
return ringTree;
}
use of com.ms.silverking.cloud.toporing.InstantiatedRingTree in project SilverKing by Morgan-Stanley.
the class ComputeRingStats method readTree.
private InstantiatedRingTree readTree(Triple<String, Long, Long> ring) throws IOException, KeeperException {
MetaClient ringMC;
long ringConfigVersion;
long configInstanceVersion;
InstantiatedRingTree ringTree;
ringConfigVersion = ring.getTail().getV1();
configInstanceVersion = ring.getTail().getV2();
ringMC = metaUtil.getRingMC();
ringTree = SingleRingZK.readTree(ringMC, ringConfigVersion, configInstanceVersion);
return ringTree;
}
use of com.ms.silverking.cloud.toporing.InstantiatedRingTree in project SilverKing by Morgan-Stanley.
the class SKAdmin method execCreateSKFSns.
private boolean execCreateSKFSns() throws IOException, ClientException, KeeperException {
SKFSNamespaceCreator nsCreator;
String preferredServer;
Pair<RingConfiguration, InstantiatedRingTree> ringConfigAndTree;
HostGroupTable hostGroupTable;
String hostGroupTableName;
ringConfigAndTree = getRing(dhtConfig, dhtMC);
Log.warning("ringConfig: ", ringConfigAndTree.getV1());
hostGroupTableName = ringConfigAndTree.getV1().getCloudConfiguration().getHostGroupTableName();
Log.warning("hostGroupTableName: ", hostGroupTableName);
hostGroupTable = getHostGroupTable(hostGroupTableName, dhtMC.getZooKeeper().getZKConfig());
if (options.preferredServer == null) {
preferredServer = findArbitraryActiveServer(dhtConfig.getHostGroups(), hostGroupTable);
} else {
preferredServer = options.preferredServer;
}
Log.warning("Using preferredServer ", preferredServer);
nsCreator = new SKFSNamespaceCreator(gc.getClientDHTConfiguration(), preferredServer);
nsCreator.createNamespaces(skfsNamespaces, skfsNSOptions);
nsCreator.createNamespaces(skfsMutableNamespaces, skfsMutableNSOptions);
nsCreator.createNamespaces(skfsFileBlockNamespaces, skfsFileBlockNSOptions);
nsCreator.createNamespaces(skfsDirNamespaces, skfsDirNSOptions);
return true;
}
use of com.ms.silverking.cloud.toporing.InstantiatedRingTree in project SilverKing by Morgan-Stanley.
the class SKAdmin method readCurrentTree.
public InstantiatedRingTree readCurrentTree() throws KeeperException, IOException {
DHTRingCurTargetZK curTargetZK;
Triple<String, Long, Long> curRingAndVersionPair;
InstantiatedRingTree ringTree;
curTargetZK = new DHTRingCurTargetZK(dhtMC, dhtConfig);
curRingAndVersionPair = curTargetZK.getCurRingAndVersionPair();
ringTree = SingleRingZK.readTree(new com.ms.silverking.cloud.toporing.meta.MetaClient(new NamedRingConfiguration(dhtConfig.getRingName(), ringConfig), dhtMC.getZooKeeper().getZKConfig()), curRingAndVersionPair.getTail());
return ringTree;
}
Aggregations