mcvsubbu commented on a change in pull request #3633: Use
ZkCacheBaseDataAccessor to cache instance configs in PinotHelixResourceManager
URL: https://github.com/apache/incubator-pinot/pull/3633#discussion_r245392098
##########
File path:
pinot-controller/src/test/java/com/linkedin/pinot/controller/helix/core/PinotHelixResourceManagerTest.java
##########
@@ -76,6 +86,60 @@ public void testGetInstanceEndpoints() throws
InvalidConfigException {
for (int i = 0; i < NUM_INSTANCES; i++) {
Assert.assertTrue(endpoints.inverse().containsKey("localhost:" +
String.valueOf(BASE_SERVER_ADMIN_PORT + i)));
}
+ ZkCacheBaseDataAccessor<ZNRecord> zkCacheBaseDataAccessor =
_helixResourceManager.getCacheInstanceConfigsDataAccessor();
+ Assert.assertNotNull(zkCacheBaseDataAccessor);
+ List<ZNRecord> znRecords = zkCacheBaseDataAccessor.getChildren("/", null,
AccessOption.PERSISTENT);
+ for (ZNRecord znRecord : znRecords) {
+ if (znRecord.getId().startsWith("Server")) {
+
Assert.assertNotNull(znRecord.getSimpleField(CommonConstants.Helix.Instance.ADMIN_PORT_KEY));
+ String adminPort =
znRecord.getSimpleField(CommonConstants.Helix.Instance.ADMIN_PORT_KEY);
+ InstanceConfig instanceConfig = new InstanceConfig(znRecord);
+ String[] hostnameSplit = instanceConfig.getHostName().split("_");
+ String adminEndpoint = hostnameSplit[1] + ":" + adminPort;
+ Assert.assertTrue(endpoints.inverse().containsKey(adminEndpoint));
+ }
+ }
+ }
+
+ @Test
+ public void testGetInstanceConfigsFromZkCacheBaseDataAccessor() throws
InterruptedException {
Review comment:
change name of test
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]