zhtaoxiang commented on code in PR #10261:
URL: https://github.com/apache/pinot/pull/10261#discussion_r1102351334
##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/BaseMultipleSegmentsConversionExecutor.java:
##########
@@ -154,25 +156,33 @@ public void setMinionEventObserver(MinionEventObserver
observer) {
@Override
public List<SegmentConversionResult> executeTask(PinotTaskConfig
pinotTaskConfig)
throws Exception {
- preProcess(pinotTaskConfig);
- _pinotTaskConfig = pinotTaskConfig;
- _eventObserver =
MinionEventObservers.getInstance().getMinionEventObserver(pinotTaskConfig.getTaskId());
- String taskType = pinotTaskConfig.getTaskType();
+ // check whether all segments to process exist in the table, if not,
terminate early to avoid wasting computing
+ // resources
Map<String, String> configs = pinotTaskConfig.getConfigs();
String tableNameWithType = configs.get(MinionConstants.TABLE_NAME_KEY);
String inputSegmentNames = configs.get(MinionConstants.SEGMENT_NAME_KEY);
- String downloadURLString = configs.get(MinionConstants.DOWNLOAD_URL_KEY);
- String[] downloadURLs =
downloadURLString.split(MinionConstants.URL_SEPARATOR);
String uploadURL = configs.get(MinionConstants.UPLOAD_URL_KEY);
AuthProvider authProvider =
AuthProviderUtils.makeAuthProvider(configs.get(MinionConstants.AUTH_TOKEN));
+ Set<String> nonExistentSegmentNames =
SegmentConversionUtils.extractNonExistentSegments(tableNameWithType,
+ FileUploadDownloadClient.extractBaseURI(new URI(uploadURL)),
+
Arrays.asList(inputSegmentNames.split(MinionConstants.SEGMENT_NAME_SEPARATOR)),
authProvider);
+ if (!CollectionUtils.isEmpty(nonExistentSegmentNames)) {
+ throw new RuntimeException(String.format("Segments to process: %s do not
exist in table: %s",
Review Comment:
good point, will update it.
--
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]