Search in sources :

Example 1 with SqlCommandParser

use of org.apache.zeppelin.flink.sql.SqlCommandParser in project zeppelin by apache.

the class FlinkSqlInterpreter method open.

@Override
public void open() throws InterpreterException {
    this.sqlCommandParser = new SqlCommandParser(flinkInterpreter.getFlinkShims(), tbenv);
    this.sqlSplitter = new SqlSplitter();
    JobListener jobListener = new JobListener() {

        @Override
        public void onJobSubmitted(@Nullable JobClient jobClient, @Nullable Throwable throwable) {
            if (lock.isHeldByCurrentThread()) {
                lock.unlock();
                LOGGER.info("UnLock JobSubmitLock");
            }
        }

        @Override
        public void onJobExecuted(@Nullable JobExecutionResult jobExecutionResult, @Nullable Throwable throwable) {
        }
    };
    flinkInterpreter.getExecutionEnvironment().getJavaEnv().registerJobListener(jobListener);
    flinkInterpreter.getStreamExecutionEnvironment().getJavaEnv().registerJobListener(jobListener);
    this.defaultSqlParallelism = flinkInterpreter.getDefaultSqlParallelism();
    this.tableConfigOptions = flinkInterpreter.getFlinkShims().extractTableConfigOptions();
}
Also used : SqlSplitter(org.apache.zeppelin.interpreter.util.SqlSplitter) JobExecutionResult(org.apache.flink.api.common.JobExecutionResult) SqlCommandParser(org.apache.zeppelin.flink.sql.SqlCommandParser) JobListener(org.apache.flink.core.execution.JobListener) JobClient(org.apache.flink.core.execution.JobClient) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 JobExecutionResult (org.apache.flink.api.common.JobExecutionResult)1 JobClient (org.apache.flink.core.execution.JobClient)1 JobListener (org.apache.flink.core.execution.JobListener)1 SqlCommandParser (org.apache.zeppelin.flink.sql.SqlCommandParser)1 SqlSplitter (org.apache.zeppelin.interpreter.util.SqlSplitter)1