public boolean getSchemaPartition(
      List<TSeriesPartitionSlot> partitionSlots, SchemaPartitionTable schemaPartitionTable) {
    AtomicBoolean result = new AtomicBoolean(true);

    if (partitionSlots.isEmpty()) {
      // Return all SchemaPartitions in one StorageGroup when the queried PartitionSlots are empty
      schemaPartitionTable.getSchemaPartitionMap().putAll(schemaPartitionMap);
    } else {
      // Return the SchemaPartition for each SeriesPartitionSlot
      partitionSlots.forEach(
          seriesPartitionSlot -> {
            if (schemaPartitionMap.containsKey(seriesPartitionSlot)) {
              schemaPartitionTable
                  .getSchemaPartitionMap()
                  .put(seriesPartitionSlot, schemaPartitionMap.get(seriesPartitionSlot));
            } else {
              result.set(false);
            }
          });
    }

    return result.get();
  }
Thread-safely get SchemaPartition within the specific StorageGroup

@param partitionSlots SeriesPartitionSlots
@param schemaPartitionTable Store the matched SchemaPartitions
@return True if all the SeriesPartitionSlots are matched, false otherwise
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartitionTable.java