Constructor and Description |
---|
LocalExecutor(Environment defaultEnvironment,
List<URL> dependencies,
Configuration flinkConfig,
CustomCommandLine<?> commandLine)
Constructor for testing purposes.
|
LocalExecutor(URL defaultEnv,
List<URL> jars,
List<URL> libraries)
Creates a local executor for submitting table programs and retrieving results.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelQuery(SessionContext session,
String resultId)
Cancels a table program and stops the result retrieval.
|
ResultDescriptor |
executeQuery(SessionContext session,
String query)
Submits a Flink job (detached) and returns the result descriptor.
|
String |
explainStatement(SessionContext session,
String statement)
Returns a string-based explanation about AST and execution plan of the given statement.
|
Map<String,String> |
getSessionProperties(SessionContext session)
Lists all session properties that are defined by the executor and the session.
|
org.apache.flink.table.api.TableSchema |
getTableSchema(SessionContext session,
String name)
Returns the schema of a table.
|
List<String> |
listTables(SessionContext session)
Lists all tables known to the executor.
|
TypedResult<List<Tuple2<Boolean,Row>>> |
retrieveResultChanges(SessionContext session,
String resultId)
Asks for the next changelog results (non-blocking).
|
List<Row> |
retrieveResultPage(String resultId,
int page)
Returns the rows that are part of the current page or throws an exception if the snapshot has been expired.
|
TypedResult<Integer> |
snapshotResult(SessionContext session,
String resultId,
int pageSize)
Creates an immutable result snapshot of the running Flink job.
|
void |
start()
Starts the executor and ensures that its is ready for commands to be executed.
|
void |
stop(SessionContext session)
Stops the executor.
|
public LocalExecutor(URL defaultEnv, List<URL> jars, List<URL> libraries)
public LocalExecutor(Environment defaultEnvironment, List<URL> dependencies, Configuration flinkConfig, CustomCommandLine<?> commandLine)
public void start()
Executor
public Map<String,String> getSessionProperties(SessionContext session) throws SqlExecutionException
Executor
getSessionProperties
in interface Executor
SqlExecutionException
public List<String> listTables(SessionContext session) throws SqlExecutionException
Executor
listTables
in interface Executor
SqlExecutionException
public org.apache.flink.table.api.TableSchema getTableSchema(SessionContext session, String name) throws SqlExecutionException
Executor
getTableSchema
in interface Executor
SqlExecutionException
public String explainStatement(SessionContext session, String statement) throws SqlExecutionException
Executor
explainStatement
in interface Executor
SqlExecutionException
public ResultDescriptor executeQuery(SessionContext session, String query) throws SqlExecutionException
Executor
executeQuery
in interface Executor
SqlExecutionException
public TypedResult<List<Tuple2<Boolean,Row>>> retrieveResultChanges(SessionContext session, String resultId) throws SqlExecutionException
Executor
retrieveResultChanges
in interface Executor
SqlExecutionException
public TypedResult<Integer> snapshotResult(SessionContext session, String resultId, int pageSize) throws SqlExecutionException
Executor
snapshotResult
in interface Executor
SqlExecutionException
public List<Row> retrieveResultPage(String resultId, int page) throws SqlExecutionException
Executor
retrieveResultPage
in interface Executor
SqlExecutionException
public void cancelQuery(SessionContext session, String resultId) throws SqlExecutionException
Executor
cancelQuery
in interface Executor
SqlExecutionException
public void stop(SessionContext session)
Executor
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.