Source:
private void uploadClusterConfigsAndVerify() throws Exception { List<PartitionId> writablePartitions = testPartitionLayout.getPartitionLayout().getWritablePartitions(null); Set<String> writableInPartitionLayout = new HashSet<>(); writablePartitions.forEach(k -> writableInPartitionLayout.add(k.toPathString())); Utils.writeJsonObjectToFile(zkJson, zkLayoutPath); Utils.writeJsonObjectToFile(testHardwareLayout.getHardwareLayout().toJSONObject(), hardwareLayoutPath); Utils.writeJsonObjectToFile(testPartitionLayout.getPartitionLayout().toJSONObject(), partitionLayoutPath); HelixBootstrapUpgradeUtil.uploadClusterConfigs(hardwareLayoutPath, partitionLayoutPath, zkLayoutPath, CLUSTER_NAME_PREFIX, dcStr, DEFAULT_MAX_PARTITIONS_PER_RESOURCE, new HelixAdminFactory()); for (ZkInfo zkInfo : dcsToZkInfo.values()) { if (!activeDcSet.contains(zkInfo.getDcName())) { continue; } HelixPropertyStore<ZNRecord> propertyStore = CommonUtils.createHelixPropertyStore("localhost:" + zkInfo.getPort(), propertyStoreConfig, Collections.singletonList(propertyStoreConfig.rootPath)); String getPath = ClusterMapUtils.PROPERTYSTORE_ZNODE_PATH; ZNRecord zNRecord = propertyStore.get(getPath, null, AccessOption.PERSISTENT); assertNotNull(zNRecord); Map<String, Map<String, String>> overridePartition = zNRecord.getMapFields(); Set<String> writableInDC = new HashSet<>(); for (Map.Entry<String, Map<String, String>> entry : overridePartition.entrySet()) { if (entry.getValue().get(ClusterMapUtils.PARTITION_STATE).equals(ClusterMapUtils.READ_WRITE_STR)) { writableInDC.add(entry.getKey()); } } assertEquals("Mismatch in writable partitions for partitionLayout and propertyStore", writableInPartitionLayout, writableInDC); } }

Target:
private void uploadClusterConfigsAndVerify() throws Exception { List<PartitionId> writablePartitions = testPartitionLayout.getPartitionLayout().getWritablePartitions(null); Set<String> writableInPartitionLayout = new HashSet<>(); writablePartitions.forEach(k -> writableInPartitionLayout.add(k.toPathString())); Utils.writeJsonObjectToFile(zkJson, zkLayoutPath); Utils.writeJsonObjectToFile(testHardwareLayout.getHardwareLayout().toJSONObject(), hardwareLayoutPath); Utils.writeJsonObjectToFile(testPartitionLayout.getPartitionLayout().toJSONObject(), partitionLayoutPath); HelixBootstrapUpgradeUtil.uploadClusterConfigs(hardwareLayoutPath, partitionLayoutPath, zkLayoutPath, CLUSTER_NAME_PREFIX, dcStr, DEFAULT_MAX_PARTITIONS_PER_RESOURCE, new HelixAdminFactory()); for (ZkInfo zkInfo : dcsToZkInfo.values()) { HelixPropertyStore<ZNRecord> propertyStore = CommonUtils.createHelixPropertyStore("localhost:" + zkInfo.getPort(), propertyStoreConfig, Collections.singletonList(propertyStoreConfig.rootPath)); String getPath = ClusterMapUtils.PROPERTYSTORE_ZNODE_PATH; ZNRecord zNRecord = propertyStore.get(getPath, null, AccessOption.PERSISTENT); if (!activeDcSet.contains(zkInfo.getDcName())) { assertNull(zNRecord); } else { assertNotNull(zNRecord); Map<String, Map<String, String>> overridePartition = zNRecord.getMapFields(); Set<String> writableInDC = new HashSet<>(); for (Map.Entry<String, Map<String, String>> entry : overridePartition.entrySet()) { if (entry.getValue().get(ClusterMapUtils.PARTITION_STATE).equals(ClusterMapUtils.READ_WRITE_STR)) { writableInDC.add(entry.getKey()); } } assertEquals("Mismatch in writable partitions for partitionLayout and propertyStore", writableInPartitionLayout, writableInDC); } } }