Skip to content

Commit

Permalink
[INLONG-9586][Manager] Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweng11 committed Jan 18, 2024
1 parent e2922e6 commit 2edf260
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ public Boolean delete(Integer id, UserInfo opInfo) {

@Override
public Integer saveNode(ClusterNodeRequest request, String operator) {
LOGGER.info("begin to insert inlong cluster node={}", request);
LOGGER.debug("begin to insert inlong cluster node={}", request);
Preconditions.expectNotNull(request, "cluster node info cannot be empty");

// check cluster node if exist
Expand All @@ -872,12 +872,9 @@ public Integer saveNode(ClusterNodeRequest request, String operator) {
InlongClusterNodeOperator instance = clusterNodeOperatorFactory.getInstance(request.getType());
Integer id = instance.saveOpt(request, operator);
if (request.getIsInstall()) {
LOGGER.info("begin to install inlong cluster node={}", request);
InlongClusterNodeInstallOperator clusterNodeInstallOperator = clusterNodeInstallOperatorFactory.getInstance(
request.getType());
clusterNodeInstallOperator.install(request, operator);
LOGGER.info("success to install inlong cluster node={}", request);

}
return id;
}
Expand Down Expand Up @@ -1082,12 +1079,9 @@ public Boolean updateNode(ClusterNodeRequest request, String operator) {
InlongClusterNodeOperator instance = clusterNodeOperatorFactory.getInstance(request.getType());
instance.updateOpt(request, operator);
if (request.getIsInstall()) {
LOGGER.info("begin to install inlong cluster node={}", request);
InlongClusterNodeInstallOperator clusterNodeInstallOperator = clusterNodeInstallOperatorFactory.getInstance(
request.getType());
clusterNodeInstallOperator.install(request, operator);
LOGGER.info("success to install inlong cluster node={}", request);

}
return true;
}
Expand Down Expand Up @@ -1150,12 +1144,12 @@ public Boolean deleteNode(Integer id, String operator) {

@Override
public Boolean unloadNode(Integer id, String operator) {
LOGGER.info("begin to unload inlong cluster node={}", id);
LOGGER.info("begin to unload inlong cluster node={}, operator={}", id, operator);
InlongClusterNodeEntity clusterNodeEntity = clusterNodeMapper.selectById(id);
InlongClusterNodeInstallOperator clusterNodeInstallOperator = clusterNodeInstallOperatorFactory.getInstance(
clusterNodeEntity.getType());
boolean isSuccess = clusterNodeInstallOperator.unload(clusterNodeEntity, operator);
LOGGER.info("success to unload inlong cluster node={}", id);
LOGGER.info("success to unload inlong cluster node={}, operator={}", id, operator);
return isSuccess;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,20 @@ public interface InlongClusterNodeInstallOperator {

String getClusterNodeType();

/**
* Installing cluster nodes.
*
* @param clusterNodeRequest cluster request
* @param operator operator
*/
boolean install(ClusterNodeRequest clusterNodeRequest, String operator);

/**
* Uninstalling cluster nodes.
*
* @param clusterNodeEntity cluster entity
* @param operator operator
*/
boolean unload(InlongClusterNodeEntity clusterNodeEntity, String operator);

}

0 comments on commit 2edf260

Please sign in to comment.