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 2021/03/20 07:36:08 UTC

[GitHub] [iotdb] wangchao316 commented on a change in pull request #2875: [IOTDB-1117][Distributed]Batched creation and fetch of RemoteSeriesReā€¦

wangchao316 commented on a change in pull request #2875:
URL: https://github.com/apache/iotdb/pull/2875#discussion_r598077599



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
##########
@@ -201,6 +212,139 @@ private IReaderByTimestamp getRemoteReaderByTimestamp(
         new RequestTimeOutException("Query by timestamp: " + path + " in " + partitionGroup));
   }
 
+  /**
+   * Create a ManagedSeriesReader that can read the data of "path" with filters in the whole
+   * cluster. The data groups that should be queried will be determined by the timeFilter, then for
+   * each group a series reader will be created, and finally all such readers will be merged into
+   * one.
+   *
+   * @param timeFilter nullable, when null, all data groups will be queried
+   * @param valueFilter nullable
+   */
+  public List<IMultPointReader> getMultSeriesReader(
+      List<PartialPath> paths,
+      Map<String, Set<String>> deviceMeasurements,
+      List<TSDataType> dataTypes,
+      Filter timeFilter,
+      Filter valueFilter,
+      QueryContext context,
+      boolean ascending)
+      throws StorageEngineException, EmptyIntervalException {
+    // find the groups that should be queried using the timeFilter
+
+    Map<PartitionGroup, List<PartialPath>> partitionGroupListMap = Maps.newHashMap();
+    for (PartialPath partialPath : paths) {
+      List<PartitionGroup> partitionGroups = metaGroupMember.routeFilter(timeFilter, partialPath);
+      partitionGroups.forEach(
+          partitionGroup -> {
+            partitionGroupListMap
+                .computeIfAbsent(partitionGroup, n -> new ArrayList<>())
+                .add(partialPath);
+          });
+    }
+
+    List<IMultPointReader> multPointReaders = Lists.newArrayList();
+
+    partitionGroupListMap
+        .keySet()
+        .forEach(
+            partitionGroup -> {
+              List<PartialPath> partialPaths = partitionGroupListMap.get(partitionGroup);

Review comment:
       done




-- 
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