use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class PrimaryIndexSearchExample 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 Sort method main.
public static void main(String[] args) throws Exception {
Options options = new Options();
CmdLineParser parser = new CmdLineParser(options);
if (args.length == 0) {
parser.printUsage(System.err);
return;
}
parser.parseArgument(args);
IHyracksClientConnection hcc = new HyracksConnection(options.host, options.port);
JobSpecification job = createJob(parseFileSplits(options.inFileOrderSplits), parseFileSplits(options.outFileSplits), options.memBufferAlg, options.frameLimit, options.frameSize, options.topK, options.usingHeapSorter);
long start = System.currentTimeMillis();
JobId jobId = hcc.startJob(job, options.profile ? EnumSet.of(JobFlag.PROFILE_RUNTIME) : EnumSet.noneOf(JobFlag.class));
hcc.waitForCompletion(jobId);
long end = System.currentTimeMillis();
System.err.println("finished in:" + (end - start) + "ms");
}
use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class HyracksUtils method init.
public static void init() throws Exception {
CCConfig ccConfig = new CCConfig();
ccConfig.setClientListenAddress(CC_HOST);
ccConfig.setClusterListenAddress(CC_HOST);
ccConfig.setClusterListenPort(TEST_HYRACKS_CC_PORT);
ccConfig.setClientListenPort(TEST_HYRACKS_CC_CLIENT_PORT);
ccConfig.setJobHistorySize(0);
ccConfig.setProfileDumpPeriod(-1);
// cluster controller
cc = new ClusterControllerService(ccConfig);
cc.start();
// two node controllers
NCConfig ncConfig1 = new NCConfig(NC1_ID);
ncConfig1.setClusterAddress("localhost");
ncConfig1.setClusterListenAddress("localhost");
ncConfig1.setClusterPort(TEST_HYRACKS_CC_PORT);
ncConfig1.setDataListenAddress("127.0.0.1");
ncConfig1.setResultListenAddress("127.0.0.1");
nc1 = new NodeControllerService(ncConfig1);
nc1.start();
NCConfig ncConfig2 = new NCConfig(NC2_ID);
ncConfig2.setClusterAddress("localhost");
ncConfig2.setClusterListenAddress("localhost");
ncConfig2.setClusterPort(TEST_HYRACKS_CC_PORT);
ncConfig2.setDataListenAddress("127.0.0.1");
ncConfig2.setResultListenAddress("127.0.0.1");
nc2 = new NodeControllerService(ncConfig2);
nc2.start();
// hyracks connection
hcc = new HyracksConnection(CC_HOST, TEST_HYRACKS_CC_CLIENT_PORT);
}
use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class AsterixInstallerIntegrationUtil method init.
public static void init(String clusterPath) throws Exception {
managixHome = getManagixHome();
System.setProperty("log4j.configuration", managixHome + File.separator + "conf" + File.separator + "log4j.properties");
clusterConfigurationPath = managixHome + File.separator + clusterPath;
InstallerDriver.setManagixHome(managixHome);
String command = "configure";
cmdHandler.processCommand(command.split(" "));
command = "validate -c " + clusterConfigurationPath;
cmdHandler.processCommand(command.split(" "));
startZookeeper();
Thread.sleep(2000);
InstallerDriver.initConfig(true);
createInstance();
hcc = new HyracksConnection(CC_IP_ADDRESS, DEFAULT_HYRACKS_CC_CLIENT_PORT);
}
use of org.apache.hyracks.api.client.HyracksConnection in project asterixdb by apache.
the class AlgebricksHyracksIntegrationUtil method init.
public static void init() throws Exception {
FileUtils.deleteQuietly(new File(joinPath("target", "data")));
FileUtils.copyDirectory(new File("data"), new File(joinPath("target", "data")));
CCConfig ccConfig = new CCConfig();
ccConfig.setClientListenAddress("127.0.0.1");
ccConfig.setClientListenPort(TEST_HYRACKS_CC_CLIENT_NET_PORT);
ccConfig.setClusterListenAddress("127.0.0.1");
ccConfig.setClusterListenPort(TEST_HYRACKS_CC_CLUSTER_NET_PORT);
cc = new ClusterControllerService(ccConfig);
cc.start();
NCConfig ncConfig1 = new NCConfig(NC1_ID);
ncConfig1.setClusterAddress("localhost");
ncConfig1.setClusterPort(TEST_HYRACKS_CC_CLUSTER_NET_PORT);
ncConfig1.setClusterListenAddress("127.0.0.1");
ncConfig1.setDataListenAddress("127.0.0.1");
ncConfig1.setResultListenAddress("127.0.0.1");
ncConfig1.setIODevices(new String[] { joinPath(System.getProperty("user.dir"), "target", "data", "device0") });
FileUtils.forceMkdir(new File(ncConfig1.getIODevices()[0]));
nc1 = new NodeControllerService(ncConfig1);
nc1.start();
NCConfig ncConfig2 = new NCConfig(NC2_ID);
ncConfig2.setClusterAddress("localhost");
ncConfig2.setClusterPort(TEST_HYRACKS_CC_CLUSTER_NET_PORT);
ncConfig2.setClusterListenAddress("127.0.0.1");
ncConfig2.setDataListenAddress("127.0.0.1");
ncConfig2.setResultListenAddress("127.0.0.1");
ncConfig2.setIODevices(new String[] { joinPath(System.getProperty("user.dir"), "target", "data", "device1") });
FileUtils.forceMkdir(new File(ncConfig1.getIODevices()[0]));
nc2 = new NodeControllerService(ncConfig2);
nc2.start();
hcc = new HyracksConnection(ccConfig.getClientListenAddress(), ccConfig.getClientListenPort());
}
Aggregations