use of org.apache.bookkeeper.proto.BookkeeperProtocol.BKPacketHeader in project bookkeeper by apache.
the class PerChannelBookieClient method readV3Response.
private void readV3Response(final Response response) {
final BKPacketHeader header = response.getHeader();
final CompletionValue completionValue = completionObjects.get(newCompletionKey(header.getTxnId(), header.getOperation()));
if (null == completionValue) {
// Unexpected response, so log it. The txnId should have been present.
if (LOG.isDebugEnabled()) {
LOG.debug("Unexpected response received from bookie : " + addr + " for type : " + header.getOperation() + " and txnId : " + header.getTxnId());
}
} else {
long orderingKey = completionValue.ledgerId;
executor.executeOrdered(orderingKey, new SafeRunnable() {
@Override
public void safeRun() {
completionValue.handleV3Response(response);
}
@Override
public String toString() {
return String.format("HandleResponse(Txn=%d, Type=%s, Entry=(%d, %d))", header.getTxnId(), header.getOperation(), completionValue.ledgerId, completionValue.entryId);
}
});
}
completionObjects.remove(newCompletionKey(header.getTxnId(), header.getOperation()));
}
Aggregations