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/12/07 05:24:34 UTC

[GitHub] [iotdb] HTHou commented on a change in pull request #4436: [IOTDB-1984] Upgrade the data migration granularity to device

HTHou commented on a change in pull request #4436:
URL: https://github.com/apache/iotdb/pull/4436#discussion_r763637417



##########
File path: example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
##########
@@ -82,19 +96,36 @@ public static void main(String[] args)
     }
     readerPool.closeResultSet(schemaDataSet);
 
-    schemaDataSet = readerPool.executeQueryStatement("show timeseries " + path);
+    schemaDataSet = readerPool.executeQueryStatement("show devices " + path + ".**");
     schemaIter = schemaDataSet.iterator();
 
     List<Future> futureList = new ArrayList<>();
     int count = 0;
+    int seriesNumInOneTask = 0;
+    String currentDevice = "";
+    List<String> measurementsInCurrentDevice = new ArrayList<>();
+    List<TSDataType> dataTypesInCurrentDevice = new ArrayList<>();
     while (schemaIter.next()) {
+      Path currentPath = new Path(schemaIter.getString("devices"), true);
+      currentDevice = currentPath.getDevice();
+      SessionDataSetWrapper currentDivice_DataSet =
+          readerPool.executeQueryStatement("show timeseries " + currentPath + ".**");
+      DataIterator currentDivice_Iter = currentDivice_DataSet.iterator();
+      while (currentDivice_Iter.next()) {
+        Path currenttimePath = new Path(currentDivice_Iter.getString("timeseries"), true);
+        measurementsInCurrentDevice.add(currenttimePath.getMeasurement());
+        dataTypesInCurrentDevice.add(TSDataType.valueOf(currentDivice_Iter.getString("dataType")));

Review comment:
       Hi, if there is a large number of measurements, like over 100,000 measurements, in one device, is there any problem?




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org