HDDS-2151. Ozone client logs the entire request payload at DEBUG level (#1477)
This commit is contained in:
parent
f260b5aa5b
commit
1ada99b0bd
|
@ -218,13 +218,36 @@ public final class XceiverClientRatis extends XceiverClientSpi {
|
||||||
.build();
|
.build();
|
||||||
boolean isReadOnlyRequest = HddsUtils.isReadOnly(finalPayload);
|
boolean isReadOnlyRequest = HddsUtils.isReadOnly(finalPayload);
|
||||||
ByteString byteString = finalPayload.toByteString();
|
ByteString byteString = finalPayload.toByteString();
|
||||||
LOG.debug("sendCommandAsync {} {}", isReadOnlyRequest, finalPayload);
|
if (LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("sendCommandAsync {} {}", isReadOnlyRequest,
|
||||||
|
sanitizeForDebug(finalPayload));
|
||||||
|
}
|
||||||
return isReadOnlyRequest ?
|
return isReadOnlyRequest ?
|
||||||
getClient().sendReadOnlyAsync(() -> byteString) :
|
getClient().sendReadOnlyAsync(() -> byteString) :
|
||||||
getClient().sendAsync(() -> byteString);
|
getClient().sendAsync(() -> byteString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ContainerCommandRequestProto sanitizeForDebug(
|
||||||
|
ContainerCommandRequestProto request) {
|
||||||
|
switch (request.getCmdType()) {
|
||||||
|
case PutSmallFile:
|
||||||
|
return request.toBuilder()
|
||||||
|
.setPutSmallFile(request.getPutSmallFile().toBuilder()
|
||||||
|
.clearData()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
case WriteChunk:
|
||||||
|
return request.toBuilder()
|
||||||
|
.setWriteChunk(request.getWriteChunk().toBuilder()
|
||||||
|
.clearData()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
default:
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// gets the minimum log index replicated to all servers
|
// gets the minimum log index replicated to all servers
|
||||||
@Override
|
@Override
|
||||||
public long getReplicatedMinCommitIndex() {
|
public long getReplicatedMinCommitIndex() {
|
||||||
|
|
Loading…
Reference in New Issue