amahussein commented on a change in pull request #2521:
URL: https://github.com/apache/hadoop/pull/2521#discussion_r540372548
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestHttpFSServer.java
##########
@@ -120,6 +122,25 @@
*/
public class TestHttpFSServer extends HFSTestCase {
+ /**
+ * define metric getters for unit tests.
+ */
+ private static Callable<Long> defaultEntryMetricGetter = () -> 0L;
+ private static Callable<Long> defaultExitMetricGetter = () -> 1L;
+ private static HashMap<String, Callable<Long>> metricsGetter =
+ new HashMap<String, Callable<Long>>() {
+ {
+ put("LISTSTATUS",
+ () -> HttpFSServerWebApp.get().getMetrics().getOpsListing());
+ put("MKDIRS",
+ () -> HttpFSServerWebApp.get().getMetrics().getOpsMkdir());
+ put("GETFILESTATUS",
+ () -> HttpFSServerWebApp.get().getMetrics().getOpsStat());
+ }
+ };
+
Review comment:
Thanks @jbrennan333 .
This makes sense.
I fixed `testMkdirs`, `createDirWithHttp`, `testGlobFilter`, and
`testHdfsAccess`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]