Jackie-Jiang commented on a change in pull request #7255:
URL: https://github.com/apache/pinot/pull/7255#discussion_r686332582
##########
File path:
pinot-common/src/main/java/org/apache/pinot/common/metadata/ZKMetadataProvider.java
##########
@@ -309,89 +272,27 @@ public static Schema getTableSchema(@Nonnull
ZkHelixPropertyStore<ZNRecord> prop
* NOTE: this method is very expensive, use {@link
#getSegments(ZkHelixPropertyStore, String)} instead if only segment
* segment names are needed.
*/
- public static List<OfflineSegmentZKMetadata>
getOfflineSegmentZKMetadataListForTable(
- ZkHelixPropertyStore<ZNRecord> propertyStore, String tableName) {
- String offlineTableName =
TableNameBuilder.OFFLINE.tableNameWithType(tableName);
- String parentPath =
constructPropertyStorePathForResource(offlineTableName);
- List<ZNRecord> znRecords = propertyStore.getChildren(parentPath, null,
AccessOption.PERSISTENT,
- CommonConstants.Helix.ZkClient.RETRY_COUNT,
CommonConstants.Helix.ZkClient.RETRY_INTERVAL_MS);
+ public static List<SegmentZKMetadata>
getSegmentsZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
+ String tableNameWithType) {
+ String parentPath =
constructPropertyStorePathForResource(tableNameWithType);
+ List<ZNRecord> znRecords = propertyStore
+ .getChildren(parentPath, null, AccessOption.PERSISTENT,
CommonConstants.Helix.ZkClient.RETRY_COUNT,
+ CommonConstants.Helix.ZkClient.RETRY_INTERVAL_MS);
if (znRecords != null) {
int numZNRecords = znRecords.size();
- List<OfflineSegmentZKMetadata> offlineSegmentZKMetadataList = new
ArrayList<>(numZNRecords);
+ List<SegmentZKMetadata> segmentsZKMetadata = new
ArrayList<>(numZNRecords);
for (ZNRecord znRecord : znRecords) {
// NOTE: it is possible that znRecord is null if the record gets
removed while calling this method
if (znRecord != null) {
- offlineSegmentZKMetadataList.add(new
OfflineSegmentZKMetadata(znRecord));
+ segmentsZKMetadata.add(new SegmentZKMetadata(znRecord));
}
}
- int numNullZNRecords = numZNRecords -
offlineSegmentZKMetadataList.size();
+ int numNullZNRecords = numZNRecords - segmentsZKMetadata.size();
if (numNullZNRecords > 0) {
- LOGGER.warn("Failed to read {}/{} offline segment ZK metadata under
path: {}", numZNRecords - numNullZNRecords,
+ LOGGER.warn("Failed to read {}/{} segment ZK metadata under path: {}",
numZNRecords - numNullZNRecords,
Review comment:
Good catch
--
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]