// Tajo Cluster Section
////////////////////////////////////////////////////////
private void startMiniTajoCluster(File testBuildDir,
final int numSlaves,
boolean local) throws Exception {
TajoConf c = getConfiguration();
c.setVar(ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS, "localhost:0");
c.setVar(ConfVars.TAJO_MASTER_UMBILICAL_RPC_ADDRESS, "localhost:0");
c.setVar(ConfVars.WORKER_PEER_RPC_ADDRESS, "localhost:0");
c.setVar(ConfVars.CATALOG_ADDRESS, "localhost:0");
c.set(CatalogConstants.STORE_CLASS, "org.apache.tajo.catalog.store.MemStore");
c.set(CatalogConstants.JDBC_URI, "jdbc:derby:" + testBuildDir.getAbsolutePath() + "/db");
c.setVar(ConfVars.WORKER_TEMPORAL_DIR, "file://" + testBuildDir.getAbsolutePath() + "/tajo-localdir");
LOG.info("derby repository is set to "+conf.get(CatalogConstants.JDBC_URI));
if (!local) {
c.setVar(ConfVars.ROOT_DIR,
getMiniDFSCluster().getFileSystem().getUri() + "/tajo");
} else {
c.setVar(ConfVars.ROOT_DIR,
clusterTestBuildDir.getAbsolutePath() + "/tajo");
}
tajoMaster = new TajoMaster();
tajoMaster.init(c);
tajoMaster.start();
this.conf.setVar(ConfVars.WORKER_PEER_RPC_ADDRESS, c.getVar(ConfVars.WORKER_PEER_RPC_ADDRESS));
this.conf.setVar(ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS, c.getVar(ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS));
InetSocketAddress tajoMasterAddress = tajoMaster.getContext().getTajoMasterService().getBindAddress();
this.conf.setVar(ConfVars.TAJO_MASTER_UMBILICAL_RPC_ADDRESS,
tajoMasterAddress.getHostName() + ":" + tajoMasterAddress.getPort());
this.conf.setVar(ConfVars.CATALOG_ADDRESS, c.getVar(ConfVars.CATALOG_ADDRESS));
if(standbyWorkerMode) {
startTajoWorkers(numSlaves);
}
LOG.info("Mini Tajo cluster is up");