ShardDeployOperation deployInstruction = new ShardDeployOperation();
for (String shard : listOfAdded) {
deployInstruction.addShard(shard, indexMD.getShardPath(shard));
newShardsByNode.add(node, shard);
}
OperationId operationId = protocol.addNodeOperation(node, deployInstruction);
operationIds.add(operationId);
}
List<String> listOfRemoved = CollectionUtil.getListOfRemoved(currentGlobalNode2ShardsMap.get(node), nodeShards);
if (!listOfRemoved.isEmpty()) {
ShardUndeployOperation undeployInstruction = new ShardUndeployOperation(listOfRemoved);
OperationId operationId = protocol.addNodeOperation(node, undeployInstruction);
operationIds.add(operationId);
}
}
_newShardsByNodeMap = newShardsByNode.asMap();
return operationIds;