Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Forklift tool fix to equally spread fetches
  • Loading branch information
vinothchandar committed Apr 12, 2013
1 parent 74bdfde commit b8e6f78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/java/voldemort/utils/ClusterForkLiftTool.java
@@ -1,6 +1,7 @@
package voldemort.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -160,6 +161,9 @@ public ClusterForkLiftTool(String srcBootstrapUrl,
.getNumberOfPartitions());
for(Node node: srcAdminClient.getAdminClientCluster().getNodes())
this.partitionList.addAll(node.getPartitionIds());
// shuffle the partition list so the fetching will equally spread
// across the source cluster
Collections.shuffle(this.partitionList);
if(this.partitionList.size() > srcAdminClient.getAdminClientCluster()
.getNumberOfPartitions()) {
throw new VoldemortException("Incorrect partition mapping in source cluster");
Expand Down Expand Up @@ -557,7 +561,7 @@ public static void main(String[] args) throws Exception {
maxPutsPerSecond = (Integer) options.valueOf("max-puts-per-second");
List<String> storesList = null;
if(options.has("stores")) {
storesList = (List<String>) options.valuesOf("stores");
storesList = new ArrayList<String>((List<String>) options.valuesOf("stores"));
}
List<Integer> partitions = null;
if(options.has("partitions")) {
Expand Down

0 comments on commit b8e6f78

Please sign in to comment.