jackjlli commented on a change in pull request #7086: URL: https://github.com/apache/incubator-pinot/pull/7086#discussion_r658136510
########## File path: pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/BaseTaskExecutor.java ########## @@ -56,4 +59,15 @@ protected Schema getSchema(String tableName) { Preconditions.checkState(schema != null, "Failed to find schema for table: %s", tableName); return schema; } + + protected long getSegmentCrc(String tableNameWithType, String segmentName) { + TableType tableType = TableNameBuilder.getTableTypeFromTableName(tableNameWithType); + SegmentZKMetadata segmentZKMetadata = tableType == TableType.OFFLINE ? ZKMetadataProvider + .getOfflineSegmentZKMetadata(MINION_CONTEXT.getHelixPropertyStore(), tableNameWithType, segmentName) + : ZKMetadataProvider + .getRealtimeSegmentZKMetadata(MINION_CONTEXT.getHelixPropertyStore(), tableNameWithType, segmentName); + Preconditions.checkState(segmentZKMetadata != null, "Failed to find segment metadata for table: %s, segment: %s", Review comment: +1 on that. Another drawback of just throwing an exception here is that the task status would be left unchanged without proper cleanup. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org