iotdb-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-iotdb] fanhualta commented on a change in pull request #152: Cluster read
Date Tue, 07 May 2019 09:59:06 GMT
fanhualta commented on a change in pull request #152: Cluster read
URL: https://github.com/apache/incubator-iotdb/pull/152#discussion_r281558894
 
 

 ##########
 File path: cluster/src/main/java/org/apache/iotdb/cluster/query/manager/coordinatornode/ClusterRpcSingleQueryManager.java
 ##########
 @@ -0,0 +1,421 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.cluster.query.manager.coordinatornode;
+
+import com.alipay.sofa.jraft.entity.PeerId;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import org.apache.iotdb.cluster.config.ClusterConstant;
+import org.apache.iotdb.cluster.exception.RaftConnectionException;
+import org.apache.iotdb.cluster.query.PathType;
+import org.apache.iotdb.cluster.query.QueryType;
+import org.apache.iotdb.cluster.query.reader.coordinatornode.ClusterFilterSeriesReader;
+import org.apache.iotdb.cluster.query.reader.coordinatornode.ClusterSelectSeriesReader;
+import org.apache.iotdb.cluster.query.utils.ClusterRpcReaderUtils;
+import org.apache.iotdb.cluster.query.utils.QueryPlanPartitionUtils;
+import org.apache.iotdb.cluster.rpc.raft.response.BasicQueryDataResponse;
+import org.apache.iotdb.cluster.rpc.raft.response.querydata.InitSeriesReaderResponse;
+import org.apache.iotdb.cluster.rpc.raft.response.querydata.QuerySeriesDataByTimestampResponse;
+import org.apache.iotdb.cluster.rpc.raft.response.querydata.QuerySeriesDataResponse;
+import org.apache.iotdb.cluster.utils.QPExecutorUtils;
+import org.apache.iotdb.cluster.utils.RaftUtils;
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.qp.physical.crud.QueryPlan;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.BatchData;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+
+/**
+ * Manage all remote series reader resource in a query resource in coordinator node.
+ */
+public class ClusterRpcSingleQueryManager implements IClusterRpcSingleQueryManager {
+
+  /**
+   * Statistic all usage of local data group.
+   */
+  private Set<String> dataGroupUsage = new HashSet<>();
+
+  /**
+   * Query job id assigned by ClusterRpcQueryManager
+   */
+  private String taskId;
+
+  /**
+   * Represents the number of query rounds
+   */
+  private long queryRounds = 0;
+
+  /**
+   * Origin query plan parsed by QueryProcessor
+   */
+  private QueryPlan originQueryPlan;
+
+  /**
+   * Represent selected reader nodes, key is group id and value is selected peer id
+   */
+  private Map<String, PeerId> queryNodes = new HashMap<>();
+
+  // select path resource
+  /**
+   * Query plans of select paths which are divided from queryPlan group by group id, it contains
all
+   * group id ,including local data group if it involves.
+   */
+  private Map<String, QueryPlan> selectPathPlans = new HashMap<>();
+
+  /**
+   * Key is group id (only contains remote group id), value is all select series in group
id.
+   */
+  private Map<String, List<Path>> selectSeriesByGroupId = new HashMap<>();
+
+  /**
+   * Series reader of select paths (only contains remote series), key is series path , value
is
+   * reader
+   */
+  private Map<Path, ClusterSelectSeriesReader> selectSeriesReaders = new HashMap<>();
+
+  // filter path resource
+  /**
+   * Filter group entity group by data group, key is group id(only contain remote group id)
+   */
+  private Map<String, FilterGroupEntity> filterGroupEntityMap = new HashMap<>();
+
+  public ClusterRpcSingleQueryManager(String taskId,
+      QueryPlan queryPlan) {
+    this.taskId = taskId;
+    this.originQueryPlan = queryPlan;
+  }
+
+  @Override
+  public void initQueryResource(QueryType queryType, int readDataConsistencyLevel)
+      throws PathErrorException, IOException, RaftConnectionException {
+    switch (queryType) {
+      case NO_FILTER:
+        QueryPlanPartitionUtils.splitQueryPlanWithoutValueFilter(this);
+        break;
+      case GLOBAL_TIME:
 
 Review comment:
   fixed

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


With regards,
Apache Git Services

Mime
View raw message