Skip to content

Instantly share code, notes, and snippets.

@rsumbaly
Created January 2, 2011 23:49
Show Gist options
  • Save rsumbaly/762939 to your computer and use it in GitHub Desktop.
Save rsumbaly/762939 to your computer and use it in GitHub Desktop.
@Test
public void testIssue311() {
List<Node> nodes = Lists.newArrayList();
nodes.add(new Node(0, "localhost", 1, 2, 3, Lists.newArrayList(0, 3, 6)));
nodes.add(new Node(1, "localhost", 1, 2, 3, Lists.newArrayList(1, 4, 7)));
nodes.add(new Node(2, "localhost", 1, 2, 3, Lists.newArrayList(2, 5, 8)));
List<Node> newNodes = Lists.newArrayList();
newNodes.add(new Node(0, "localhost", 1, 2, 3, Lists.newArrayList(0, 3, 6)));
newNodes.add(new Node(1, "localhost", 1, 2, 3, Lists.newArrayList(4, 7)));
newNodes.add(new Node(2, "localhost", 1, 2, 3, Lists.newArrayList(2, 5, 8)));
newNodes.add(new Node(3, "localhost", 1, 2, 3, Lists.newArrayList(1)));
Cluster firstCluster = new Cluster("1", nodes);
Cluster secondCluster = new Cluster("2", newNodes);
StoreDefinition def = ServerTestUtils.getStoreDef("1",
3,
2,
2,
2,
2,
RoutingStrategyType.CONSISTENT_STRATEGY);
RebalanceClusterPlan plan = new RebalanceClusterPlan(firstCluster,
secondCluster,
Lists.newArrayList(def),
Lists.newArrayList(def),
false,
null);
System.out.println("PLAN = " + plan);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment