Permalink
Browse files

Changes to the shell, the test. Cleanup of backup files.

  • Loading branch information...
1 parent 20c6497 commit d9f32679b164ac0c56a722999cc1f1c3df6916fc @afeinberg afeinberg committed Jan 7, 2010
@@ -18,7 +18,7 @@
if [ $# -lt 3 ];
then
- echo 'USAGE: bin/voldemort-shell.sh bootstrapURL targetCluster.xml maxParallelRebalancing'
+ echo 'USAGE: bin/voldemort-rebalance-shell.sh bootstrapURL targetCluster.xml maxParallelRebalancing'
exit 1
fi
@@ -1,21 +0,0 @@
-# The ID of *this* particular cluster node
-node.id=0
-
-max.threads=100
-
-############### DB options ######################
-
-http.enable=true
-socket.enable=true
-jmx.enable=true
-
-# BDB
-bdb.sync.transactions=false
-bdb.cache.size=100MB
-
-# Mysql
-mysql.host=localhost
-mysql.port=1521
-mysql.user=root
-mysql.password=3306
-mysql.database=test
@@ -1,19 +0,0 @@
-<stores>
- <!-- Note that "test" store requires 2 reads and writes,
- so to use this store you must have both nodes started and running -->
- <store>
- <name>test</name>
- <persistence>pausable</persistence>
- <routing>client</routing>
- <replication-factor>2</replication-factor>
- <required-reads>2</required-reads>
- <required-writes>2</required-writes>
- <key-serializer>
- <type>string</type>
- </key-serializer>
- <value-serializer>
- <type>string</type>
- </value-serializer>
- <retention-days>1</retention-days>
- </store>
-</stores>
@@ -1,10 +0,0 @@
-# The size of the in-memory cache used by bdb
-bdb.sync.transactions=false
-bdb.cache.size=100MB
-
-max.threads=100
-
-http.enable=true
-socket.enable=true
-
-node.id=0
@@ -1,20 +0,0 @@
-<stores>
- <!-- Note that "test" store requires 2 reads and writes,
- so to use this store you must have both nodes started and running -->
- <store>
- <name>test</name>
- <persistence>pausable</persistence>
- <routing>client</routing>
- <replication-factor>2</replication-factor>
- <required-reads>2</required-reads>
- <required-writes>2</required-writes>
- <key-serializer>
- <type>string</type>
- <schema-info>UTF-8</schema-info>
- </key-serializer>
- <value-serializer>
- <type>string</type>
- <schema-info>UTF-8</schema-info>
- </value-serializer>
- </store>
-</stores>
@@ -52,6 +52,7 @@
import voldemort.client.protocol.admin.AdminClientConfig;
import voldemort.client.rebalance.RebalanceClientConfig;
import voldemort.client.rebalance.RebalanceController;
+import voldemort.client.rebalance.RebalancePartitionsInfo;
import voldemort.cluster.Cluster;
import voldemort.cluster.Node;
import voldemort.routing.ConsistentRoutingStrategy;
@@ -150,7 +151,8 @@ public void testGracefulRecovery() throws Exception {
{0, 1, 2, 3}}));
final SocketStoreClientFactory factory = getStoreClientFactory();
final StoreClient<String,String> storeClient = getStoreClient(factory);
- final CountDownLatch startSignal = new CountDownLatch(1);
+ final CountDownLatch nodeKilled = new CountDownLatch(1);
+ final CountDownLatch rebalanceStarted = new CountDownLatch(1);
final AtomicBoolean restartedRebalancing = new AtomicBoolean(false);
final AtomicBoolean entriesCorrect = new AtomicBoolean(false);
@@ -162,13 +164,15 @@ public void testGracefulRecovery() throws Exception {
executorService.submit(new Runnable() {
// Initiate rebalancing
public void run() {
- RebalanceController rebalanceController = new RebalanceController(getBootstrapUrl(originalCluster,
- 0),
- new RebalanceClientConfig());
-
- if (logger.isInfoEnabled())
- logger.info("Starting rebalancing");
- rebalanceController.rebalance(targetCluster);
+ AdminClient adminClient = new AdminClient(getBootstrapUrl(originalCluster, 0), new AdminClientConfig());
+ RebalancePartitionsInfo rebalancePartitionsInfo = new RebalancePartitionsInfo(1, 0,
+ Arrays.asList(0, 1, 2, 3),
+ Arrays.asList(ec2RebalancingTestConfig.testStoreName),
+ false,
+ 0
+ );
+ adminClient.rebalanceNode(rebalancePartitionsInfo);
+ rebalanceStarted.countDown();
}
});
@@ -178,11 +182,11 @@ public void run() {
try {
String hostname = originalCluster.getNodeById(1).getHost();
if (logger.isInfoEnabled())
- logger.info("Sleeping for a minute to get rebalancing into a half-way state");
+ logger.info("Waiting to get rebalancing into a half-way state");
- Thread.sleep(60 * 1000);
+ rebalanceStarted.await();
stopClusterNode(hostname,ec2RebalancingTestConfig);
- startSignal.countDown();
+ nodeKilled.countDown();
if (logger.isInfoEnabled())
logger.info("Killed node 1");
@@ -208,7 +212,7 @@ public void run() {
if (logger.isInfoEnabled())
logger.info("Waiting for the node to be brought down");
- startSignal.await();
+ nodeKilled.await();
if (logger.isInfoEnabled())
logger.info("Waiting for five minutes for rebalancing to retry");
@@ -82,9 +82,6 @@ public void rebalance(final Cluster targetCluster) {
List<String> storeList = RebalanceUtils.getStoreNameList(currentCluster, adminClient);
- if(!RebalanceUtils.getClusterRebalancingToken()) {
- throw new VoldemortException("Failed to get Cluster permission to rebalance sleep and retry ...");
- }
final RebalanceClusterPlan rebalanceClusterPlan = new RebalanceClusterPlan(currentCluster,
targetCluster,
storeList,
@@ -122,6 +119,7 @@ public void run() {
+ " rebalanceInfo:" + rebalanceSubTask);
try {
+ // TODO : Should not delete data here
int rebalanceAsyncId = startNodeRebalancing(rebalanceSubTask);
try {
@@ -157,6 +157,7 @@ public void operate() throws Exception {
// remove store from stealInfo unbalanced list.
tempUnbalancedStoreList.remove(storeName);
stealInfo.setUnbalancedStoreList(tempUnbalancedStoreList);
+ //TODO : save state here
} catch(Exception e) {
logger.error("rebalanceSubTask:" + stealInfo + " failed for store:"
+ storeName, e);

0 comments on commit d9f3267

Please sign in to comment.