@Test
public void testMultiDeployFiring() throws Throwable {
// Same as test deploy firing, but with more than one DNode and different deploy actions
SploutConfiguration config1 = SploutConfiguration.getTestConfig();
DNode dnode1 = TestUtils.getTestDNode(config1, new IDNodeHandler() {
@Override
public void init(SploutConfiguration config) throws Exception {
}
@Override
public String sqlQuery(String tablespace, long version, int partition, String query)
throws DNodeException {
return null;
}
@Override
public String deploy(List<DeployAction> deployActions, long distributedBarrier)
throws DNodeException {
/*
* DNode1 asserts
*/
Assert.assertEquals(2, deployActions.size());
Assert.assertEquals("hdfs://foo/bar1/0.db", deployActions.get(0).getDataURI());
Assert.assertEquals("hdfs://foo/bar2/0.db", deployActions.get(1).getDataURI());
Assert.assertEquals("partition1", deployActions.get(0).getTablespace());
Assert.assertEquals("partition2", deployActions.get(1).getTablespace());
return "FOO";
}
@Override
public String rollback(List<RollbackAction> rollbackActions, String ignoreMe)
throws DNodeException {
return null;
}
@Override
public String status() throws DNodeException {
return null;
}
@Override
public void stop() throws Exception {
}
@Override
public void giveGreenLigth() {
}
@Override
public String abortDeploy(long version) throws DNodeException {
return null;
}
@Override
public String deleteOldVersions(List<com.splout.db.thrift.TablespaceVersion> versions)
throws DNodeException {
return null;
}
@Override
public String testCommand(String command) throws DNodeException {
// TODO Auto-generated method stub
return null;
}
}, "dnode-" + this.getClass().getName() + "-3");
SploutConfiguration config2 = SploutConfiguration.getTestConfig();
DNode dnode2 = TestUtils.getTestDNode(config2, new IDNodeHandler() {
@Override
public void init(SploutConfiguration config) throws Exception {
}
@Override