use of com.ms.silverking.cloud.dht.daemon.NodeInfo in project SilverKing by Morgan-Stanley.
the class SystemNamespaceStore method getAllReplicasFreeSystemDiskBytesEstimate.
private byte[] getAllReplicasFreeSystemDiskBytesEstimate() {
List<Pair<IPAndPort, Long>> results;
Map<IPAndPort, NodeInfo> nodeInfo;
results = new ArrayList<>();
try {
nodeInfo = getAllNodeInfo();
for (IPAndPort node : ringMaster.getAllCurrentReplicaServers()) {
NodeInfo info;
info = nodeInfo.get(node);
if (info != null) {
long freeSystemBytesEstimate;
freeSystemBytesEstimate = (long) ((double) info.getFSFreeBytes() / ringMaster.getCurrentOwnedFraction(node, OwnerQueryMode.Primary));
results.add(new Pair<>(node, freeSystemBytesEstimate));
}
}
} catch (KeeperException ke) {
Log.logErrorWarning(ke);
}
return pairedResultsToBytes(results);
}
use of com.ms.silverking.cloud.dht.daemon.NodeInfo in project SilverKing by Morgan-Stanley.
the class SystemNamespaceStore method getAllReplicasFreeDiskBytes.
private byte[] getAllReplicasFreeDiskBytes() {
List<Pair<IPAndPort, Long>> results;
Map<IPAndPort, NodeInfo> nodeInfo;
results = new ArrayList<>();
try {
nodeInfo = getAllNodeInfo();
for (IPAndPort node : ringMaster.getAllCurrentReplicaServers()) {
NodeInfo info;
info = nodeInfo.get(node);
if (info != null) {
results.add(new Pair<>(node, info.getFSFreeBytes()));
}
}
} catch (KeeperException ke) {
Log.logErrorWarning(ke);
}
return pairedResultsToBytes(results);
}
use of com.ms.silverking.cloud.dht.daemon.NodeInfo in project SilverKing by Morgan-Stanley.
the class NodeInfoZK method getNodeInfo.
public Map<IPAndPort, NodeInfo> getNodeInfo(Set<IPAndPort> nodes) throws KeeperException {
Map<IPAndPort, NodeInfo> allNodeInfo;
allNodeInfo = new HashMap<>();
for (IPAndPort node : nodes) {
NodeInfo nodeInfo;
nodeInfo = getNodeInfo(node);
allNodeInfo.put(node, nodeInfo);
}
return allNodeInfo;
}
Aggregations