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());
}
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);
}
Aggregations