| 构造器和说明 |
|---|
LocalExecutor(DefaultContext defaultContext)
Creates a local executor for submitting table programs and retrieving results.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addJar(String sessionId,
String jarUrl)
Add the JAR resource into the classloader with specified session.
|
void |
cancelQuery(String sessionId,
String resultId)
Cancels a table program and stops the result retrieval.
|
void |
closeSession(String sessionId)
Close the resources of session for given session id.
|
List<String> |
completeStatement(String sessionId,
String statement,
int position)
Returns a list of completion hints for the given statement at the given position.
|
org.apache.flink.table.api.TableResult |
executeModifyOperations(String sessionId,
List<org.apache.flink.table.operations.ModifyOperation> operations)
Executes modify operations, and return
TableResult as execution result. |
org.apache.flink.table.api.TableResult |
executeOperation(String sessionId,
org.apache.flink.table.operations.Operation operation)
Executes an operation, and return
TableResult as execution result. |
ResultDescriptor |
executeQuery(String sessionId,
org.apache.flink.table.operations.QueryOperation query)
Submits a Flink SQL query job (detached) and returns the result descriptor.
|
protected ExecutionContext |
getExecutionContext(String sessionId)
Get the existed
ExecutionContext from contextMap, or thrown exception if does not
exist. |
org.apache.flink.configuration.ReadableConfig |
getSessionConfig(String sessionId)
Returns a
ReadableConfig of all session configurations that are defined by the
executor and the session. |
Map<String,String> |
getSessionConfigMap(String sessionId)
Returns a copy of
Map of all session configurations that are defined by the executor
and the session. |
List<String> |
listJars(String sessionId)
List the JAR resources of the classloader with specified session.
|
String |
openSession(String sessionId)
Open a new session by using the given session id.
|
org.apache.flink.table.operations.Operation |
parseStatement(String sessionId,
String statement)
Parse a SQL statement to
Operation. |
void |
removeJar(String sessionId,
String jarUrl)
Remove the JAR resource from the classloader with specified session.
|
void |
resetSessionProperties(String sessionId)
Reset all the properties for the given session identifier.
|
void |
resetSessionProperty(String sessionId,
String key)
Reset given key's the session property for default value, if key is not defined in config
file, then remove it.
|
TypedResult<List<org.apache.flink.types.Row>> |
retrieveResultChanges(String sessionId,
String resultId)
Asks for the next changelog results (non-blocking).
|
List<org.apache.flink.types.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.
|
void |
setSessionProperty(String sessionId,
String key,
String value)
Set given key's session property to the specific value.
|
TypedResult<Integer> |
snapshotResult(String sessionId,
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.
|
public LocalExecutor(DefaultContext defaultContext)
public void start()
Executorpublic String openSession(@Nullable String sessionId) throws SqlExecutionException
ExecutoropenSession 在接口中 ExecutorsessionId - session identifier.SqlExecutionException - if any error happenpublic void closeSession(String sessionId) throws SqlExecutionException
ExecutorcloseSession 在接口中 ExecutorsessionId - session identifierSqlExecutionException - if any error happen@VisibleForTesting protected ExecutionContext getExecutionContext(String sessionId) throws SqlExecutionException
ExecutionContext from contextMap, or thrown exception if does not
exist.public Map<String,String> getSessionConfigMap(String sessionId) throws SqlExecutionException
ExecutorMap of all session configurations that are defined by the executor
and the session.
Both this method and Executor.getSessionConfig(String) return the same configuration set,
but different return type.
getSessionConfigMap 在接口中 ExecutorSqlExecutionExceptionpublic org.apache.flink.configuration.ReadableConfig getSessionConfig(String sessionId) throws SqlExecutionException
ExecutorReadableConfig of all session configurations that are defined by the
executor and the session.
Both this method and Executor.getSessionConfigMap(String) return the same configuration
set, but different return type.
getSessionConfig 在接口中 ExecutorSqlExecutionExceptionpublic void resetSessionProperties(String sessionId) throws SqlExecutionException
ExecutorresetSessionProperties 在接口中 ExecutorsessionId - to identifier the sessionSqlExecutionException - if any error happen.public void resetSessionProperty(String sessionId, String key) throws SqlExecutionException
ExecutorresetSessionProperty 在接口中 ExecutorsessionId - to identifier the sessionkey - of need to reset the session propertySqlExecutionException - if any error happen.public void setSessionProperty(String sessionId, String key, String value) throws SqlExecutionException
ExecutorsetSessionProperty 在接口中 Executorkey - of the session propertyvalue - of the session propertySqlExecutionException - if any error happen.public org.apache.flink.table.operations.Operation parseStatement(String sessionId, String statement) throws SqlExecutionException
ExecutorOperation.parseStatement 在接口中 ExecutorSqlExecutionExceptionpublic List<String> completeStatement(String sessionId, String statement, int position)
ExecutorcompleteStatement 在接口中 Executorpublic org.apache.flink.table.api.TableResult executeOperation(String sessionId, org.apache.flink.table.operations.Operation operation) throws SqlExecutionException
ExecutorTableResult as execution result.executeOperation 在接口中 ExecutorSqlExecutionExceptionpublic org.apache.flink.table.api.TableResult executeModifyOperations(String sessionId, List<org.apache.flink.table.operations.ModifyOperation> operations) throws SqlExecutionException
ExecutorTableResult as execution result.executeModifyOperations 在接口中 ExecutorSqlExecutionExceptionpublic ResultDescriptor executeQuery(String sessionId, org.apache.flink.table.operations.QueryOperation query) throws SqlExecutionException
ExecutorexecuteQuery 在接口中 ExecutorSqlExecutionExceptionpublic TypedResult<List<org.apache.flink.types.Row>> retrieveResultChanges(String sessionId, String resultId) throws SqlExecutionException
ExecutorretrieveResultChanges 在接口中 ExecutorSqlExecutionExceptionpublic TypedResult<Integer> snapshotResult(String sessionId, String resultId, int pageSize) throws SqlExecutionException
ExecutorsnapshotResult 在接口中 ExecutorSqlExecutionExceptionpublic List<org.apache.flink.types.Row> retrieveResultPage(String resultId, int page) throws SqlExecutionException
ExecutorretrieveResultPage 在接口中 ExecutorSqlExecutionExceptionpublic void cancelQuery(String sessionId, String resultId) throws SqlExecutionException
ExecutorcancelQuery 在接口中 ExecutorSqlExecutionExceptionpublic void addJar(String sessionId, String jarUrl)
Executorpublic void removeJar(String sessionId, String jarUrl)
ExecutorCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.