adoroszlai commented on code in PR #7860:
URL: https://github.com/apache/ozone/pull/7860#discussion_r1952369594


##########
hadoop-ozone/httpfsgateway/src/test/java/org/apache/ozone/fs/http/server/metrics/TestHttpFSMetrics.java:
##########
@@ -0,0 +1,141 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   The license header is not javadoc, please add it as normal comment.
   
   Better yet, please use the [proposed standard 
header](https://github.com/apache/ozone/blob/966145d5e869263d53c516d36a0c02e058fd24b9/hadoop-hdds/dev-support/checkstyle/license.header)
 for new files.



##########
hadoop-ozone/httpfsgateway/src/test/java/org/apache/ozone/fs/http/server/metrics/TestHttpFSMetrics.java:
##########
@@ -0,0 +1,141 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ozone.fs.http.server.metrics;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.ozone.fs.http.server.FSOperations;
+import org.apache.ozone.fs.http.server.HttpFSServerWebApp;
+import org.apache.ozone.lib.service.FileSystemAccess;
+import org.apache.ozone.lib.service.hadoop.FileSystemAccessService;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isA;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static 
org.apache.ozone.lib.service.hadoop.FileSystemAccessService.FILE_SYSTEM_SERVICE_CREATED;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;

Review Comment:
   Since this is a new file, let's follow the 
[proposed](https://github.com/apache/ozone/pull/7836) import order:
   
   - static imports at the top
   - empty line as separator
   - other imports in alphabetical order (so `java` should go before `org`), 
without separator line



##########
hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/metrics/HttpFSServerMetrics.java:
##########
@@ -149,4 +151,64 @@ public void incrOpsCheckAccess() {
   public void shutdown() {
     DefaultMetricsSystem.shutdown();
   }
+
+  @VisibleForTesting
+  public long getBytesWritten() {
+    return bytesWritten.value();
+  }

Review Comment:
   nit: Please do not add `@VisibleForTesting`.  These methods are just 
accessors, completely safe to be called from any code.



##########
hadoop-ozone/httpfsgateway/pom.xml:
##########
@@ -179,6 +177,18 @@
       <artifactId>slf4j-reload4j</artifactId>
       <scope>runtime</scope>
     </dependency>
+
+    <!-- Test dependencies -->
+    <dependency>
+      <groupId>org.apache.ozone</groupId>
+      <artifactId>hdds-hadoop-dependency-test</artifactId>
+      <scope>test</scope>
+    </dependency>

Review Comment:
   This is being removed in #7800.  Both PRs are fine in themselves, but build 
will fail after they are both merged.  To avoid that, please add individual 
dependencies for AssertJ, JUnit, Mockito as needed, and omit 
`hdds-hadoop-dependency-test`.



-- 
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]

Reply via email to