Class QueriesExecutionContext

java.lang.Object
io.r2dbc.proxy.callback.QueriesExecutionContext

public class QueriesExecutionContext extends Object
The context of queries execution.

Holds the count of Result produced by Statement#execute and count that has consumed Result#[map|getRowsUpdated].

Author:
Thomas Deblock, Tadaya Tsuyukubo
  • Constructor Details

    • QueriesExecutionContext

      public QueriesExecutionContext(Clock clock)
  • Method Details

    • incrementProducedCount

      public void incrementProducedCount()
      Increment the count of produced Result from Statement#execute.
    • incrementConsumedCount

      public void incrementConsumedCount()
      Increment the count of consumptions from Result#[map|getRowsUpdated].
    • getElapsedDuration

      public Duration getElapsedDuration()
      Retrieve the elapsed time from the stopwatch that has started by startStopwatch().
      Returns:
      duration from start
    • startStopwatch

      public void startStopwatch()
      Start the stopwatch.
    • isQueryFinished

      public boolean isQueryFinished()
      Whether the executed queries have finished and results are consumed.

      The query is considered finished when the publisher from Statement#execute() have produced Results and those are consumed via Result#getRowsUpdated or Result#map.

      Returns:
      true if all Result are produced and consumed.
    • isAllConsumed

      public boolean isAllConsumed()
      Whether currently all produced Results are consumed.
      Returns:
      true if all produced Results are consumed.
    • markAllProduced

      public void markAllProduced()
      When QueryInvocationSubscriber produced all Result objects.