architjainjain commented on code in PR #6501:
URL: https://github.com/apache/hive/pull/6501#discussion_r3719076572
##########
ql/src/test/org/apache/hadoop/hive/ql/exec/tez/TestTezSessionState.java:
##########
@@ -133,4 +137,122 @@ void openInternalUnsafe(boolean isAsync,
SessionState.LogHelper console) {
sessionStateForTest.open(resources);
}
+
+ /**
+ * Tests that YarnClient is NOT initialized when queue metrics are disabled
(default: interval=0).
+ * This ensures zero overhead when the feature is disabled.
+ */
+ @Test
+ public void testYarnClientNotInitializedWhenMetricsDisabled() {
+ SessionState ss = createSessionState();
+ HiveConf hiveConf = ss.getConf();
+
+ // Default config: queue metrics disabled (interval = 0)
+ Assert.assertEquals("Default interval should be 0 (disabled)",
+ 0, HiveConf.getTimeVar(hiveConf,
HiveConf.ConfVars.HIVE_TEZ_QUEUE_METRICS_REFRESH_INTERVAL,
TimeUnit.MILLISECONDS));
+
+ TezSessionState sessionState = new TezSessionState(ss.getSessionId(),
hiveConf);
+
+ // Mock a TezClient and set it
+ TezClient mockTezClient = Mockito.mock(TezClient.class);
+ sessionState.setTezClient(mockTezClient);
Review Comment:
Done, all the places are done.
--
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]