Class ClientTransactionCompletion

java.lang.Object
org.apache.nifi.remote.ClientTransactionCompletion
All Implemented Interfaces:
TransactionCompletion

public class ClientTransactionCompletion extends Object implements TransactionCompletion
  • Field Details

    • backoff

      private final boolean backoff
    • dataPacketsTransferred

      private final int dataPacketsTransferred
    • bytesTransferred

      private final long bytesTransferred
    • durationNanos

      private final long durationNanos
  • Constructor Details

    • ClientTransactionCompletion

      public ClientTransactionCompletion(boolean backoff, int dataPacketsTransferred, long bytesTransferred, long durationNanos)
  • Method Details

    • isBackoff

      public boolean isBackoff()
      Description copied from interface: TransactionCompletion
      When a sending to a NiFi instance, the server may accept the content sent to it but indicate that its queues are full and that the client should backoff sending data for a bit.
      Specified by:
      isBackoff in interface TransactionCompletion
      Returns:
      true if the server did in fact request that, false otherwise
    • getDataPacketsTransferred

      public int getDataPacketsTransferred()
      Specified by:
      getDataPacketsTransferred in interface TransactionCompletion
      Returns:
      the number of Data Packets that were sent to or received from the remote NiFi instance in the Transaction
    • getBytesTransferred

      public long getBytesTransferred()
      Specified by:
      getBytesTransferred in interface TransactionCompletion
      Returns:
      the number of bytes of DataPacket content that were sent to or received from the remote NiFI instance in the Transaction. Note that this is different than the number of bytes actually transferred between the client and server, as it does not take into account the attributes or protocol-specific information that is exchanged but rather takes into account only the data in the InputStream of the DataPacket
    • getDuration

      public long getDuration(TimeUnit timeUnit)
      Specified by:
      getDuration in interface TransactionCompletion
      Parameters:
      timeUnit - unit of time for which to report the duration
      Returns:
      the amount of time that the Transaction took, from the time that the Transaction was created to the time that the Transaction was completed