use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class InsertPipelineExample method main.
public static void main(String[] args) throws Exception {
Options options = new Options();
CmdLineParser parser = new CmdLineParser(options);
parser.parseArgument(args);
IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
JobSpecification job = createJob(options);
long start = System.currentTimeMillis();
JobId jobId = hcc.startJob(job);
hcc.waitForCompletion(jobId);
long end = System.currentTimeMillis();
System.err.println(start + " " + end + " " + (end - start));
}
use of org.apache.hyracks.api.client.HyracksConnection 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()]);
}
use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class NCApplication method getHcc.
protected IHyracksClientConnection getHcc() throws Exception {
NodeControllerService ncSrv = (NodeControllerService) ncServiceCtx.getControllerService();
ClusterControllerInfo ccInfo = ncSrv.getNodeParameters().getClusterControllerInfo();
return new HyracksConnection(ccInfo.getClientNetAddress(), ccInfo.getClientNetPort());
}
use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class SecondaryIndexSearchExample method main.
public static void main(String[] args) throws Exception {
Options options = new Options();
CmdLineParser parser = new CmdLineParser(options);
parser.parseArgument(args);
IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
JobSpecification job = createJob(options);
long start = System.currentTimeMillis();
JobId jobId = hcc.startJob(job);
hcc.waitForCompletion(jobId);
long end = System.currentTimeMillis();
System.err.println(start + " " + end + " " + (end - start));
}
use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class PrimaryIndexBulkLoadExample method main.
public static void main(String[] args) throws Exception {
Options options = new Options();
CmdLineParser parser = new CmdLineParser(options);
parser.parseArgument(args);
IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
JobSpecification job = createJob(options);
long start = System.currentTimeMillis();
JobId jobId = hcc.startJob(job);
hcc.waitForCompletion(jobId);
long end = System.currentTimeMillis();
System.err.println(start + " " + end + " " + (end - start));
}
Aggregations