Search in sources :

Example 1 with StatementsPost

use of com.thinkbiganalytics.kylo.spark.model.StatementsPost in project kylo by Teradata.

the class SparkLivyProcessManager method initSession.

private void initSession(SparkLivyProcess sparkLivyProcess) {
    JerseyRestClient jerseyClient = getClient(sparkLivyProcess);
    String script = scalaScriptService.getInitSessionScript();
    StatementsPost sp = new StatementsPost.Builder().kind(StatementKind.spark.toString()).code(script).build();
    Statement statement = livyClient.postStatement(jerseyClient, sparkLivyProcess, sp);
    // NOTE:  why pollStatement now?  so we block on result.
    livyClient.pollStatement(jerseyClient, sparkLivyProcess, statement.getId());
}
Also used : StatementsPost(com.thinkbiganalytics.kylo.spark.model.StatementsPost) Statement(com.thinkbiganalytics.kylo.spark.model.Statement) JerseyRestClient(com.thinkbiganalytics.rest.JerseyRestClient)

Example 2 with StatementsPost

use of com.thinkbiganalytics.kylo.spark.model.StatementsPost in project kylo by Teradata.

the class SparkLivyRestClient method submitCode.

private Statement submitCode(JerseyRestClient client, String script, SparkShellProcess process) {
    Validate.isInstanceOf(SparkLivyProcess.class, process, "SparkLivyRestClient.submitCode called on non Livy Process");
    SparkLivyProcess sparkLivyProcess = (SparkLivyProcess) process;
    StatementsPost sp = new StatementsPost.Builder().code(script).kind("spark").build();
    return livyClient.postStatement(client, sparkLivyProcess, sp);
}
Also used : StatementsPost(com.thinkbiganalytics.kylo.spark.model.StatementsPost)

Aggregations

StatementsPost (com.thinkbiganalytics.kylo.spark.model.StatementsPost)2 Statement (com.thinkbiganalytics.kylo.spark.model.Statement)1 JerseyRestClient (com.thinkbiganalytics.rest.JerseyRestClient)1