Package org.teiid.translator
Interface ExecutionContext
-
public interface ExecutionContextThe 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 voidaddWarning(Exception ex)Add an exception as a warning to this Execution.voiddataAvailable()Signal the engine that data is available and processing should be resumed.intgetBatchSize()Return the current connector batch size.CacheDirectivegetCacheDirective()Get theCacheDirectiveCommandContextgetCommandContext()Get the CommandContextSerializablegetCommandPayload()Get the command payload shortcut forgetCommandContext().getCommandPayload()StringgetConnectionId()Get the identifier for the connection through which the command is being executed.StringgetConnectionID()Deprecated.StringgetConnectorIdentifier()Get the identifier for the current connector running the commandStringgetExecutionCountIdentifier()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.SerializablegetExecutionPayload()Deprecated.StringgetGeneralHint()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.StringgetPartIdentifier()This specifies the node id for the atomic request in the relational plan of query.StringgetRequestId()Get the identifier for the command being executed.StringgetRequestID()Deprecated.seegetRequestId()RuntimeMetadatagetRuntimeMetadata()CacheDirective.ScopegetScope()Get the result cache scope for the current executionSessiongetSession()Get the current session.StringgetSourceHint()Get the collection of hints designated for this source as a space concatenated string.Collection<String>getSourceHints()Get the hints designated for this source.SubjectgetSubject()Get the user for the user running this query.intgetTransactionIsolation()Get the transaction isolation level set by the user request.StringgetVdbName()Get the name of the VDB this query is being run against.StringgetVdbVersion()Get the version of the VDB this query is being run against.booleanisTransactional()Flag indicates that the operation needs to be executed in a XA transaction.voidkeepExecutionAlive(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.voidlogCommand(Object... command)Log the source command to the command logGeneratedKeysreturnGeneratedKeys()If there are generatedKeyColumns, return theGeneratedKeysused to supply the values to the engine.voidsetScope(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 aTeiidSQLWarningfor 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.NONEwill typically result in the user query result being cached at theCacheDirective.Scope.SESSIONlevel.- 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 theGeneratedKeysused 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:
-
-