use of org.voltdb.sysprocs.BalancePartitionsRequest in project voltdb by VoltDB.
the class MpScheduler method getBalancePartitions.
/**
* Extract the two involved partitions from the @BalancePartitions request.
*/
private Set<Integer> getBalancePartitions(Iv2InitiateTaskMessage msg) {
try {
JSONObject jsObj = new JSONObject((String) msg.getParameters()[0]);
BalancePartitionsRequest request = new BalancePartitionsRequest(jsObj);
return Sets.newHashSet(request.partitionPairs.get(0).srcPartition, request.partitionPairs.get(0).destPartition);
} catch (JSONException e) {
hostLog.warn("Unable to determine partitions for @BalancePartitions", e);
return null;
}
}
Aggregations