@PublicEvolving public interface SqlGatewayService
Modifier and Type | Method and Description |
---|---|
void |
cancelOperation(SessionHandle sessionHandle,
OperationHandle operationHandle)
Cancel the operation when it is not in terminal status.
|
void |
closeOperation(SessionHandle sessionHandle,
OperationHandle operationHandle)
Close the operation and release all used resource by the operation.
|
void |
closeSession(SessionHandle sessionHandle)
Close the
Session . |
List<String> |
completeStatement(SessionHandle sessionHandle,
String statement,
int position)
Returns a list of completion hints for the given statement at the given position.
|
void |
configureSession(SessionHandle sessionHandle,
String statement,
long executionTimeoutMs)
Using the statement to initialize the Session.
|
OperationHandle |
executeStatement(SessionHandle sessionHandle,
String statement,
long executionTimeoutMs,
Configuration executionConfig)
Execute the submitted statement.
|
ResultSet |
fetchResults(SessionHandle sessionHandle,
OperationHandle operationHandle,
FetchOrientation orientation,
int maxRows)
Fetch the results from the operation.
|
ResultSet |
fetchResults(SessionHandle sessionHandle,
OperationHandle operationHandle,
long token,
int maxRows)
Fetch the results from the operation.
|
String |
getCurrentCatalog(SessionHandle sessionHandle)
Return current catalog name.
|
FunctionDefinition |
getFunctionDefinition(SessionHandle sessionHandle,
UnresolvedIdentifier functionIdentifier)
Get the specific definition of the function.
|
GatewayInfo |
getGatewayInfo()
Get the info about the
SqlGatewayService . |
OperationInfo |
getOperationInfo(SessionHandle sessionHandle,
OperationHandle operationHandle)
Get the
OperationInfo of the operation. |
ResolvedSchema |
getOperationResultSchema(SessionHandle sessionHandle,
OperationHandle operationHandle)
Get the result schema for the specified Operation.
|
Map<String,String> |
getSessionConfig(SessionHandle sessionHandle)
Get the current configuration of the
Session . |
EndpointVersion |
getSessionEndpointVersion(SessionHandle sessionHandle)
Get endpoint version that is negotiated in the openSession.
|
ResolvedCatalogBaseTable<?> |
getTable(SessionHandle sessionHandle,
ObjectIdentifier tableIdentifier)
Return table of the given fully qualified name.
|
Set<String> |
listCatalogs(SessionHandle sessionHandle)
Return all available catalogs in the current session.
|
Set<String> |
listDatabases(SessionHandle sessionHandle,
String catalogName)
Return all available schemas in the given catalog.
|
Set<FunctionInfo> |
listSystemFunctions(SessionHandle sessionHandle)
List all available system functions.
|
Set<TableInfo> |
listTables(SessionHandle sessionHandle,
String catalogName,
String databaseName,
Set<CatalogBaseTable.TableKind> tableKinds)
Return all available tables/views in the given catalog and database.
|
Set<FunctionInfo> |
listUserDefinedFunctions(SessionHandle sessionHandle,
String catalogName,
String databaseName)
List all user defined functions.
|
SessionHandle |
openSession(SessionEnvironment environment)
Open the
Session . |
OperationHandle |
submitOperation(SessionHandle sessionHandle,
Callable<ResultSet> executor)
Submit an operation and execute.
|
SessionHandle openSession(SessionEnvironment environment) throws SqlGatewayException
Session
.environment
- Environment to initialize the Session.SqlGatewayException
void closeSession(SessionHandle sessionHandle) throws SqlGatewayException
Session
.sessionHandle
- handle to identify the Session needs to be closed.SqlGatewayException
void configureSession(SessionHandle sessionHandle, String statement, long executionTimeoutMs) throws SqlGatewayException
It returns until the execution finishes.
sessionHandle
- handle to identify the session.statement
- the statement used to configure the session.executionTimeoutMs
- the execution timeout. Please use non-positive value to forbid the
timeout mechanism.SqlGatewayException
Map<String,String> getSessionConfig(SessionHandle sessionHandle) throws SqlGatewayException
Session
.sessionHandle
- handle to identify the session.SqlGatewayException
EndpointVersion getSessionEndpointVersion(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle
- handle to identify the session.SqlGatewayException
OperationHandle submitOperation(SessionHandle sessionHandle, Callable<ResultSet> executor) throws SqlGatewayException
SqlGatewayService
will take care of the
execution and assign the OperationHandle
for later to retrieve the results.sessionHandle
- handle to identify the session.executor
- the main logic to get the execution results.SqlGatewayException
void cancelOperation(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
It can't cancel an Operation if it is terminated.
sessionHandle
- handle to identify the session.operationHandle
- handle to identify the operation.JarURLConnectionSqlGatewayException
void closeOperation(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
sessionHandle
- handle to identify the session.operationHandle
- handle to identify the operation.SqlGatewayException
OperationInfo getOperationInfo(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
OperationInfo
of the operation.sessionHandle
- handle to identify the session.operationHandle
- handle to identify the operation.SqlGatewayException
ResolvedSchema getOperationResultSchema(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
Note: The result schema is available when the Operation is in the OperationStatus.FINISHED
.
sessionHandle
- handle to identify the session.operationHandle
- handle to identify the operation.SqlGatewayException
OperationHandle executeStatement(SessionHandle sessionHandle, String statement, long executionTimeoutMs, Configuration executionConfig) throws SqlGatewayException
sessionHandle
- handle to identify the session.statement
- the SQL to execute.executionTimeoutMs
- the execution timeout. Please use non-positive value to forbid the
timeout mechanism.executionConfig
- execution config for the statement.SqlGatewayException
ResultSet fetchResults(SessionHandle sessionHandle, OperationHandle operationHandle, long token, int maxRows) throws SqlGatewayException
sessionHandle
- handle to identify the session.operationHandle
- handle to identify the operation.token
- token to identify results.maxRows
- max number of rows to fetch.SqlGatewayException
ResultSet fetchResults(SessionHandle sessionHandle, OperationHandle operationHandle, FetchOrientation orientation, int maxRows) throws SqlGatewayException
sessionHandle
- handle to identify the session.operationHandle
- handle to identify the operation.orientation
- orientation to fetch the results.maxRows
- max number of rows to fetch.SqlGatewayException
String getCurrentCatalog(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle
- handle to identify the session.SqlGatewayException
Set<String> listCatalogs(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle
- handle to identify the session.SqlGatewayException
Set<String> listDatabases(SessionHandle sessionHandle, String catalogName) throws SqlGatewayException
sessionHandle
- handle to identify the session.catalogName
- name string of the given catalog.SqlGatewayException
Set<TableInfo> listTables(SessionHandle sessionHandle, String catalogName, String databaseName, Set<CatalogBaseTable.TableKind> tableKinds) throws SqlGatewayException
sessionHandle
- handle to identify the session.catalogName
- name of the given catalog.databaseName
- name of the given database.tableKinds
- used to specify the type of return values.SqlGatewayException
ResolvedCatalogBaseTable<?> getTable(SessionHandle sessionHandle, ObjectIdentifier tableIdentifier) throws SqlGatewayException
sessionHandle
- handle to identify the session.tableIdentifier
- fully qualified name of the table.SqlGatewayException
Set<FunctionInfo> listUserDefinedFunctions(SessionHandle sessionHandle, String catalogName, String databaseName) throws SqlGatewayException
sessionHandle
- handle to identify the session.catalogName
- name string of the given catalog.databaseName
- name string of the given database.SqlGatewayException
Set<FunctionInfo> listSystemFunctions(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle
- handle to identify the session.SqlGatewayException
FunctionDefinition getFunctionDefinition(SessionHandle sessionHandle, UnresolvedIdentifier functionIdentifier) throws SqlGatewayException
sessionHandle
- handle to identify the session.functionIdentifier
- identifier of the function.SqlGatewayException
GatewayInfo getGatewayInfo()
SqlGatewayService
.List<String> completeStatement(SessionHandle sessionHandle, String statement, int position) throws SqlGatewayException
sessionHandle
- handle to identify the session.statement
- sql statement to be completed.position
- position of where need completion hints.SqlGatewayException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.