use of org.apache.hyracks.api.client.IHyracksClientConnection in project asterixdb by apache.
the class CCApplication method setupQueryWebServer.
protected HttpServer setupQueryWebServer(ExternalProperties externalProperties) throws Exception {
HttpServer queryWebServer = new HttpServer(webManager.getBosses(), webManager.getWorkers(), externalProperties.getQueryWebInterfacePort());
IHyracksClientConnection hcc = getHcc();
queryWebServer.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
queryWebServer.addServlet(new QueryWebInterfaceServlet(appCtx, queryWebServer.ctx(), new String[] { "/*" }));
return queryWebServer;
}
use of org.apache.hyracks.api.client.IHyracksClientConnection in project asterixdb by apache.
the class CCApplication method setupWebServer.
protected HttpServer setupWebServer(ExternalProperties externalProperties) throws Exception {
HttpServer webServer = new HttpServer(webManager.getBosses(), webManager.getWorkers(), externalProperties.getWebInterfacePort());
IHyracksClientConnection hcc = getHcc();
webServer.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
webServer.addServlet(new ApiServlet(webServer.ctx(), new String[] { "/*" }, appCtx, ccExtensionManager.getCompilationProvider(AQL), ccExtensionManager.getCompilationProvider(SQLPP), getStatementExecutorFactory(), componentProvider));
return webServer;
}
use of org.apache.hyracks.api.client.IHyracksClientConnection in project asterixdb by apache.
the class AsterixClientDriver method main.
public static void main(String[] args) throws Exception {
AsterixClientConfig acc = new AsterixClientConfig();
CmdLineParser cmdParser = new CmdLineParser(acc);
try {
cmdParser.parseArgument(args);
} catch (Exception e) {
cmdParser.printUsage(System.err);
throw e;
}
if (acc.getArguments().isEmpty()) {
System.err.println("Please specify the file containing the query.");
return;
}
if (acc.getArguments().size() > 1) {
System.err.print("Too many arguments. ");
System.err.println("Only the file contained the query needs to be specified.");
return;
}
boolean exec = new Boolean(acc.execute);
IHyracksClientConnection hcc = exec ? new HyracksConnection("localhost", acc.hyracksPort) : null;
AsterixJavaClient q = compileQuery(hcc, acc.getArguments().get(0), new Boolean(acc.optimize), new Boolean(acc.onlyPhysical), exec || new Boolean(acc.hyracksJob));
if (exec) {
q.execute();
}
}
use of org.apache.hyracks.api.client.IHyracksClientConnection in project asterixdb by apache.
the class SecondaryIndexBulkLoadExample 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.IHyracksClientConnection 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));
}
Aggregations