steveloughran commented on code in PR #4705:
URL: https://github.com/apache/hadoop/pull/4705#discussion_r938647600
##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AIOStatisticsContext.java:
##########
@@ -153,6 +153,7 @@ public void testS3AInputStreamIOStatisticsContext()
* @return thread context
*/
private static IOStatisticsContext getAndResetThreadStatisticsContext() {
+ assertTrue(IOStatisticsContext.getIOStatisticsThreadLevelEnabled());
Review Comment:
needs an error message if not true
##########
hadoop-tools/hadoop-aws/src/test/resources/core-site.xml:
##########
@@ -178,6 +178,12 @@
<value>true</value>
</property>
+ <!-- Enable IOStatisticsContext support for Thread level. -->
Review Comment:
mixed feelings here. hive team and others who serialize configs don't like
us overfilling the xml file with defaults
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/IOStatisticsContext.java:
##########
@@ -80,4 +80,14 @@ static void setThreadIOStatisticsContext(
IOStatisticsContextIntegration.setThreadIOStatisticsContext(
statisticsContext);
}
+
+ /**
+ * Static probe to check if the thread-level IO statistics enabled.
+ *
+ * @return if the thread-level IO statistics enabled.
+ */
+ static boolean getIOStatisticsThreadLevelEnabled() {
Review Comment:
not sure this is the right predicate. i think a simple `enabled()` would be
informative enough, as what is being enabled is obvious
--
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]