public long getDeviceQuotaRemain(Set<Integer> consensusGroupIdSet) {
    long res =
        deviceThreshold
            - deviceCountMap.entrySet().stream()
                .filter(i -> consensusGroupIdSet.contains(i.getKey()))
                .mapToLong(Map.Entry::getValue)
                .sum();
    return res > 0 ? res : 0;
  }
Get the remain quota of device for the given consensus group.

@param consensusGroupIdSet the consensus group id set
@return the remain quota, >=0
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaQuotaStatistics.java