Search in sources :

Example 16 with IHyracksClientConnection

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;
}
Also used : IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) QueryWebInterfaceServlet(org.apache.asterix.api.http.server.QueryWebInterfaceServlet) HttpServer(org.apache.hyracks.http.server.HttpServer)

Example 17 with IHyracksClientConnection

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;
}
Also used : IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) ShutdownApiServlet(org.apache.asterix.api.http.server.ShutdownApiServlet) VersionApiServlet(org.apache.asterix.api.http.server.VersionApiServlet) QueryResultApiServlet(org.apache.asterix.api.http.server.QueryResultApiServlet) UpdateApiServlet(org.apache.asterix.api.http.server.UpdateApiServlet) RebalanceApiServlet(org.apache.asterix.api.http.server.RebalanceApiServlet) QueryStatusApiServlet(org.apache.asterix.api.http.server.QueryStatusApiServlet) ClusterApiServlet(org.apache.asterix.api.http.server.ClusterApiServlet) ApiServlet(org.apache.asterix.api.http.server.ApiServlet) FullApiServlet(org.apache.asterix.api.http.server.FullApiServlet) QueryApiServlet(org.apache.asterix.api.http.server.QueryApiServlet) NodeControllerDetailsApiServlet(org.apache.asterix.api.http.server.NodeControllerDetailsApiServlet) ConnectorApiServlet(org.apache.asterix.api.http.server.ConnectorApiServlet) DdlApiServlet(org.apache.asterix.api.http.server.DdlApiServlet) ClusterControllerDetailsApiServlet(org.apache.asterix.api.http.server.ClusterControllerDetailsApiServlet) DiagnosticsApiServlet(org.apache.asterix.api.http.server.DiagnosticsApiServlet) HttpServer(org.apache.hyracks.http.server.HttpServer)

Example 18 with IHyracksClientConnection

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();
    }
}
Also used : AsterixClientConfig(org.apache.asterix.api.common.AsterixClientConfig) IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) CmdLineParser(org.kohsuke.args4j.CmdLineParser) HyracksConnection(org.apache.hyracks.api.client.HyracksConnection) AsterixJavaClient(org.apache.asterix.api.java.AsterixJavaClient)

Example 19 with IHyracksClientConnection

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));
}
Also used : IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) CmdLineParser(org.kohsuke.args4j.CmdLineParser) JobSpecification(org.apache.hyracks.api.job.JobSpecification) HyracksConnection(org.apache.hyracks.api.client.HyracksConnection) JobId(org.apache.hyracks.api.job.JobId)

Example 20 with IHyracksClientConnection

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));
}
Also used : IHyracksClientConnection(org.apache.hyracks.api.client.IHyracksClientConnection) CmdLineParser(org.kohsuke.args4j.CmdLineParser) JobSpecification(org.apache.hyracks.api.job.JobSpecification) HyracksConnection(org.apache.hyracks.api.client.HyracksConnection) JobId(org.apache.hyracks.api.job.JobId)

Aggregations

IHyracksClientConnection (org.apache.hyracks.api.client.IHyracksClientConnection)30 HyracksConnection (org.apache.hyracks.api.client.HyracksConnection)13 JobId (org.apache.hyracks.api.job.JobId)13 JobSpecification (org.apache.hyracks.api.job.JobSpecification)11 CmdLineParser (org.kohsuke.args4j.CmdLineParser)10 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)8 PrintWriter (java.io.PrintWriter)8 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)7 IOException (java.io.IOException)7 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 AsterixException (org.apache.asterix.common.exceptions.AsterixException)3 IServletRequest (org.apache.hyracks.http.api.IServletRequest)3 IServletResponse (org.apache.hyracks.http.api.IServletResponse)3 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)2 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 Date (java.util.Date)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2