metadata3Replicas.setNReplicas(3);
PartitionMetadata metadata1Replicas = new PartitionMetadata();
metadata1Replicas.setNReplicas(1);
// t1, version 1, partition 0 -> 3 replicas, only 2 dnodes: dnode1, dnode2
DNodeInfoFacade facade1 = new DNodeInfoFacade("dnode1");
facade1.addTablespaceVersionPartition("t1", 1l, 0, metadata3Replicas);
DNodeInfoFacade facade2 = new DNodeInfoFacade("dnode2");
// t2, version 1, partition 0 -> 1 replica, 1 dnode: dnode3
facade2.addTablespaceVersionPartition("t1", 1l, 0, metadata3Replicas);
DNodeInfoFacade facade3 = new DNodeInfoFacade("dnode3");
facade3.addTablespaceVersionPartition("t2", 1l, 0, metadata1Replicas);
List<String> dnodes = Arrays.asList(new String[] { "dnode1", "dnode2", "dnode3" });
List<DNodeInfo> dNodeInfo = Arrays.asList(new DNodeInfo[] { facade1.getDNodeInfo(),
facade2.getDNodeInfo(), facade3.getDNodeInfo() });
QNodeHandlerContext ctx = new QNodeHandlerContext(config, new CoordinationStructuresMock(dnodes,
dNodeInfo));
ctx.updateTablespaceVersions(dNodeInfo.get(0), DNodeEvent.ENTRY);
ctx.updateTablespaceVersions(dNodeInfo.get(1), DNodeEvent.ENTRY);