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 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 for getCommandContext().getRequestId()
        Returns:
        command identifier
      • 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 for getCommandContext().getVdbName()
        Returns:
        VDB name, never null
      • getVdbVersion

        String getVdbVersion()
        Get the version of the VDB this query is being run against. shortcut for getCommandContext().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 for getCommandContext().getCommandPayload()
        Returns:
        the payload or null if one was not set by the client
      • 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 for getCommandContext().getConnectionId()
        Returns:
        Connection identifier
      • 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 a TeiidSQLWarning for the client. The warnings can be consumed through the Statement.getWarnings() method.
        Parameters:
        ex -
      • isTransactional

        boolean isTransactional()
        Flag indicates that the operation needs to be executed in a XA transaction.
        Returns:
      • dataAvailable

        void dataAvailable()
        Signal the engine that data is available and processing should be resumed.
      • getCommandContext

        CommandContext getCommandContext()
        Get the CommandContext
        Returns:
      • 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:
      • 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 the GeneratedKeys 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 on Connection
        Returns: