caiconghui commented on a change in pull request #3196: Support determine isPreviousLoadFinished for some alter jobs in table level URL: https://github.com/apache/incubator-doris/pull/3196#discussion_r398321936
########## File path: fe/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java ########## @@ -821,6 +821,24 @@ public boolean isPreviousTransactionsFinished(long endTransactionId, long dbId) } return true; } + + // check if there exists a intersection between the source tableId list and target tableId list + // if one of them is null or empty, that means that we don't know related tables in tableList, + // we think the two lists may have intersection for right ordered txns + public boolean isIntersectionNotEmpty(List<Long> sourceTableIdList, List<Long> targetTableIdList) { + if (sourceTableIdList == null || sourceTableIdList.isEmpty() || targetTableIdList == null || + targetTableIdList.isEmpty()) { + return true; + } + for (int i = 0; i < sourceTableIdList.size(); i++) { Review comment: > the method is low efficiency, use `sourceTableIdList.retainAll(targetTableIdList);sourceTableIdList.isEmpty()` instread? in most case the table list size is 1, and we should not modify the table list content ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org