use of com.ms.silverking.cloud.topology.Topology in project SilverKing by Morgan-Stanley.
the class TopologyRingCreator method main.
// //////////////////////////////////////////////////
/**
* @param args
*/
public static void main(String[] args) {
try {
if (args.length != 8) {
System.out.println("<topologyFile> <weightSpecsFile> <exclusionList> <nodeID> <storagePolicyGroup> <policyID> <HostGroupTableFile> <HostGroup,...>");
} else {
TopologyRingCreator topologyRingCreator;
Topology topology;
File topologyFile;
File weightSpecsFile;
File exclusionFile;
File storagePolicyGroupFile;
String nodeID;
String policyID;
// Replication replication;
StoragePolicyGroup storagePolicyGroup;
TopologyRing topologyRing;
Node node;
RingTreeRecipe recipe;
HostGroupTable hostGroupTable;
Set<String> hostGroups;
// Log.setLevelAll();
topologyFile = new File(args[0]);
weightSpecsFile = new File(args[1]);
exclusionFile = new File(args[2]);
nodeID = args[3];
storagePolicyGroupFile = new File(args[4]);
policyID = args[5];
storagePolicyGroup = new PolicyParser().parsePolicyGroup(storagePolicyGroupFile, VersionedDefinition.NO_VERSION);
topology = TopologyParser.parse(topologyFile);
topologyRingCreator = new TopologyRingCreator();
hostGroupTable = HostGroupTable.parse(args[6], VersionedDefinition.NO_VERSION);
hostGroups = ImmutableSet.copyOf(args[7].split(","));
recipe = new RingTreeRecipe(topology, topology.getNodeByID(nodeID), new WeightSpecifications(VersionedDefinition.NO_VERSION).parse(weightSpecsFile), ExclusionSet.parse(exclusionFile), storagePolicyGroup, policyID, hostGroupTable, hostGroups, // version not
0L, // this tree
DHTUtil.currentTimeMillis());
System.out.println("RingTreeRecipe: " + recipe);
topologyRing = topologyRingCreator.create(recipe, nodeID);
System.out.println("\n\nTopologyRing:\n");
System.out.println(topologyRing);
System.out.println("\n\n");
topologyRing = topologyRingCreator.reduceDataMovement(topologyRing, topologyRing, recipe);
System.out.println(topologyRing);
}
} catch (Exception e) {
Log.logErrorWarning(e);
}
}
use of com.ms.silverking.cloud.topology.Topology in project SilverKing by Morgan-Stanley.
the class MetaClient method test.
public void test() throws Exception {
Topology topology;
topology = TopologyParser.parse(new File("c:/tmp/topo2.txt"));
System.out.println(topology);
}
Aggregations