| 构造器和说明 |
|---|
LocalExecutor(Environment defaultEnvironment,
List<URL> dependencies,
org.apache.flink.configuration.Configuration flinkConfig,
org.apache.flink.client.cli.CustomCommandLine commandLine,
org.apache.flink.client.deployment.ClusterClientServiceLoader clusterClientServiceLoader)
Constructor for testing purposes.
|
LocalExecutor(URL defaultEnv,
List<URL> jars,
List<URL> libraries)
Creates a local executor for submitting table programs and retrieving results.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
void |
createTable(String sessionId,
String ddl)
Create a table with a DDL statement.
|
void |
dropTable(String sessionId,
String ddl)
Drop a table with a DDL statement.
|
ResultDescriptor |
executeQuery(String sessionId,
String query)
Submits a Flink SQL query job (detached) and returns the result descriptor.
|
org.apache.flink.table.api.TableResult |
executeSql(String sessionId,
String statement)
Executes a SQL statement.
|
ProgramTargetDescriptor |
executeUpdate(String sessionId,
String statement)
Submits a Flink SQL update statement such as INSERT INTO.
|
protected ExecutionContext<?> |
getExecutionContext(String sessionId)
Get the existed
ExecutionContext from contextMap, or thrown exception if does not exist. |
Map<String,String> |
getSessionProperties(String sessionId)
Lists all session properties that are defined by the executor and the session.
|
org.apache.flink.table.delegation.Parser |
getSqlParser(String sessionId)
Returns a sql parser instance.
|
org.apache.flink.table.api.TableSchema |
getTableSchema(String sessionId,
String name)
Returns the schema of a table.
|
List<String> |
listCatalogs(String sessionId)
Lists all registered catalogs.
|
List<String> |
listDatabases(String sessionId)
Lists all databases in the current catalog.
|
List<String> |
listFunctions(String sessionId)
Lists all functions known to the executor.
|
List<String> |
listModules(String sessionId)
Lists all modules known to the executor in their loaded order.
|
List<String> |
listTables(String sessionId)
Lists all tables in the current database of the current catalog.
|
List<String> |
listUserDefinedFunctions(String sessionId)
Lists all user-defined functions known to the executor.
|
String |
openSession(SessionContext sessionContext)
Open a new session by using the given
SessionContext. |
void |
resetSessionProperties(String sessionId)
Reset all the properties for the given session identifier.
|
TypedResult<List<org.apache.flink.api.java.tuple.Tuple2<Boolean,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.
|
void |
useCatalog(String sessionId,
String catalogName)
Sets a catalog with given name as the current catalog.
|
void |
useDatabase(String sessionId,
String databaseName)
Sets a database with given name as the current database of the current catalog.
|
public LocalExecutor(URL defaultEnv, List<URL> jars, List<URL> libraries)
public LocalExecutor(Environment defaultEnvironment, List<URL> dependencies, org.apache.flink.configuration.Configuration flinkConfig, org.apache.flink.client.cli.CustomCommandLine commandLine, org.apache.flink.client.deployment.ClusterClientServiceLoader clusterClientServiceLoader)
public void start()
Executorpublic String openSession(SessionContext sessionContext) throws SqlExecutionException
ExecutorSessionContext.openSession 在接口中 ExecutorsessionContext - context to create new session.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> getSessionProperties(String sessionId) throws SqlExecutionException
ExecutorgetSessionProperties 在接口中 ExecutorSqlExecutionExceptionpublic void resetSessionProperties(String sessionId) throws SqlExecutionException
ExecutorresetSessionProperties 在接口中 ExecutorsessionId - to identifier the sessionSqlExecutionException - 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 List<String> listCatalogs(String sessionId) throws SqlExecutionException
ExecutorlistCatalogs 在接口中 ExecutorSqlExecutionExceptionpublic List<String> listDatabases(String sessionId) throws SqlExecutionException
ExecutorlistDatabases 在接口中 ExecutorSqlExecutionExceptionpublic void createTable(String sessionId, String ddl) throws SqlExecutionException
ExecutorcreateTable 在接口中 ExecutorSqlExecutionExceptionpublic void dropTable(String sessionId, String ddl) throws SqlExecutionException
ExecutordropTable 在接口中 ExecutorSqlExecutionExceptionpublic List<String> listTables(String sessionId) throws SqlExecutionException
ExecutorlistTables 在接口中 ExecutorSqlExecutionExceptionpublic List<String> listUserDefinedFunctions(String sessionId) throws SqlExecutionException
ExecutorlistUserDefinedFunctions 在接口中 ExecutorSqlExecutionExceptionpublic org.apache.flink.table.api.TableResult executeSql(String sessionId, String statement) throws SqlExecutionException
ExecutorexecuteSql 在接口中 ExecutorSqlExecutionExceptionpublic List<String> listFunctions(String sessionId) throws SqlExecutionException
ExecutorlistFunctions 在接口中 ExecutorSqlExecutionExceptionpublic List<String> listModules(String sessionId) throws SqlExecutionException
ExecutorlistModules 在接口中 ExecutorSqlExecutionExceptionpublic void useCatalog(String sessionId, String catalogName) throws SqlExecutionException
ExecutoruseCatalog 在接口中 ExecutorSqlExecutionExceptionpublic void useDatabase(String sessionId, String databaseName) throws SqlExecutionException
ExecutoruseDatabase 在接口中 ExecutorSqlExecutionExceptionpublic org.apache.flink.table.api.TableSchema getTableSchema(String sessionId, String name) throws SqlExecutionException
ExecutorgetTableSchema 在接口中 ExecutorSqlExecutionExceptionpublic org.apache.flink.table.delegation.Parser getSqlParser(String sessionId)
ExecutorgetSqlParser 在接口中 Executorpublic List<String> completeStatement(String sessionId, String statement, int position)
ExecutorcompleteStatement 在接口中 Executorpublic ResultDescriptor executeQuery(String sessionId, String query) throws SqlExecutionException
ExecutorexecuteQuery 在接口中 ExecutorSqlExecutionExceptionpublic TypedResult<List<org.apache.flink.api.java.tuple.Tuple2<Boolean,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 ProgramTargetDescriptor executeUpdate(String sessionId, String statement) throws SqlExecutionException
ExecutorexecuteUpdate 在接口中 ExecutorsessionId - to identify the user session.statement - SQL update statement (currently only INSERT INTO is supported)SqlExecutionExceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.