public ReentrantReadWriteLock getRegionLock(ConsensusGroupId consensusGroupId) {
    return consensusGroupId instanceof DataRegionId
        ? dataRegionLockMap.get(consensusGroupId)
        : schemaRegionLockMap.get(consensusGroupId);
  }
This class takes the responsibility of managing regions, executing PlanNode of write type on
according regions and controlling the execution concurrency.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeRegionManager.java