use of org.apache.hyracks.api.application.ICCApplication in project asterixdb by apache.
the class CCDriver method main.
public static void main(String[] args) throws Exception {
try {
final ConfigManager configManager = new ConfigManager(args);
ICCApplication application = getApplication(args);
application.registerConfig(configManager);
CCConfig ccConfig = new CCConfig(configManager);
ClusterControllerService ccService = new ClusterControllerService(ccConfig, application);
ccService.start();
while (true) {
Thread.sleep(100000);
}
} catch (CmdLineException e) {
LOGGER.log(Level.FINE, "Exception parsing command line: " + Arrays.toString(args), e);
System.exit(2);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Exiting CCDriver due to exception", e);
System.exit(1);
}
}
use of org.apache.hyracks.api.application.ICCApplication in project asterixdb by apache.
the class AsterixHyracksIntegrationUtil method init.
public void init(boolean deleteOldInstanceData) throws Exception {
final ICCApplication ccApplication = createCCApplication();
configManager = new ConfigManager();
ccApplication.registerConfig(configManager);
final CCConfig ccConfig = createCCConfig(configManager);
cc = new ClusterControllerService(ccConfig, ccApplication);
nodeNames = ccConfig.getConfigManager().getNodeNames();
if (deleteOldInstanceData) {
deleteTransactionLogs();
removeTestStorageFiles();
}
final List<NodeControllerService> nodeControllers = new ArrayList<>();
for (String nodeId : nodeNames) {
// mark this NC as virtual in the CC's config manager, so he doesn't try to contact NCService...
configManager.set(nodeId, NCConfig.Option.VIRTUAL_NC, true);
final INCApplication ncApplication = createNCApplication();
ConfigManager ncConfigManager = new ConfigManager();
ncApplication.registerConfig(ncConfigManager);
nodeControllers.add(new NodeControllerService(fixupIODevices(createNCConfig(nodeId, ncConfigManager)), ncApplication));
}
;
cc.start();
// Starts ncs.
nodeNames = ccConfig.getConfigManager().getNodeNames();
List<Thread> startupThreads = new ArrayList<>();
for (NodeControllerService nc : nodeControllers) {
Thread ncStartThread = new Thread("IntegrationUtil-" + nc.getId()) {
@Override
public void run() {
try {
nc.start();
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
}
};
ncStartThread.start();
startupThreads.add(ncStartThread);
}
//wait until all NCs complete their startup
for (Thread thread : startupThreads) {
thread.join();
}
// Wait until cluster becomes active
ClusterStateManager.INSTANCE.waitForState(ClusterState.ACTIVE);
hcc = new HyracksConnection(cc.getConfig().getClientListenAddress(), cc.getConfig().getClientListenPort());
this.ncs = nodeControllers.toArray(new NodeControllerService[nodeControllers.size()]);
}
Aggregations