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 ; } }
Extract the two involved partitions from the