public static RegionMigrateState getStateByCode(int code) {
    for (RegionMigrateState state : RegionMigrateState.values()) {
      if (state.getCode() == code) {
        return state;
      }
    }
    return null;
  }
get RegionMigrateState by code

@param code code
@return RegionMigrateState
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/enums/RegionMigrateState.java