Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.consensus.SchemaRegionId;
import org.apache.iotdb.commons.exception.MetadataException;
import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
import org.apache.iotdb.commons.schema.table.TsTable;
import org.apache.iotdb.commons.utils.FileUtils;
import org.apache.iotdb.commons.utils.PathUtils;
Expand Down Expand Up @@ -387,15 +388,20 @@
.filter(
entry ->
schemaIds.contains(entry.getKey().getId())
&& SchemaRegionConsensusImpl.getInstance().isLeader(entry.getKey()))
&& SchemaRegionConsensusImpl.getInstance().isLeader(entry.getKey())
&& !entry
.getValue()
.getDatabaseFullPath()
.equals(SystemConstant.AUDIT_DATABASE))
.forEach(
entry ->
timeSeriesNum.put(entry.getKey().getId(), getTimeSeriesNumber(entry.getValue())));
timeSeriesNum.put(
entry.getKey().getId(), getTimeSeriesNumber4Quota(entry.getValue())));
return timeSeriesNum;
}

// not including view number
private long getTimeSeriesNumber(ISchemaRegion schemaRegion) {
private long getTimeSeriesNumber4Quota(final ISchemaRegion schemaRegion) {
return schemaRegion.getSchemaRegionStatistics().getSeriesNumber(false)
+ schemaRegion.getSchemaRegionStatistics().getTable2DevicesNumMap().entrySet().stream()
.map(
Expand Down Expand Up @@ -459,13 +465,20 @@
SchemaRegionConsensusImpl.getInstance().getAllConsensusGroupIds().stream()
.filter(
consensusGroupId ->
SchemaRegionConsensusImpl.getInstance().isLeader(consensusGroupId))
SchemaRegionConsensusImpl.getInstance().isLeader(consensusGroupId)
&& Optional.ofNullable(schemaRegionMap.get((SchemaRegionId) consensusGroupId))

Check warning on line 469 in iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unnecessary cast to "SchemaRegionId".

See more on https://sonarcloud.io/project/issues?id=apache_iotdb&issues=AZ29h8O3EjNYTa-xVTBF&open=AZ29h8O3EjNYTa-xVTBF&pullRequest=17548
.map(
schemaRegion ->
!schemaRegion
.getDatabaseFullPath()
.equals(SystemConstant.AUDIT_DATABASE))
.orElse(false))
.forEach(
consensusGroupId ->
tmp.put(
consensusGroupId.getId(),
Optional.ofNullable(schemaRegionMap.get(consensusGroupId))
.map(this::getTimeSeriesNumber)
.map(this::getTimeSeriesNumber4Quota)
.orElse(0L)));
}
}
Expand Down
Loading