Skip to content

Commit

Permalink
Fixing test cases, have RebalanceController use ProtoBuf
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothchandar committed Apr 18, 2013
1 parent d24d0b1 commit 881d7b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/java/voldemort/client/protocol/admin/AdminClient.java
Expand Up @@ -1960,12 +1960,12 @@ public SocketStore getSocketStore(int nodeId, String storeName) {

SocketStore newSocketStore = null;
try {
// request format is always protobuf since IGNORE_CHECKS
// does not work otherwise
// Unless request format is protobuf, IGNORE_CHECKS
// will not work otherwise
newSocketStore = clientPool.create(storeName,
node.getHost(),
node.getSocketPort(),
RequestFormatType.PROTOCOL_BUFFERS,
clientConfig.getRequestFormatType(),
RequestRoutingType.IGNORE_CHECKS);
} catch(Exception e) {
clientPool.close();
Expand Down
5 changes: 4 additions & 1 deletion src/java/voldemort/client/rebalance/RebalanceController.java
Expand Up @@ -30,6 +30,7 @@

import voldemort.VoldemortException;
import voldemort.client.ClientConfig;
import voldemort.client.protocol.RequestFormatType;
import voldemort.client.protocol.admin.AdminClient;
import voldemort.client.rebalance.task.DonorBasedRebalanceTask;
import voldemort.client.rebalance.task.RebalanceTask;
Expand Down Expand Up @@ -58,7 +59,9 @@ public class RebalanceController {
private final RebalanceClientConfig rebalanceConfig;

public RebalanceController(String bootstrapUrl, RebalanceClientConfig rebalanceConfig) {
this.adminClient = new AdminClient(bootstrapUrl, rebalanceConfig, new ClientConfig());
this.adminClient = new AdminClient(bootstrapUrl,
rebalanceConfig,
new ClientConfig().setRequestFormatType(RequestFormatType.PROTOCOL_BUFFERS));
this.rebalanceConfig = rebalanceConfig;
}

Expand Down
Expand Up @@ -131,13 +131,17 @@ public static RebalancePartitionsInfo create(Map<?, ?> map) {
List<Integer> partitionList = Utils.uncheckedCast(map.get(unbalancedStore
+ "replicaToAddPartitionList"
+ Integer.toString(replicaNo)));
if(partitionList != null && partitionList.size() > 0)
// TODO there is a potential NPE hiding here that might fail
// rebalancing tests
if(partitionList.size() > 0)
replicaToAddPartition.put(replicaNo, partitionList);

List<Integer> deletePartitionList = Utils.uncheckedCast(map.get(unbalancedStore
+ "replicaToDeletePartitionList"
+ Integer.toString(replicaNo)));
if(deletePartitionList != null && deletePartitionList.size() > 0)
// TODO there is a potential NPE hiding here that might fail
// rebalancing tests
if(deletePartitionList.size() > 0)
replicaToDeletePartitionList.put(replicaNo, deletePartitionList);
}

Expand Down

0 comments on commit 881d7b3

Please sign in to comment.