Skip to content

Commit

Permalink
optimize history comparation (#12967)
Browse files Browse the repository at this point in the history
* fix type search on mysql model

* 灰度模型迁移程序并发&迁移不落历史表

* Config migrate executor times

* 1.Config migrate executor times
2. history comparation optimize

* 1.Config migrate executor times
2. history comparation optimize

* checkstyle
  • Loading branch information
shiyiyue1102 authored Dec 18, 2024
1 parent faa61ee commit 0556181
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 280 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.alibaba.nacos.common.utils.StringUtils;
import com.alibaba.nacos.config.server.constant.Constants;
import com.alibaba.nacos.config.server.model.ConfigHistoryInfo;
import com.alibaba.nacos.config.server.model.ConfigHistoryInfoPair;
import com.alibaba.nacos.config.server.model.ConfigInfoWrapper;
import com.alibaba.nacos.config.server.paramcheck.ConfigDefaultHttpParamExtractor;
import com.alibaba.nacos.core.paramcheck.ExtractorManager;
Expand Down Expand Up @@ -102,25 +101,6 @@ public ConfigHistoryInfo getConfigHistoryInfo(@RequestParam("dataId") String dat
return historyService.getConfigHistoryInfo(dataId, group, tenant, nid);
}

/**
* Query the detailed configuration history information pair, including the original version and the updated version. notes:
*
* @param nid history_config_info nid
* @param dataId dataId @since 2.0.3
* @param group groupId @since 2.0.3
* @param tenant tenantId @since 2.0.3
* @return history config info
* @since 2.0.3 add {@link Secured}, dataId, groupId and tenant for history config permission check.
*/
@GetMapping(value = "/pair")
@Secured(action = ActionTypes.READ, signType = SignType.CONFIG)
public ConfigHistoryInfoPair getConfigHistoryInfoPair(@RequestParam("dataId") String dataId,
@RequestParam("group") String group,
@RequestParam(value = "tenant", required = false, defaultValue = StringUtils.EMPTY) String tenant,
@RequestParam(value = "nid") Long nid) throws AccessException {
return historyService.getConfigHistoryInfoPair(dataId, group, tenant, nid);
}

/**
* Query previous config history information. notes:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.alibaba.nacos.common.utils.StringUtils;
import com.alibaba.nacos.config.server.constant.Constants;
import com.alibaba.nacos.config.server.model.ConfigHistoryInfo;
import com.alibaba.nacos.config.server.model.ConfigHistoryInfoDetail;
import com.alibaba.nacos.config.server.model.ConfigInfoWrapper;
import com.alibaba.nacos.config.server.paramcheck.ConfigDefaultHttpParamExtractor;
import com.alibaba.nacos.core.paramcheck.ExtractorManager;
Expand Down Expand Up @@ -112,6 +113,27 @@ public Result<ConfigHistoryInfo> getConfigHistoryInfo(@RequestParam("dataId") St
return Result.success(configHistoryInfo);
}


/**
* Query the detailed configuration history information pair, including the original version and the updated version. notes:
*
* @param nid history_config_info nid
* @param dataId dataId @since 2.0.3
* @param group groupId @since 2.0.3
* @param namespaceId namespaceId @since 2.0.3
* @return history config info
* @since 2.0.3 add {@link Secured}, dataId, groupId and tenant for history config permission check.
*/
@GetMapping(value = "/detail")
@Secured(action = ActionTypes.READ, signType = SignType.CONFIG)
public Result<ConfigHistoryInfoDetail> getConfigHistoryInfoDetail(@RequestParam("dataId") String dataId,
@RequestParam("group") String group,
@RequestParam(value = "namespaceId", required = false, defaultValue = StringUtils.EMPTY) String namespaceId,
@RequestParam(value = "nid") Long nid) throws AccessException {
return Result.success(historyService.getConfigHistoryInfoDetail(dataId, group, namespaceId, nid));
}


/**
* Query previous config history information. notes:
*
Expand Down
Loading

0 comments on commit 0556181

Please sign in to comment.