Interface TransactionAbortStrategyImpl.Context

    • Method Detail

      • getOpenTransactionsForTopics

        Collection<String> getOpenTransactionsForTopics()
        Returns the list of all open transactions for the topics retrieved through introspection.
      • getCurrentSubtaskId

        int getCurrentSubtaskId()
      • getCurrentParallelism

        int getCurrentParallelism()
      • ownsTransactionalId

        boolean ownsTransactionalId​(String transactionalId)
        Subtask must abort transactions that they own and must not abort any transaction that they don't own. Ownership is defined as follows:
        • Writer states contains the old subtask id and the max parallelism when it was snapshotted.
        • On recovery, the state is reassigned somewhere. The new assignee takes the ownership.
        • If there was a downscale, one subtask may own several old subtask ids.
        • If there was an upscale, the ids usually remain stable but that isn't necessary for the abort to work.
        • Any number of intermediate attempts between the recovered checkpoint and the current attempt may produce transactions > then the current parallelism. In that case, subtask ids are distributed in a round robin fashion using modulo.
      • getPrefixesToAbort

        Set<String> getPrefixesToAbort()
      • getPrecommittedTransactionalIds

        Set<String> getPrecommittedTransactionalIds()
        Returns a list of transactional ids that shouldn't be aborted because they are part of the committer state.
      • getStartCheckpointId

        long getStartCheckpointId()