Class ExecutorImpl
- java.lang.Object
-
- org.apache.flink.table.client.gateway.ExecutorImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Executor
public class ExecutorImpl extends Object implements Executor
Executor to connect toSqlGatewayand execute statements.
-
-
Constructor Summary
Constructors Constructor Description ExecutorImpl(org.apache.flink.table.gateway.service.context.DefaultContext defaultContext, InetSocketAddress gatewayAddress, String sessionId)ExecutorImpl(org.apache.flink.table.gateway.service.context.DefaultContext defaultContext, InetSocketAddress gatewayAddress, String sessionId, org.apache.flink.table.gateway.rest.util.RowFormat rowFormat)ExecutorImpl(org.apache.flink.table.gateway.service.context.DefaultContext defaultContext, URL gatewayUrl, String sessionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close theExecutorand process all exceptions.List<String>completeStatement(String statement, int position)Returns a list of completion hints for the given statement at the given position.voidconfigureSession(String statement)Configures session with statement.StringdeployScript(String script, URI uri)Deploy script in application mode.StatementResultexecuteStatement(String statement)Execute statement.org.apache.flink.configuration.ReadableConfiggetSessionConfig()Get the configuration of the session.Map<String,String>getSessionConfigMap()Get the map configuration of the session.org.apache.flink.table.gateway.api.session.SessionHandlegetSessionHandle()
-
-
-
Constructor Detail
-
ExecutorImpl
public ExecutorImpl(org.apache.flink.table.gateway.service.context.DefaultContext defaultContext, InetSocketAddress gatewayAddress, String sessionId)
-
ExecutorImpl
public ExecutorImpl(org.apache.flink.table.gateway.service.context.DefaultContext defaultContext, InetSocketAddress gatewayAddress, String sessionId, org.apache.flink.table.gateway.rest.util.RowFormat rowFormat)
-
-
Method Detail
-
configureSession
public void configureSession(String statement)
Description copied from interface:ExecutorConfigures session with statement.- Specified by:
configureSessionin interfaceExecutor- Parameters:
statement- to initialize the session
-
getSessionConfig
public org.apache.flink.configuration.ReadableConfig getSessionConfig()
Description copied from interface:ExecutorGet the configuration of the session.- Specified by:
getSessionConfigin interfaceExecutor- Returns:
- the session configuration.
-
getSessionConfigMap
public Map<String,String> getSessionConfigMap()
Description copied from interface:ExecutorGet the map configuration of the session.- Specified by:
getSessionConfigMapin interfaceExecutor- Returns:
- the map session configuration.
-
executeStatement
public StatementResult executeStatement(String statement)
Description copied from interface:ExecutorExecute statement.- Specified by:
executeStatementin interfaceExecutor- Parameters:
statement- to execute- Returns:
- Iterable results of the statement
-
completeStatement
public List<String> completeStatement(String statement, int position)
Description copied from interface:ExecutorReturns a list of completion hints for the given statement at the given position.- Specified by:
completeStatementin interfaceExecutor- Parameters:
statement- Partial or slightly incorrect SQL statementposition- cursor position- Returns:
- completion hints that fit at the current cursor position
-
deployScript
public String deployScript(@Nullable String script, @Nullable URI uri)
Description copied from interface:ExecutorDeploy script in application mode.- Specified by:
deployScriptin interfaceExecutor- Parameters:
script- content to run in application modeuri- uri to the script- Returns:
- the cluster id
-
close
public void close()
Description copied from interface:ExecutorClose theExecutorand process all exceptions.
-
getSessionHandle
@VisibleForTesting public org.apache.flink.table.gateway.api.session.SessionHandle getSessionHandle()
-
-