Jackie-Jiang commented on code in PR #20312:
URL: https://github.com/apache/pinot/pull/20312#discussion_r4623230031


##########
pinot-minion/src/main/java/org/apache/pinot/minion/MinionConf.java:
##########
@@ -70,6 +70,13 @@ public String getInstanceId() {
     return instanceId != null ? instanceId : 
getProperty(CommonConstants.Helix.Instance.INSTANCE_ID_KEY);
   }
 
+  @SuppressWarnings("deprecation") // Falls back to the legacy un-prefixed key 
for backward compatibility
+  public String getDataDir() {
+    String dataDir = 
getProperty(CommonConstants.Minion.CONFIG_OF_MINION_DATA_DIR);
+    return dataDir != null ? dataDir : 
getProperty(CommonConstants.Helix.Instance.DATA_DIR_KEY,
+        CommonConstants.Minion.DEFAULT_INSTANCE_DATA_DIR);

Review Comment:
   Nit: since this ternary spans multiple lines, put the `? dataDir` and `: 
getProperty(...)` branches on separate lines.



##########
pinot-minion/src/test/java/org/apache/pinot/minion/MinionConfTest.java:
##########
@@ -73,6 +73,19 @@ public void testDeprecatedConfigs()
         "org.apache.pinot.core.crypt.NoOpPinotCrypter");
   }
 
+  @Test
+  @SuppressWarnings("deprecation") // Tests the legacy un-prefixed key fallback
+  public void testDataDirPrecedence() {
+    MinionConf conf = new MinionConf();
+    Assert.assertEquals(conf.getDataDir(), 
CommonConstants.Minion.DEFAULT_INSTANCE_DATA_DIR);

Review Comment:
   Nit: please statically import `assertEquals` for the three new assertions, 
per the repository's test conventions.



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