You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/07/07 05:28:44 UTC
[GitHub] [incubator-iotdb] Ring-k commented on a change in pull request #1466: delete timeseries when path is not found
Ring-k commented on a change in pull request #1466:
URL: https://github.com/apache/incubator-iotdb/pull/1466#discussion_r450619066
##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
##########
@@ -2614,6 +2641,43 @@ private AsyncClientPool getDataAsyncClientPool() {
return ret;
}
+ /**
+ * Get all paths after removing wildcards in the path
+ *
+ * @param originalPaths, a list of paths, potentially with wildcard
+ * @return a pair of path lists, the first are the existing full paths, the second are invalid
+ * original paths
+ */
+ public Pair<List<String>, List<String>> getMatchedPaths(List<String> originalPaths) {
+ ConcurrentSkipListSet<String> fullPaths = new ConcurrentSkipListSet<>();
+ ConcurrentSkipListSet<String> nonExistPaths = new ConcurrentSkipListSet<>();
+ ExecutorService getAllPathsService = Executors
+ .newFixedThreadPool(partitionTable.getGlobalGroups().size());
+ for (String pathStr : originalPaths) {
+ getAllPathsService.submit(() -> {
+ try {
+ List<String> fullPathStrs = getMatchedPaths(pathStr);
+ if (fullPathStrs.isEmpty()) {
+ nonExistPaths.add(pathStr);
+ logger.error("Path {} is not found.", pathStr);
+ }
+ fullPaths.addAll(fullPathStrs);
Review comment:
You're right. Thanks for your suggestion :)
----------------------------------------------------------------
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:
users@infra.apache.org