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 2022/11/28 10:34:38 UTC

[GitHub] [iotdb] JackieTien97 commented on a diff in pull request #8229: Add ConfigNode process

JackieTien97 commented on code in PR #8229:
URL: https://github.com/apache/iotdb/pull/8229#discussion_r1033355121


##########
confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java:
##########
@@ -434,11 +435,19 @@ public void GetDataPartitionPlanTest() throws IOException {
     TSeriesPartitionSlot seriesPartitionSlot = new TSeriesPartitionSlot(10);
     TTimePartitionSlot timePartitionSlot = new TTimePartitionSlot(100);
 
-    Map<String, Map<TSeriesPartitionSlot, List<TTimePartitionSlot>>> partitionSlotsMap =
+    Map<String, Map<TSeriesPartitionSlot, TTimePartitionSlotList>> partitionSlotsMap =
         new HashMap<>();
     partitionSlotsMap.put(storageGroup, new HashMap<>());
-    partitionSlotsMap.get(storageGroup).put(seriesPartitionSlot, new ArrayList<>());
-    partitionSlotsMap.get(storageGroup).get(seriesPartitionSlot).add(timePartitionSlot);
+    partitionSlotsMap
+        .get(storageGroup)
+        .put(
+            seriesPartitionSlot,
+            new TTimePartitionSlotList().setTimePartitionSlots(new ArrayList<>()));

Review Comment:
   ```suggestion
               new TTimePartitionSlotList().setTimePartitionSlots(new ArrayList<>(), true, true));
   ```



##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java:
##########
@@ -1375,12 +1376,12 @@ public Map<TConsensusGroupId, TRegionReplicaSet> getRelatedDataRegionGroup(
         getSchemaPartition(patternTree).getSchemaPartitionTable();
 
     // Construct request for getting data partition
-    Map<String, Map<TSeriesPartitionSlot, List<TTimePartitionSlot>>> partitionSlotsMap =
+    Map<String, Map<TSeriesPartitionSlot, TTimePartitionSlotList>> partitionSlotsMap =
         new HashMap<>();
     schemaPartitionTable.forEach(
         (key, value) -> {
-          Map<TSeriesPartitionSlot, List<TTimePartitionSlot>> slotListMap = new HashMap<>();
-          value.keySet().forEach(slot -> slotListMap.put(slot, Collections.emptyList()));
+          Map<TSeriesPartitionSlot, TTimePartitionSlotList> slotListMap = new HashMap<>();
+          value.keySet().forEach(slot -> slotListMap.put(slot, new TTimePartitionSlotList()));

Review Comment:
   ```suggestion
             value.keySet().forEach(slot -> slotListMap.put(slot, new TTimePartitionSlotList(Collections.emptyList(), true, true)));
   ```



##########
integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java:
##########
@@ -120,23 +121,31 @@ public static ByteBuffer generatePatternTreeBuffer(String[] paths)
     return ByteBuffer.wrap(baos.toByteArray());
   }
 
-  public static Map<String, Map<TSeriesPartitionSlot, List<TTimePartitionSlot>>>
+  public static Map<String, Map<TSeriesPartitionSlot, TTimePartitionSlotList>>
       constructPartitionSlotsMap(
           String storageGroup,
           int seriesSlotStart,
           int seriesSlotEnd,
           long timeSlotStart,
           long timeSlotEnd,
           long timePartitionInterval) {
-    Map<String, Map<TSeriesPartitionSlot, List<TTimePartitionSlot>>> result = new HashMap<>();
+    Map<String, Map<TSeriesPartitionSlot, TTimePartitionSlotList>> result = new HashMap<>();
     result.put(storageGroup, new HashMap<>());
 
     for (int i = seriesSlotStart; i < seriesSlotEnd; i++) {
       TSeriesPartitionSlot seriesPartitionSlot = new TSeriesPartitionSlot(i);
-      result.get(storageGroup).put(seriesPartitionSlot, new ArrayList<>());
+      result
+          .get(storageGroup)
+          .put(
+              seriesPartitionSlot,
+              new TTimePartitionSlotList().setTimePartitionSlots(new ArrayList<>()));

Review Comment:
   set left and right to true



##########
confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java:
##########
@@ -452,11 +461,19 @@ public void GetOrCreateDataPartitionPlanTest() throws IOException {
     TSeriesPartitionSlot seriesPartitionSlot = new TSeriesPartitionSlot(10);
     TTimePartitionSlot timePartitionSlot = new TTimePartitionSlot(100);
 
-    Map<String, Map<TSeriesPartitionSlot, List<TTimePartitionSlot>>> partitionSlotsMap =
+    Map<String, Map<TSeriesPartitionSlot, TTimePartitionSlotList>> partitionSlotsMap =
         new HashMap<>();
     partitionSlotsMap.put(storageGroup, new HashMap<>());
-    partitionSlotsMap.get(storageGroup).put(seriesPartitionSlot, new ArrayList<>());
-    partitionSlotsMap.get(storageGroup).get(seriesPartitionSlot).add(timePartitionSlot);
+    partitionSlotsMap
+        .get(storageGroup)
+        .put(
+            seriesPartitionSlot,
+            new TTimePartitionSlotList().setTimePartitionSlots(new ArrayList<>()));

Review Comment:
   ```suggestion
               new TTimePartitionSlotList().setTimePartitionSlots(new ArrayList<>(), true, true));
   ```



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