neuyilan commented on a change in pull request #2724:
URL: https://github.com/apache/iotdb/pull/2724#discussion_r581532127
##########
File path:
cluster/src/main/java/org/apache/iotdb/cluster/log/manage/FilePartitionedSnapshotLogManager.java
##########
@@ -117,11 +117,22 @@ private void collectTsFilesAndFillTimeseriesSchemas()
throws IOException {
collectTsFiles();
// 2.register the measurement
+ boolean slotExistsInPartition = true;
for (Map.Entry<Integer, Collection<TimeseriesSchema>> entry :
slotTimeseries.entrySet()) {
int slotNum = entry.getKey();
- FileSnapshot snapshot = slotSnapshots.computeIfAbsent(slotNum, s -> new
FileSnapshot());
- if (snapshot.getTimeseriesSchemas().isEmpty()) {
- snapshot.setTimeseriesSchemas(entry.getValue());
+
+ if (dataGroupMember.getMetaGroupMember() != null) {
+ List<Integer> slots =
+ ((SlotPartitionTable)
dataGroupMember.getMetaGroupMember().getPartitionTable())
+ .getNodeSlots(dataGroupMember.getHeader());
Review comment:
Move those codes before the for loop, we do not need to get the slots
for this raft group per loop, it's not efficient.
##########
File path:
cluster/src/main/java/org/apache/iotdb/cluster/log/manage/PartitionedSnapshotLogManager.java
##########
@@ -92,17 +92,27 @@ public Snapshot getSnapshot(long minIndex) {
void collectTimeseriesSchemas() {
slotTimeseries.clear();
List<StorageGroupMNode> allSgNodes =
IoTDB.metaManager.getAllStorageGroupNodes();
+ boolean slotExistsInPartition = true;
for (MNode sgNode : allSgNodes) {
String storageGroupName = sgNode.getFullPath();
int slot =
SlotPartitionTable.getSlotStrategy()
.calculateSlotByTime(
storageGroupName, 0, ((SlotPartitionTable)
partitionTable).getTotalSlotNumbers());
- Collection<TimeseriesSchema> schemas =
- slotTimeseries.computeIfAbsent(slot, s -> new HashSet<>());
- IoTDB.metaManager.collectTimeseriesSchema(sgNode, schemas);
- logger.debug("{}: {} timeseries are snapshot in slot {}", getName(),
schemas.size(), slot);
+ if (dataGroupMember.getMetaGroupMember() != null) {
+ List<Integer> slots =
+ ((SlotPartitionTable)
dataGroupMember.getMetaGroupMember().getPartitionTable())
+ .getNodeSlots(dataGroupMember.getHeader());
Review comment:
the same as above.
----------------------------------------------------------------
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:
[email protected]