private void removeInvalidDataRegions(List<ConsensusGroupId> dataNodeConsensusGroupIds) {
    Map<String, List<DataRegionId>> localDataRegionInfo =
        StorageEngine.getInstance().getLocalDataRegionInfo();
    List<String> allLocalFilesFolders = TierManager.getInstance().getAllLocalFilesFolders();
    localDataRegionInfo.forEach(
        (database, dataRegionIds) -> {
          for (DataRegionId dataRegionId : dataRegionIds) {
            if (!dataNodeConsensusGroupIds.contains(dataRegionId)) {
              removeDataDirRegion(database, dataRegionId, allLocalFilesFolders);
            }
          }
        });
  }
Register this DataNode into cluster.

@param isPreCheck do pre-check before formal registration
@throws StartupException if register failed.
@throws IOException if serialize cluster name and datanode id failed.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java