Package org.apache.nifi.remote
Class ClientTransactionCompletion
java.lang.Object
org.apache.nifi.remote.ClientTransactionCompletion
- All Implemented Interfaces:
TransactionCompletion
-
Field Summary
Modifier and TypeFieldDescriptionprivate final boolean
private final long
private final int
private final long
-
Constructor Summary
ConstructorDescriptionClientTransactionCompletion
(boolean backoff, int dataPacketsTransferred, long bytesTransferred, long durationNanos) -
Method Summary
Modifier and TypeMethodDescriptionlong
int
long
getDuration
(TimeUnit timeUnit) boolean
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.
-
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 interfaceTransactionCompletion
- Returns:
true
if the server did in fact request that,false
otherwise
-
getDataPacketsTransferred
public int getDataPacketsTransferred()- Specified by:
getDataPacketsTransferred
in interfaceTransactionCompletion
- 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 interfaceTransactionCompletion
- 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 theDataPacket
-
getDuration
- Specified by:
getDuration
in interfaceTransactionCompletion
- 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
-