jojochuang commented on code in PR #6610:
URL: https://github.com/apache/ozone/pull/6610#discussion_r1585159285
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/KeyValueStreamDataChannel.java:
##########
@@ -212,7 +219,9 @@ void assertOpen() throws IOException {
public void close() throws IOException {
if (closed.compareAndSet(false, true)) {
try {
- putBlockRequest.set(closeBuffers(buffers, super::writeFileChannel));
+ final long l = Time.monotonicNow();
Review Comment:
We should use more meaningful variable names, like start.
```suggestion
final long start = Time.monotonicNow();
```
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/KeyValueStreamDataChannel.java:
##########
@@ -168,10 +168,17 @@ public int write(ReferenceCountedObject<ByteBuffer>
referenceCounted)
assertOpen();
final long l = Time.monotonicNow();
- int len = writeBuffers(referenceCounted, buffers, super::writeFileChannel);
- getMetrics()
- .incContainerOpsLatencies(getType(), Time.monotonicNow() - l);
- return len;
+ return writeBuffers(referenceCounted, buffers,
+ writeFileChannelWithMetrics(l));
+ }
+
+ private WriteMethod writeFileChannelWithMetrics(long l) {
Review Comment:
```suggestion
private WriteMethod writeFileChannelWithMetrics(long start) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]