Search in sources :

Example 11 with NCConfig

use of org.apache.hyracks.control.common.controllers.NCConfig in project asterixdb by apache.

the class AbstractMultiNCIntegrationTest method init.

@BeforeClass
public static void init() throws Exception {
    CCConfig ccConfig = new CCConfig();
    ccConfig.setClientListenAddress("127.0.0.1");
    ccConfig.setClientListenPort(39000);
    ccConfig.setClusterListenAddress("127.0.0.1");
    ccConfig.setClusterListenPort(39001);
    ccConfig.setProfileDumpPeriod(10000);
    File outDir = new File("target" + File.separator + "ClusterController");
    outDir.mkdirs();
    File ccRoot = File.createTempFile(AbstractMultiNCIntegrationTest.class.getName(), ".data", outDir);
    ccRoot.delete();
    ccRoot.mkdir();
    ccConfig.setRootDir(ccRoot.getAbsolutePath());
    ccConfig.setAppClass(DummyApplication.class.getName());
    cc = new ClusterControllerService(ccConfig);
    cc.start();
    asterixNCs = new NodeControllerService[ASTERIX_IDS.length];
    for (int i = 0; i < ASTERIX_IDS.length; i++) {
        File ioDev = new File("target" + File.separator + ASTERIX_IDS[i] + File.separator + "ioDevice");
        FileUtils.forceMkdir(ioDev);
        FileUtils.copyDirectory(new File("data" + File.separator + "device0"), ioDev);
        NCConfig ncConfig = new NCConfig(ASTERIX_IDS[i]);
        ncConfig.setClusterAddress("localhost");
        ncConfig.setClusterPort(39001);
        ncConfig.setClusterListenAddress("127.0.0.1");
        ncConfig.setDataListenAddress("127.0.0.1");
        ncConfig.setResultListenAddress("127.0.0.1");
        ncConfig.setIODevices(new String[] { ioDev.getAbsolutePath() });
        asterixNCs[i] = new NodeControllerService(ncConfig);
        asterixNCs[i].start();
    }
    hcc = new HyracksConnection(ccConfig.getClientListenAddress(), ccConfig.getClientListenPort());
    if (LOGGER.isLoggable(Level.INFO)) {
        LOGGER.info("Starting CC in " + ccRoot.getAbsolutePath());
    }
}
Also used : NodeControllerService(org.apache.hyracks.control.nc.NodeControllerService) CCConfig(org.apache.hyracks.control.common.controllers.CCConfig) NCConfig(org.apache.hyracks.control.common.controllers.NCConfig) HyracksConnection(org.apache.hyracks.api.client.HyracksConnection) File(java.io.File) ClusterControllerService(org.apache.hyracks.control.cc.ClusterControllerService) BeforeClass(org.junit.BeforeClass)

Aggregations

NCConfig (org.apache.hyracks.control.common.controllers.NCConfig)11 NodeControllerService (org.apache.hyracks.control.nc.NodeControllerService)7 HyracksConnection (org.apache.hyracks.api.client.HyracksConnection)6 ClusterControllerService (org.apache.hyracks.control.cc.ClusterControllerService)6 CCConfig (org.apache.hyracks.control.common.controllers.CCConfig)6 File (java.io.File)4 BeforeClass (org.junit.BeforeClass)3 NodeControllerState (org.apache.hyracks.control.cc.NodeControllerState)2 IOException (java.io.IOException)1 MetadataProperties (org.apache.asterix.common.config.MetadataProperties)1 TransactionProperties (org.apache.asterix.common.config.TransactionProperties)1 Cluster (org.apache.asterix.event.schema.cluster.Cluster)1 Node (org.apache.asterix.event.schema.cluster.Node)1 INCApplication (org.apache.hyracks.api.application.INCApplication)1 NetworkAddress (org.apache.hyracks.api.comm.NetworkAddress)1 NodeCapacity (org.apache.hyracks.api.job.resource.NodeCapacity)1 ConfigManager (org.apache.hyracks.control.common.config.ConfigManager)1 CmdLineException (org.kohsuke.args4j.CmdLineException)1