d-wang-commit commented on code in PR #18692:
URL: https://github.com/apache/iotdb/pull/18692#discussion_r4070403884
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/DatabasePartitionTable.java:
##########
@@ -267,6 +268,22 @@ public int getAssignedSeriesPartitionSlotsCount() {
dataPartitionTable.getDataPartitionMap().size());
}
+ /** Count distinct series slots after allocation, independently for schema
and data partitions. */
+ public int getSeriesPartitionSlotsCount(
+ TConsensusGroupType type, Collection<TSeriesPartitionSlot>
unassignedSlots) {
+ final Set<TSeriesPartitionSlot> assignedSlots =
+ type == TConsensusGroupType.SchemaRegion
+ ? schemaPartitionTable.getSchemaPartitionMap().keySet()
+ : dataPartitionTable.getDataPartitionMap().keySet();
+ int slotCount = assignedSlots.size();
+ for (TSeriesPartitionSlot slot : new HashSet<>(unassignedSlots)) {
+ if (!assignedSlots.contains(slot)) {
+ slotCount++;
+ }
+ }
+ return slotCount;
+ }
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]