Package org.teiid.translator
Interface ExecutionContext
-
- All Known Implementing Classes:
ExecutionContextImpl
public interface ExecutionContext
The security context provides information about the user context in which this query is being run. As of 4.2, the SecurityContext is a sub-interface of ExecutionContext such that both interfaces contain all of the methods from the prior independent interfaces. Thus, these interfaces can now be used interchangeably.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addWarning(Exception ex)
Add an exception as a warning to this Execution.void
dataAvailable()
Signal the engine that data is available and processing should be resumed.int
getBatchSize()
Return the current connector batch size.CacheDirective
getCacheDirective()
Get theCacheDirective
CommandContext
getCommandContext()
Get the CommandContextSerializable
getCommandPayload()
Get the command payload shortcut forgetCommandContext()
.getCommandPayload()String
getConnectionId()
Get the identifier for the connection through which the command is being executed.String
getConnectionID()
Deprecated.String
getConnectorIdentifier()
Get the identifier for the current connector running the commandString
getExecutionCountIdentifier()
Execution count defines an id; where every access to the connector from the server in a given command execution boundary is uniquely defined; Like for example in the case of "batched execution" of commands, each execution of command gets new identifier.Serializable
getExecutionPayload()
Deprecated.String
getGeneralHint()
Get the collection of general hints as a space concatenated string.Collection<String>
getGeneralHints()
Get the general hints.List<Column>
getGeneratedKeyColumns()
Get the expected generated key columns for this execution, or null if there are none.String
getPartIdentifier()
This specifies the node id for the atomic request in the relational plan of query.String
getRequestId()
Get the identifier for the command being executed.String
getRequestID()
Deprecated.seegetRequestId()
RuntimeMetadata
getRuntimeMetadata()
CacheDirective.Scope
getScope()
Get the result cache scope for the current executionSession
getSession()
Get the current session.String
getSourceHint()
Get the collection of hints designated for this source as a space concatenated string.Collection<String>
getSourceHints()
Get the hints designated for this source.Subject
getSubject()
Get the user for the user running this query.int
getTransactionIsolation()
Get the transaction isolation level set by the user request.String
getVdbName()
Get the name of the VDB this query is being run against.String
getVdbVersion()
Get the version of the VDB this query is being run against.boolean
isTransactional()
Flag indicates that the operation needs to be executed in a XA transaction.void
keepExecutionAlive(boolean alive)
When the execution is turned on with "alive=true", the execution object will not be implicitly closed at the end of the last batch.void
logCommand(Object... command)
Log the source command to the command logGeneratedKeys
returnGeneratedKeys()
If there are generatedKeyColumns, return theGeneratedKeys
used to supply the values to the engine.void
setScope(CacheDirective.Scope scope)
Set the result cache scope for the current execution.
-
-
-
Method Detail
-
getConnectorIdentifier
String getConnectorIdentifier()
Get the identifier for the current connector running the command- Returns:
- Connector identifier; never null
-
getRequestId
String getRequestId()
Get the identifier for the command being executed. This can be correlated back to identifiers exposed in other parts of the system. shortcut forgetCommandContext()
.getRequestId()- Returns:
- command identifier
-
getRequestID
@Deprecated String getRequestID()
Deprecated.seegetRequestId()
- Returns:
-
getPartIdentifier
String getPartIdentifier()
This specifies the node id for the atomic request in the relational plan of query.
-
getExecutionCountIdentifier
String getExecutionCountIdentifier()
Execution count defines an id; where every access to the connector from the server in a given command execution boundary is uniquely defined; Like for example in the case of "batched execution" of commands, each execution of command gets new identifier.
-
getVdbName
String getVdbName()
Get the name of the VDB this query is being run against. shortcut forgetCommandContext()
.getVdbName()- Returns:
- VDB name, never null
-
getVdbVersion
String getVdbVersion()
Get the version of the VDB this query is being run against. shortcut forgetCommandContext()
.getVdbVersion()- Returns:
- VDB version
-
getSubject
Subject getSubject()
Get the user for the user running this query.- Returns:
- User, never null
-
getCommandPayload
Serializable getCommandPayload()
Get the command payload shortcut forgetCommandContext()
.getCommandPayload()- Returns:
- the payload or null if one was not set by the client
-
getExecutionPayload
@Deprecated Serializable getExecutionPayload()
Deprecated.- Returns:
-
getGeneralHint
String getGeneralHint()
Get the collection of general hints as a space concatenated string.- Returns:
- the general hint or null if none was specified
-
getSourceHint
String getSourceHint()
Get the collection of hints designated for this source as a space concatenated string.- Returns:
- the source hint or null if none was specified
-
getGeneralHints
Collection<String> getGeneralHints()
Get the general hints.- Returns:
- the general hint or null if none was specified
-
getSourceHints
Collection<String> getSourceHints()
Get the hints designated for this source.- Returns:
- the source hint or null if none was specified
-
getConnectionId
String getConnectionId()
Get the identifier for the connection through which the command is being executed. This represents the original user connection to the Teiid system shortcut forgetCommandContext()
.getConnectionId()- Returns:
- Connection identifier
-
getConnectionID
@Deprecated String getConnectionID()
Deprecated.- Returns:
-
keepExecutionAlive
void keepExecutionAlive(boolean alive)
When the execution is turned on with "alive=true", the execution object will not be implicitly closed at the end of the last batch. It will only be closed at end of the user query.The engine will already detect situations when the connection should stay open for LOB (clob/blob/xml) streaming.
Keeping the execution alive unnecessarily may cause issues with connection usage as the connection instance may not be usable by other queries.
- Parameters:
alive
-
-
getBatchSize
int getBatchSize()
Return the current connector batch size. This may be used as a hint to the underlying source query.- Returns:
- the Connector batch size.
-
addWarning
void addWarning(Exception ex)
Add an exception as a warning to this Execution. The exception will be wrapped by aTeiidSQLWarning
for the client. The warnings can be consumed through theStatement.getWarnings()
method.- Parameters:
ex
-
-
isTransactional
boolean isTransactional()
Flag indicates that the operation needs to be executed in a XA transaction.- Returns:
-
getSession
Session getSession()
Get the current session. shortcut forgetCommandContext()
.getSession()- Returns:
-
dataAvailable
void dataAvailable()
Signal the engine that data is available and processing should be resumed.
-
getCommandContext
CommandContext getCommandContext()
Get the CommandContext- Returns:
-
getCacheDirective
CacheDirective getCacheDirective()
Get theCacheDirective
- Returns:
-
getRuntimeMetadata
RuntimeMetadata getRuntimeMetadata()
- Returns:
- the
RuntimeMetadata
-
logCommand
void logCommand(Object... command)
Log the source command to the command log- Parameters:
command
-
-
getScope
CacheDirective.Scope getScope()
Get the result cache scope for the current execution- Returns:
-
setScope
void setScope(CacheDirective.Scope scope)
Set the result cache scope for the current execution.
Setting toCacheDirective.Scope.NONE
will typically result in the user query result being cached at theCacheDirective.Scope.SESSION
level.- Parameters:
scope
-
-
getGeneratedKeyColumns
List<Column> getGeneratedKeyColumns()
Get the expected generated key columns for this execution, or null if there are none.- Returns:
-
returnGeneratedKeys
GeneratedKeys returnGeneratedKeys()
If there are generatedKeyColumns, return theGeneratedKeys
used to supply the values to the engine.- Returns:
-
getTransactionIsolation
int getTransactionIsolation()
Get the transaction isolation level set by the user request. See the constants onConnection
- Returns:
-
-