From f2a07907a0de12ba6daf67bab98e59b9f84a0ac3 Mon Sep 17 00:00:00 2001
From: hawk9821 <39961809+hawk9821@users.noreply.github.com>
Date: Fri, 17 May 2024 23:57:34 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AFcheckstyle=EF=BC=8C=20?=
=?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=BB=A3=E7=A0=81=E9=A3=8E=E6=A0=BC=EF=BC=8C?=
=?UTF-8?q?=E9=81=BF=E5=85=8D=E4=BB=A3=E7=A0=81=E9=A3=8E=E6=A0=BC=E5=BC=95?=
=?UTF-8?q?=E8=B5=B7=E7=9A=84=E5=86=B2=E7=AA=81=20(#557)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* [Bug] Doris] DDP1.2.2,使用doris官方包安装be失败 #539
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* [Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* Update KyuubiServerHandlerStrategy.java
[Feature] 开启checkstyle, 统一代码风格,避免代码风格引起的冲突 #555
* 修改github ci
* 修改github ci
* 修改github ci
* 修改github ci
---
.github/workflows/maven.yaml | 15 +-
datasophon-api/pom.xml | 10 +-
.../api/DataSophonApplicationServer.java | 23 +-
.../api/configuration/AppConfiguration.java | 22 +-
.../configuration/ConfigPropertiesExtend.java | 36 +-
.../configuration/DatabaseMigrationAware.java | 8 +-
.../api/controller/AlertGroupController.java | 28 +-
.../ClusterAlertGroupMapController.java | 26 +-
.../ClusterAlertHistoryController.java | 24 +-
.../ClusterAlertQuotaController.java | 28 +-
.../controller/ClusterGroupController.java | 22 +-
.../api/controller/ClusterHostController.java | 42 +-
.../api/controller/ClusterInfoController.java | 25 +-
.../controller/ClusterKerberosController.java | 14 +-
.../ClusterNodeLabelController.java | 10 +-
.../ClusterQueueCapacityController.java | 28 +-
.../api/controller/ClusterRackController.java | 14 +-
.../controller/ClusterRoleUserController.java | 22 +-
.../ClusterServiceCommandController.java | 38 +-
...erServiceCommandHostCommandController.java | 26 +-
.../ClusterServiceCommandHostController.java | 22 +-
.../ClusterServiceDashboardController.java | 8 +-
...lusterServiceInstanceConfigController.java | 20 +-
.../ClusterServiceInstanceController.java | 28 +-
...terServiceInstanceRoleGroupController.java | 24 +-
...usterServiceRoleGroupConfigController.java | 26 +-
...erServiceRoleInstanceConfigController.java | 24 +-
.../ClusterServiceRoleInstanceController.java | 20 +-
...erServiceRoleInstanceWebuisController.java | 26 +-
.../api/controller/ClusterUserController.java | 24 +-
.../ClusterUserGroupController.java | 22 +-
.../ClusterYarnQueueController.java | 31 +-
.../ClusterYarnSchedulerController.java | 26 +-
.../api/controller/FrameInfoController.java | 22 +-
.../controller/FrameServiceController.java | 47 +-
.../FrameServiceRoleController.java | 28 +-
.../api/controller/HostInstallController.java | 42 +-
.../api/controller/LoginController.java | 30 +-
.../controller/NoticeGroupUserController.java | 24 +-
.../api/controller/ParcelController.java | 203 +++----
.../api/controller/RoleInfoController.java | 24 +-
.../controller/ServiceInstallController.java | 49 +-
.../api/controller/UserInfoController.java | 34 +-
.../api/exceptions/ApiException.java | 3 +-
.../api/exceptions/ApiExceptionHandler.java | 23 +-
.../interceptor/LocaleChangeInterceptor.java | 6 +-
.../interceptor/LoginHandlerInterceptor.java | 12 +-
.../interceptor/UserPermissionHandler.java | 22 +-
.../api/migration/DatabaseMigration.java | 484 ++++++++--------
.../datasophon/api/migration/Migration.java | 132 ++---
.../datasophon/api/migration/ScriptType.java | 13 +-
.../api/security/AuthenticationType.java | 6 +-
.../api/security/Authenticator.java | 4 +-
.../api/security/PasswordAuthenticator.java | 10 +-
.../api/security/SecurityConfig.java | 16 +-
.../api/security/UserPermission.java | 2 +-
.../meta/DDP-1.2.2/DORIS/service_ddl.json | 3 +-
datasophon-common/pom.xml | 76 +--
.../java/com/datasophon/common/Constants.java | 79 +--
.../datasophon/common/cache/CacheUtils.java | 20 +-
.../common/command/BaseCommand.java | 24 +-
.../common/command/BaseCommandResult.java | 4 +-
.../CheckCommandExecuteProgressCommand.java | 6 +-
.../CheckServiceExecuteStateCommand.java | 6 +-
.../common/command/ClusterCommand.java | 10 +-
.../command/DispatcherHostAgentCommand.java | 8 +-
.../common/command/ExecuteCmdCommand.java | 6 +-
.../command/ExecuteServiceRoleCommand.java | 22 +-
.../common/command/FileOperateCommand.java | 6 +-
.../command/GenerateAlertConfigCommand.java | 2 +-
.../command/GenerateHostPrometheusConfig.java | 2 +-
.../GeneratePrometheusConfigCommand.java | 8 +-
.../command/GenerateRackPropCommand.java | 5 +-
.../command/GenerateSRPromConfigCommand.java | 10 +-
.../command/GenerateServiceConfigCommand.java | 14 +-
.../command/GenerateStarRocksHAMessage.java | 4 +-
.../common/command/GetLogCommand.java | 6 +-
.../common/command/HdfsEcCommand.java | 2 +-
.../common/command/HostCheckCommand.java | 8 +-
.../common/command/HostInfoCollectResult.java | 4 +-
.../command/InstallServiceRoleCommand.java | 25 +-
.../InstallServiceRoleCommandConfirm.java | 2 +-
.../InstallServiceRoleCommandResult.java | 4 +-
.../common/command/OlapOpsType.java | 19 +-
.../common/command/OlapSqlExecCommand.java | 6 +-
.../common/command/PingCommand.java | 8 +-
.../common/command/ServiceCheckCommand.java | 4 +-
.../command/ServiceRoleOperateCommand.java | 22 +-
.../ServiceRoleOperateCommandResult.java | 2 +-
.../command/StartExecuteCommandCommand.java | 8 +-
.../command/StartScheduledTaskCommand.java | 2 +-
.../command/SubmitActiveTaskNodeCommand.java | 6 +-
.../remote/CreateUnixGroupCommand.java | 2 +-
.../command/remote/CreateUnixUserCommand.java | 6 +-
.../command/remote/DelUnixGroupCommand.java | 2 +-
.../command/remote/DelUnixUserCommand.java | 4 +-
.../remote/GenerateKeytabFileCommand.java | 6 +-
.../common/enums/ClusterCommandType.java | 4 +-
.../datasophon/common/enums/CommandType.java | 27 +-
.../datasophon/common/enums/InstallState.java | 17 +-
.../datasophon/common/enums/ReplyType.java | 2 +-
.../common/enums/ServiceRoleType.java | 14 +-
.../common/exception/AkkaRemoteException.java | 6 +-
.../lifecycle/ServerLifeCycleException.java | 4 +-
.../lifecycle/ServerLifeCycleManager.java | 22 +-
.../common/lifecycle/ServerStatus.java | 10 +-
.../common/model/AkkaRemoteReply.java | 11 +-
.../datasophon/common/model/AlertItem.java | 14 +-
.../datasophon/common/model/CheckResult.java | 6 +-
.../datasophon/common/model/ConfigWriter.java | 2 +-
.../java/com/datasophon/common/model/DAG.java | 158 +++---
.../com/datasophon/common/model/DAGGraph.java | 94 ++--
.../common/model/ExecCmdResult.java | 12 +-
.../datasophon/common/model/ExternalLink.java | 6 +-
.../datasophon/common/model/Generators.java | 14 +-
.../com/datasophon/common/model/HostInfo.java | 26 +-
.../common/model/HostServiceRoleMapping.java | 5 +-
.../com/datasophon/common/model/ProcInfo.java | 12 +-
.../datasophon/common/model/PromDataInfo.java | 4 +-
.../common/model/PromMetricInfo.java | 15 +-
.../common/model/PromResponceInfo.java | 4 +-
.../common/model/PromResultInfo.java | 6 +-
.../com/datasophon/common/model/RunAs.java | 4 +-
.../common/model/ServiceConfig.java | 38 +-
.../model/ServiceExecuteResultMessage.java | 12 +-
.../datasophon/common/model/ServiceInfo.java | 26 +-
.../datasophon/common/model/ServiceNode.java | 8 +-
.../common/model/ServiceNodeEdge.java | 2 +-
.../common/model/ServiceRoleHostMapping.java | 4 +-
.../common/model/ServiceRoleInfo.java | 54 +-
.../common/model/ServiceRoleRunner.java | 6 +-
.../common/model/SimpleServiceConfig.java | 6 +-
.../common/model/StartWorkerMessage.java | 6 +-
.../model/StartWorkerMessageConfirmed.java | 4 +-
.../model/UpdateCommandHostMessage.java | 10 +-
.../common/model/UpdateCommandMessage.java | 4 +-
.../common/model/WorkerServiceMessage.java | 17 +-
.../common/utils/CollectionUtils.java | 53 +-
.../common/utils/EncryptionUtils.java | 9 +-
.../datasophon/common/utils/ExecResult.java | 18 +-
.../datasophon/common/utils/FileUtils.java | 42 +-
.../datasophon/common/utils/HostUtils.java | 24 +-
.../com/datasophon/common/utils/IOUtils.java | 2 +-
.../datasophon/common/utils/OlapUtils.java | 41 +-
.../common/utils/PlaceholderUtils.java | 18 +-
.../common/utils/PromInfoUtils.java | 20 +-
.../common/utils/PropertyUtils.java | 49 +-
.../com/datasophon/common/utils/Result.java | 29 +-
.../datasophon/common/utils/ShellUtils.java | 45 +-
.../common/utils/ThrowableUtils.java | 2 +-
datasophon-domain/pom.xml | 11 +-
.../alert/gateway/AlertHistoryGateway.java | 7 +-
.../domain/alert/model/AlertHistory.java | 4 +-
.../domain/alert/model/AlertLabels.java | 4 +-
.../domain/alert/model/AlertMessage.java | 8 +-
.../datasophon/domain/alert/model/Alerts.java | 2 +-
.../domain/alert/model/Annotations.java | 4 +-
.../domain/host/enums/HostState.java | 18 +-
.../datasophon/domain/host/enums/MANAGED.java | 18 +-
.../domain/host/model/DynamicHostProp.java | 6 +-
.../datasophon/domain/host/model/Host.java | 16 +-
.../domain/host/model/ServiceRole.java | 4 +-
.../dao/alert/AlertHistoryGatewayImpl.java | 24 +-
.../dao/entity/AlertGroupEntity.java | 12 +-
.../dao/entity/ClusterAlertExpression.java | 6 +-
.../dao/entity/ClusterAlertGroupMap.java | 6 +-
.../dao/entity/ClusterAlertHistory.java | 16 +-
.../dao/entity/ClusterAlertQuota.java | 16 +-
.../dao/entity/ClusterAlertRule.java | 6 +-
.../datasophon/dao/entity/ClusterGroup.java | 12 +-
.../datasophon/dao/entity/ClusterHostDO.java | 22 +-
.../dao/entity/ClusterInfoEntity.java | 10 +-
.../dao/entity/ClusterNodeLabelEntity.java | 6 +-
.../dao/entity/ClusterQueueCapacity.java | 10 +-
.../datasophon/dao/entity/ClusterRack.java | 6 +-
.../dao/entity/ClusterRoleUserEntity.java | 6 +-
.../entity/ClusterServiceCommandEntity.java | 14 +-
...lusterServiceCommandHostCommandEntity.java | 20 +-
.../ClusterServiceCommandHostEntity.java | 10 +-
.../dao/entity/ClusterServiceDashboard.java | 6 +-
.../ClusterServiceInstanceConfigEntity.java | 10 +-
.../entity/ClusterServiceInstanceEntity.java | 18 +-
.../ClusterServiceInstanceRoleGroup.java | 8 +-
.../entity/ClusterServiceRoleGroupConfig.java | 6 +-
...lusterServiceRoleInstanceConfigEntity.java | 29 +-
.../ClusterServiceRoleInstanceEntity.java | 14 +-
.../ClusterServiceRoleInstanceWebuis.java | 10 +-
.../datasophon/dao/entity/ClusterUser.java | 14 +-
.../dao/entity/ClusterUserGroup.java | 10 +-
.../dao/entity/ClusterVariable.java | 15 +-
.../dao/entity/ClusterYarnQueue.java | 16 +-
.../dao/entity/ClusterYarnScheduler.java | 8 +-
.../com/datasophon/dao/entity/ClusterZk.java | 6 +-
.../dao/entity/FrameInfoEntity.java | 8 +-
.../dao/entity/FrameServiceEntity.java | 30 +-
.../dao/entity/FrameServiceRoleEntity.java | 18 +-
.../dao/entity/InstallStepEntity.java | 6 +-
.../dao/entity/NoticeGroupEntity.java | 6 +-
.../dao/entity/NoticeGroupUserEntity.java | 6 +-
.../datasophon/dao/entity/RoleInfoEntity.java | 6 +-
.../datasophon/dao/entity/SessionEntity.java | 6 +-
.../datasophon/dao/entity/UserInfoEntity.java | 8 +-
.../com/datasophon/dao/enums/AlertLevel.java | 18 +-
.../datasophon/dao/enums/ClusterState.java | 28 +-
.../datasophon/dao/enums/CommandState.java | 18 +-
.../com/datasophon/dao/enums/NeedRestart.java | 18 +-
.../com/datasophon/dao/enums/QuotaState.java | 18 +-
.../com/datasophon/dao/enums/RoleType.java | 17 +-
.../dao/enums/ServiceRoleState.java | 18 +-
.../datasophon/dao/enums/ServiceState.java | 18 +-
.../com/datasophon/dao/enums/UserType.java | 18 +-
.../dao/mapper/AlertGroupMapper.java | 2 +-
.../mapper/ClusterAlertExpressionMapper.java | 2 +-
.../mapper/ClusterAlertGroupMapMapper.java | 2 +-
.../dao/mapper/ClusterAlertHistoryMapper.java | 2 +-
.../dao/mapper/ClusterAlertQuotaMapper.java | 2 +-
.../dao/mapper/ClusterAlertRuleMapper.java | 2 +-
.../dao/mapper/ClusterGroupMapper.java | 2 +-
.../dao/mapper/ClusterHostMapper.java | 4 +-
.../dao/mapper/ClusterInfoMapper.java | 2 +-
.../mapper/ClusterQueueCapacityMapper.java | 2 +-
.../dao/mapper/ClusterRackMapper.java | 2 +-
.../dao/mapper/ClusterRoleUserMapper.java | 2 +-
...lusterServiceCommandHostCommandMapper.java | 2 +-
.../ClusterServiceCommandHostMapper.java | 2 +-
.../mapper/ClusterServiceCommandMapper.java | 2 +-
.../mapper/ClusterServiceDashboardMapper.java | 2 +-
.../ClusterServiceInstanceConfigMapper.java | 2 +-
.../mapper/ClusterServiceInstanceMapper.java | 2 +-
...ClusterServiceInstanceRoleGroupMapper.java | 2 +-
.../ClusterServiceRoleGroupConfigMapper.java | 2 +-
...lusterServiceRoleInstanceConfigMapper.java | 2 +-
.../ClusterServiceRoleInstanceMapper.java | 4 +-
...lusterServiceRoleInstanceWebuisMapper.java | 2 +-
.../dao/mapper/ClusterUserGroupMapper.java | 2 +-
.../dao/mapper/ClusterUserMapper.java | 2 +-
.../dao/mapper/ClusterVariableMapper.java | 2 +-
.../dao/mapper/ClusterYarnQueueMapper.java | 2 +-
.../mapper/ClusterYarnSchedulerMapper.java | 2 +-
.../dao/mapper/ClusterZkMapper.java | 2 +-
.../dao/mapper/FrameInfoMapper.java | 2 +-
.../dao/mapper/FrameServiceMapper.java | 2 +-
.../dao/mapper/FrameServiceRoleMapper.java | 2 +-
.../dao/mapper/InstallStepMapper.java | 2 +-
.../dao/mapper/NoticeGroupUserMapper.java | 2 +-
.../datasophon/dao/mapper/RoleInfoMapper.java | 2 +-
.../datasophon/dao/mapper/SessionMapper.java | 6 +-
.../datasophon/dao/mapper/UserInfoMapper.java | 2 +-
.../dao/model/ClusterQueueCapacityList.java | 6 +-
.../com/datasophon/dao/model/ComponentVO.java | 12 +-
.../java/com/datasophon/dao/model/Links.java | 4 +-
.../datasophon/dao/model/ParcelInfoVO.java | 22 +-
.../dao/model/ServiceOperateModel.java | 6 +-
datasophon-service/pom.xml | 15 +-
.../java/com/datasophon/api/enums/Status.java | 25 +-
.../api/exceptions/BusinessException.java | 21 +-
.../api/exceptions/ServiceException.java | 15 +-
.../com/datasophon/api/load/ConfigBean.java | 4 +-
.../datasophon/api/load/GlobalVariables.java | 8 +-
.../datasophon/api/load/LoadServiceMeta.java | 199 ++++---
.../api/load/ServiceConfigFileMap.java | 8 +-
.../datasophon/api/load/ServiceConfigMap.java | 8 +-
.../datasophon/api/load/ServiceInfoMap.java | 8 +-
.../api/load/ServiceRoleJmxMap.java | 8 +-
.../datasophon/api/load/ServiceRoleMap.java | 8 +-
.../com/datasophon/api/master/ActorUtils.java | 66 +--
.../api/master/CancelCommandMap.java | 7 +-
.../datasophon/api/master/ClusterActor.java | 83 +--
.../datasophon/api/master/DAGBuildActor.java | 58 +-
.../api/master/DispatcherWorkerActor.java | 35 +-
.../datasophon/api/master/HdfsECActor.java | 6 +-
.../datasophon/api/master/HostCheckActor.java | 273 ++++-----
.../api/master/HostConnectActor.java | 14 +-
.../api/master/MasterNodeProcessingActor.java | 14 +-
.../api/master/MasterServiceActor.java | 32 +-
.../api/master/PrometheusActor.java | 72 +--
.../com/datasophon/api/master/RackActor.java | 10 +-
.../api/master/RemoteEventActor.java | 4 +-
.../api/master/ServiceCommandActor.java | 72 +--
.../api/master/ServiceExecuteResultActor.java | 18 +-
.../api/master/SubmitTaskNodeActor.java | 18 +-
.../api/master/WorkerServiceActor.java | 18 +-
.../api/master/WorkerStartActor.java | 71 +--
.../api/master/alert/AlertActor.java | 78 +--
.../master/alert/ServiceRoleCheckActor.java | 17 +-
.../handler/host/CheckWorkerMd5Handler.java | 2 +-
.../handler/host/DecompressWorkerHandler.java | 4 +-
.../handler/host/DispatcherWorkerHandler.java | 2 +-
.../host/DispatcherWorkerHandlerChain.java | 6 +-
.../handler/host/InstallJDKHandler.java | 6 +-
.../handler/host/StartWorkerHandler.java | 24 +-
.../handler/host/UploadWorkerHandler.java | 4 +-
.../service/ServiceConfigureAsyncHandler.java | 92 ++--
.../service/ServiceConfigureHandler.java | 4 +-
.../handler/service/ServiceHandler.java | 6 +-
.../service/ServiceInstallHandler.java | 12 +-
.../handler/service/ServiceStartHandler.java | 32 +-
.../handler/service/ServiceStopHandler.java | 10 +-
.../api/service/AlertGroupService.java | 7 +-
.../ClusterAlertExpressionService.java | 5 +-
.../service/ClusterAlertGroupMapService.java | 5 +-
.../service/ClusterAlertHistoryService.java | 11 +-
.../api/service/ClusterAlertQuotaService.java | 13 +-
.../api/service/ClusterAlertRuleService.java | 5 +-
.../api/service/ClusterGroupService.java | 17 +-
.../api/service/ClusterInfoService.java | 19 +-
.../api/service/ClusterKerberosService.java | 9 +-
.../api/service/ClusterNodeLabelService.java | 13 +-
.../service/ClusterQueueCapacityService.java | 9 +-
.../api/service/ClusterRackService.java | 11 +-
.../api/service/ClusterRoleUserService.java | 9 +-
...usterServiceCommandHostCommandService.java | 21 +-
.../ClusterServiceCommandHostService.java | 13 +-
.../service/ClusterServiceCommandService.java | 21 +-
.../ClusterServiceDashboardService.java | 5 +-
.../ClusterServiceInstanceConfigService.java | 9 +-
...lusterServiceInstanceRoleGroupService.java | 19 +-
.../ClusterServiceInstanceService.java | 21 +-
.../ClusterServiceRoleGroupConfigService.java | 11 +-
...usterServiceRoleInstanceConfigService.java | 5 +-
.../ClusterServiceRoleInstanceService.java | 50 +-
...usterServiceRoleInstanceWebuisService.java | 17 +-
.../api/service/ClusterUserGroupService.java | 13 +-
.../api/service/ClusterUserService.java | 13 +-
.../api/service/ClusterVariableService.java | 7 +-
.../api/service/ClusterYarnQueueService.java | 7 +-
.../service/ClusterYarnSchedulerService.java | 7 +-
.../api/service/ClusterZkService.java | 7 +-
.../api/service/FrameInfoService.java | 5 +-
.../api/service/FrameServiceRoleService.java | 15 +-
.../api/service/FrameServiceService.java | 15 +-
.../api/service/InstallService.java | 23 +-
.../api/service/NoticeGroupUserService.java | 5 +-
.../api/service/RoleInfoService.java | 5 +-
.../api/service/ServiceInstallService.java | 23 +-
.../api/service/ServiceOperateStrategy.java | 2 +-
.../api/service/SessionService.java | 9 +-
.../api/service/UserInfoService.java | 9 +-
.../api/service/host/ClusterHostService.java | 25 +-
.../host/dto/QueryHostListPageDTO.java | 11 +-
.../host/impl/ClusterHostServiceImpl.java | 98 ++--
.../service/impl/AlertGroupServiceImpl.java | 31 +-
.../ClusterAlertExpressionServiceImpl.java | 6 +-
.../impl/ClusterAlertGroupMapServiceImpl.java | 6 +-
.../impl/ClusterAlertHistoryServiceImpl.java | 35 +-
.../impl/ClusterAlertQuotaServiceImpl.java | 71 +--
.../impl/ClusterAlertRuleServiceImpl.java | 6 +-
.../service/impl/ClusterGroupServiceImpl.java | 61 ++-
.../service/impl/ClusterInfoServiceImpl.java | 106 ++--
.../impl/ClusterKerberosServiceImpl.java | 57 +-
.../impl/ClusterNodeLabelServiceImpl.java | 54 +-
.../impl/ClusterQueueCapacityServiceImpl.java | 48 +-
.../service/impl/ClusterRackServiceImpl.java | 24 +-
.../impl/ClusterRoleUserServiceImpl.java | 24 +-
...rServiceCommandHostCommandServiceImpl.java | 62 ++-
.../ClusterServiceCommandHostServiceImpl.java | 28 +-
.../ClusterServiceCommandServiceImpl.java | 96 ++--
.../ClusterServiceDashboardServiceImpl.java | 12 +-
...usterServiceInstanceConfigServiceImpl.java | 22 +-
...erServiceInstanceRoleGroupServiceImpl.java | 50 +-
.../ClusterServiceInstanceServiceImpl.java | 102 ++--
...sterServiceRoleGroupConfigServiceImpl.java | 16 +-
...rServiceRoleInstanceConfigServiceImpl.java | 6 +-
...ClusterServiceRoleInstanceServiceImpl.java | 103 ++--
...rServiceRoleInstanceWebuisServiceImpl.java | 32 +-
.../impl/ClusterUserGroupServiceImpl.java | 24 +-
.../service/impl/ClusterUserServiceImpl.java | 67 +--
.../impl/ClusterVariableServiceImpl.java | 19 +-
.../impl/ClusterYarnQueueServiceImpl.java | 43 +-
.../impl/ClusterYarnSchedulerServiceImpl.java | 10 +-
.../service/impl/ClusterZkServiceImpl.java | 14 +-
.../service/impl/FrameInfoServiceImpl.java | 20 +-
.../impl/FrameServiceRoleServiceImpl.java | 34 +-
.../service/impl/FrameServiceServiceImpl.java | 32 +-
.../api/service/impl/InstallServiceImpl.java | 118 ++--
.../impl/NoticeGroupUserServiceImpl.java | 6 +-
.../api/service/impl/RoleInfoServiceImpl.java | 6 +-
.../impl/ServiceInstallServiceImpl.java | 250 +++++----
.../api/service/impl/SessionServiceImpl.java | 62 ++-
.../api/service/impl/UserInfoServiceImpl.java | 35 +-
.../strategy/AlertManagerHandlerStrategy.java | 23 +-
.../api/strategy/BEHandlerStartegy.java | 31 +-
.../ElasticSearchHandlerStrategy.java | 39 +-
.../api/strategy/FEHandlerStartegy.java | 37 +-
.../strategy/FEObserverHandlerStartegy.java | 31 +-
.../api/strategy/FlinkHandlerStrategy.java | 24 +-
.../api/strategy/GrafanaHandlerStrategy.java | 20 +-
.../api/strategy/HBaseHandlerStrategy.java | 18 +-
.../HistoryServerHandlerStrategy.java | 21 +-
.../HiveMetaStroreHandlerStrategy.java | 21 +-
.../strategy/HiveServer2HandlerStrategy.java | 24 +-
.../api/strategy/HttpFsHandlerStrategy.java | 26 +-
.../strategy/JournalNodeHandlerStrategy.java | 27 +-
.../api/strategy/KAdminHandlerStrategy.java | 33 +-
.../api/strategy/KafkaHandlerStrategy.java | 18 +-
.../api/strategy/KerberosHandlerStrategy.java | 32 +-
.../api/strategy/Krb5KdcHandlerStrategy.java | 32 +-
.../strategy/KyuubiServerHandlerStrategy.java | 102 ++--
.../api/strategy/NameNodeHandlerStrategy.java | 55 +-
.../strategy/PrometheusHandlerStrategy.java | 32 +-
.../api/strategy/RMHandlerStrategy.java | 50 +-
.../strategy/RangerAdminHandlerStrategy.java | 53 +-
.../api/strategy/ServiceHandlerAbstract.java | 31 +-
.../api/strategy/ServiceRoleStrategy.java | 10 +-
.../strategy/ServiceRoleStrategyContext.java | 38 +-
.../api/strategy/TSHandlerStrategy.java | 24 +-
.../api/strategy/TrinoHandlerStrategy.java | 25 +-
.../api/strategy/ZKFCHandlerStrategy.java | 23 +-
.../api/strategy/ZkServerHandlerStrategy.java | 50 +-
.../com/datasophon/api/utils/CheckUtils.java | 30 +-
.../com/datasophon/api/utils/CommonUtils.java | 8 +-
.../api/utils/ExecuteShellScriptUtils.java | 19 +-
.../com/datasophon/api/utils/HadoopUtils.java | 12 +-
.../com/datasophon/api/utils/HttpUtils.java | 10 +-
.../api/utils/MessageResolverUtils.java | 13 +-
.../com/datasophon/api/utils/MinaUtils.java | 16 +-
.../datasophon/api/utils/PackageUtils.java | 6 +-
.../datasophon/api/utils/ProcessUtils.java | 254 +++++----
.../datasophon/api/utils/SecurityUtils.java | 18 +-
.../datasophon/api/utils/ServletUtils.java | 24 +-
.../com/datasophon/api/utils/SpringTool.java | 10 +-
.../worker/WorkerApplicationServer.java | 101 ++--
.../worker/actor/AlertConfigActor.java | 2 +-
.../worker/actor/CheckServiceStatusActor.java | 4 +-
.../worker/actor/ConfigureServiceActor.java | 11 +-
.../worker/actor/ExecuteCmdActor.java | 2 +-
.../worker/actor/FileOperateActor.java | 2 +-
.../worker/actor/InstallServiceActor.java | 26 +-
.../worker/actor/KerberosActor.java | 6 +-
.../com/datasophon/worker/actor/LogActor.java | 19 +-
.../datasophon/worker/actor/NMStateActor.java | 2 +-
.../datasophon/worker/actor/PingActor.java | 8 +-
.../datasophon/worker/actor/RMStateActor.java | 2 +-
.../worker/actor/RemoteEventActor.java | 4 +-
.../worker/actor/RestartServiceActor.java | 2 +-
.../worker/actor/StartServiceActor.java | 10 +-
.../worker/actor/StopServiceActor.java | 8 +-
.../worker/actor/SupervisorFunction.java | 2 +-
.../worker/actor/UnixGroupActor.java | 4 +-
.../worker/actor/UnixUserActor.java | 4 +-
.../datasophon/worker/actor/WorkerActor.java | 33 +-
.../handler/ConfigureServiceHandler.java | 77 +--
.../worker/handler/InstallServiceHandler.java | 122 +++--
.../worker/handler/ServiceHandler.java | 39 +-
.../worker/log/TaskLogDiscriminator.java | 27 +-
.../datasophon/worker/log/TaskLogFilter.java | 16 +-
.../strategy/AbstractHandlerStrategy.java | 13 +-
.../worker/strategy/BEHandlerStrategy.java | 19 +-
.../strategy/DSMasterHandlerStrategy.java | 43 +-
.../strategy/DataNodeHandlerStrategy.java | 15 +-
.../worker/strategy/FEHandlerStrategy.java | 22 +-
.../strategy/FEObserverHandlerStrategy.java | 16 +-
.../worker/strategy/FlinkHandlerStrategy.java | 17 +-
.../worker/strategy/HbaseHandlerStrategy.java | 11 +-
.../HistoryServerHandlerStrategy.java | 11 +-
.../strategy/HiveServer2HandlerStrategy.java | 17 +-
.../strategy/JournalNodeHandlerStrategy.java | 13 +-
.../strategy/KAdminHandlerStrategy.java | 8 +-
.../worker/strategy/KafkaHandlerStrategy.java | 11 +-
.../strategy/Krb5KdcHandlerStrategy.java | 8 +-
.../strategy/KyuubiServerHandlerStrategy.java | 80 +--
.../strategy/NameNodeHandlerStrategy.java | 14 +-
.../strategy/NodeManagerHandlerStrategy.java | 11 +-
.../strategy/RangerAdminHandlerStrategy.java | 15 +-
.../ResourceManagerHandlerStrategy.java | 11 +-
.../worker/strategy/ServiceRoleStrategy.java | 2 +-
.../strategy/ServiceRoleStrategyContext.java | 19 +-
.../strategy/TezServerHandlerStrategy.java | 19 +-
.../worker/strategy/ZKFCHandlerStrategy.java | 6 +-
.../strategy/ZkServerHandlerStrategy.java | 13 +-
.../strategy/resource/AppendLineStrategy.java | 20 +-
.../strategy/resource/DownloadStrategy.java | 28 +-
.../strategy/resource/EmptyStrategy.java | 5 +-
.../strategy/resource/LinkStrategy.java | 16 +-
.../strategy/resource/ReplaceStrategy.java | 24 +-
.../strategy/resource/ResourceStrategy.java | 14 +-
.../strategy/resource/ShellStrategy.java | 15 +-
.../datasophon/worker/utils/ActorUtils.java | 8 +-
.../datasophon/worker/utils/FileUtils.java | 4 +-
.../worker/utils/FreemakerUtils.java | 41 +-
.../worker/utils/KerberosUtils.java | 14 +-
.../worker/utils/TaskConstants.java | 48 +-
.../datasophon/worker/utils/UnixUtils.java | 32 +-
.../handler/ConfigureServiceHandlerTest.java | 2 +-
.../handler/InstallServiceHandlerTest.java | 2 +-
.../worker/test/FreemarkerTest.java | 28 +-
.../worker/test/MutilTemplateFileTest.java | 2 +-
docs/zh/ApacheKyuubi.md | 7 +-
...36\345\212\240\347\224\250\346\210\267.md" | 4 -
...hive on spark \346\250\241\345\274\217.md" | 21 +-
...atasophon\351\233\206\346\210\220Dinky.md" | 4 -
...atasophon\351\233\206\346\210\220Flume.md" | 14 +
...atasophon\351\233\206\346\210\220Minio.md" | 30 +
...asophon\351\233\206\346\210\220alluxio.md" | 22 +-
...phon\351\233\206\346\210\220clickhouse.md" | 23 +-
...hon\351\233\206\346\210\220hbase-2.5.6.md" | 32 +-
...sophon\351\233\206\346\210\220openldap.md" | 40 ++
...tasophon\351\233\206\346\210\220paimon.md" | 32 +-
...tasophon\351\233\206\346\210\220presto.md" | 82 ++-
...atasophon\351\233\206\346\210\220redis.md" | 32 ++
...ophon\351\233\206\346\210\220seatunnel.md" | 20 +-
...sophon\351\233\206\346\210\220zeppelin.md" | 18 +
....8\345\256\211\350\243\205\345\214\205.md" | 20 +-
....1\345\256\211\350\243\205\345\214\205.md" | 36 +-
...72\247flink1.15\345\210\260flink1.16.2.md" | 17 +
...7\347\272\247spark3.1\345\210\2603.2.2.md" | 18 +
pom.xml | 217 +++++---
style/checkstyle-suppressions.xml | 20 +-
style/checkstyle.xml | 516 ++++++++++++------
style/spotless_datasophon_formatter.xml | 58 +-
510 files changed, 6749 insertions(+), 5453 deletions(-)
diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml
index e972ab23..99ae42c9 100644
--- a/.github/workflows/maven.yaml
+++ b/.github/workflows/maven.yaml
@@ -34,12 +34,13 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
-# - name: Check Style
-# run: |
-# ./mvnw -T 2C -B --no-snapshot-updates clean checkstyle:check
+ - name: Check Code Style
+ run: |
+ ./mvnw -T 2C -B --no-snapshot-updates clean checkstyle:check
- name: Build and Package
run: |
- ./mvnw -Pgoogle-mirror -B clean install \
- -Dmaven.test.skip=true \
- --no-snapshot-updates \
- -pl !datasophon-ui,!datasophon-api,!datasophon-service -am
+ ./mvnw -Pgoogle-mirror -B clean package \
+ -Dmaven.test.skip=true \
+ -Dspotless.check.skip=true \
+ --no-snapshot-updates \
+ -pl !datasophon-ui,!datasophon-api,!datasophon-service -am
diff --git a/datasophon-api/pom.xml b/datasophon-api/pom.xml
index 54751c07..e38e9164 100644
--- a/datasophon-api/pom.xml
+++ b/datasophon-api/pom.xml
@@ -31,6 +31,10 @@
8
+
+ cn.hutool
+ hutool-all
+
com.datasophon
datasophon-service
@@ -49,7 +53,8 @@
src/main/resources
- front/**
+ front/**
+
@@ -72,7 +77,8 @@
${project.basedir}/src/main/resources
- front/**
+ front/**
+
diff --git a/datasophon-api/src/main/java/com/datasophon/api/DataSophonApplicationServer.java b/datasophon-api/src/main/java/com/datasophon/api/DataSophonApplicationServer.java
index d34958a7..efbff105 100644
--- a/datasophon-api/src/main/java/com/datasophon/api/DataSophonApplicationServer.java
+++ b/datasophon-api/src/main/java/com/datasophon/api/DataSophonApplicationServer.java
@@ -17,10 +17,16 @@
package com.datasophon.api;
-import cn.hutool.extra.spring.EnableSpringUtil;
import com.datasophon.api.master.ActorUtils;
import com.datasophon.common.Constants;
import com.datasophon.common.cache.CacheUtils;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.security.NoSuchAlgorithmException;
+
+import javax.annotation.PostConstruct;
+
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -28,10 +34,7 @@
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
-import javax.annotation.PostConstruct;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.security.NoSuchAlgorithmException;
+import cn.hutool.extra.spring.EnableSpringUtil;
@SpringBootApplication
@ServletComponentScan
@@ -39,22 +42,22 @@
@MapperScan("com.datasophon.dao")
@EnableSpringUtil
public class DataSophonApplicationServer extends SpringBootServletInitializer {
-
+
public static void main(String[] args) {
SpringApplication.run(DataSophonApplicationServer.class, args);
- // add shutdown hook, close and shutdown resources
- Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+ // add shutdown hook, close and shutdown resources
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> {
shutdown();
}));
}
-
+
@PostConstruct
public void run() throws UnknownHostException, NoSuchAlgorithmException {
String hostName = InetAddress.getLocalHost().getHostName();
CacheUtils.put(Constants.HOSTNAME, hostName);
ActorUtils.init();
}
-
+
/**
* Master 关闭时调用
*/
diff --git a/datasophon-api/src/main/java/com/datasophon/api/configuration/AppConfiguration.java b/datasophon-api/src/main/java/com/datasophon/api/configuration/AppConfiguration.java
index 436867ee..a603bccf 100644
--- a/datasophon-api/src/main/java/com/datasophon/api/configuration/AppConfiguration.java
+++ b/datasophon-api/src/main/java/com/datasophon/api/configuration/AppConfiguration.java
@@ -41,12 +41,12 @@
*/
@Configuration
public class AppConfiguration implements WebMvcConfigurer {
-
+
public static final String LOGIN_INTERCEPTOR_PATH_PATTERN = "/**/*";
public static final String LOGIN_PATH_PATTERN = "/login";
public static final String PATH_PATTERN = "/**";
public static final String LOCALE_LANGUAGE_COOKIE = "language";
-
+
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
@@ -57,12 +57,12 @@ public CorsFilter corsFilter() {
configSource.registerCorsConfiguration(PATH_PATTERN, config);
return new CorsFilter(configSource);
}
-
+
@Bean
public LoginHandlerInterceptor loginInterceptor() {
return new LoginHandlerInterceptor();
}
-
+
/**
* Cookie
* @return local resolver
@@ -77,17 +77,17 @@ public LocaleResolver localeResolver() {
localeResolver.setLanguageTagCompliant(false);
return localeResolver;
}
-
+
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
return new LocaleChangeInterceptor();
}
-
+
@Bean
public UserPermissionHandler userPermissionHandler() {
return new UserPermissionHandler();
}
-
+
@Override
public void addInterceptors(InterceptorRegistry registry) {
// i18n
@@ -104,7 +104,7 @@ public void addInterceptors(InterceptorRegistry registry) {
"/",
"/static/**");
}
-
+
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**")
@@ -114,13 +114,13 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/ui/**").addResourceLocations("file:ui/");
}
-
+
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/ui/").setViewName("forward:/ui/index.html");
registry.addViewController("/").setViewName("index");
}
-
+
/**
* Turn off suffix-based content negotiation
*
@@ -130,5 +130,5 @@ public void addViewControllers(ViewControllerRegistry registry) {
public void configureContentNegotiation(final ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
-
+
}
diff --git a/datasophon-api/src/main/java/com/datasophon/api/configuration/ConfigPropertiesExtend.java b/datasophon-api/src/main/java/com/datasophon/api/configuration/ConfigPropertiesExtend.java
index 7f8ea718..6b4c48bd 100644
--- a/datasophon-api/src/main/java/com/datasophon/api/configuration/ConfigPropertiesExtend.java
+++ b/datasophon-api/src/main/java/com/datasophon/api/configuration/ConfigPropertiesExtend.java
@@ -1,8 +1,21 @@
package com.datasophon.api.configuration;
import com.datasophon.common.utils.FileUtils;
-import lombok.extern.slf4j.Slf4j;
+
import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import lombok.extern.slf4j.Slf4j;
+
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.env.YamlPropertySourceLoader;
@@ -13,18 +26,13 @@
import org.springframework.core.io.FileSystemResource;
import org.springframework.util.CollectionUtils;
-import java.io.File;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.util.*;
-
@Slf4j
public class ConfigPropertiesExtend implements EnvironmentPostProcessor {
-
+
private static final String CONFIG_HOME = "conf/datasophon.conf";
-
+
private static final String DEFAULT_APPLICATION_CONFIG = "conf/profiles/application-config.yml";
-
+
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
MutablePropertySources propertySources = environment.getPropertySources();
@@ -32,14 +40,15 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp
checkProfile(environment);
propertySources.addFirst(new PropertiesPropertySource("datasophonConfig", properties));
}
-
+
private Properties loadCustomProperties() {
Properties properties = new Properties();
File file = new File(FileUtils.concatPath(System.getProperty("user.dir"), CONFIG_HOME));
try (InputStream inputStream = Files.newInputStream(file.toPath())) {
properties.load(inputStream);
} catch (Exception e) {
- System.err.println("Failed to load the datart configuration (config/datart.conf), use application-config.yml");
+ System.err.println(
+ "Failed to load the datart configuration (config/datart.conf), use application-config.yml");
return new Properties();
}
List
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
ch.qos.logback
@@ -88,116 +88,116 @@
${hadoop.version}
- jetty-util
org.mortbay.jetty
+ jetty-util
- jetty
org.mortbay.jetty
+ jetty
org.mortbay.jetty
jetty-sslengine
- jasper-compiler
tomcat
+ jasper-compiler
- apacheds-kerberos-codec
org.apache.directory.server
+ apacheds-kerberos-codec
- servlet-api
javax.servlet
+ servlet-api
- jsp-api
javax.servlet.jsp
+ jsp-api
- jets3t
net.java.dev.jets3t
+ jets3t
- jasper-runtime
tomcat
+ jasper-runtime
- avro
org.apache.avro
+ avro
- httpcore
org.apache.httpcomponents
+ httpcore
- hadoop-auth
org.apache.hadoop
+ hadoop-auth
- activation
javax.activation
+ activation
- slf4j-api
org.slf4j
+ slf4j-api
- guava
com.google.guava
+ guava
- commons-cli
commons-cli
+ commons-cli
- jersey-server
com.sun.jersey
+ jersey-server
- jersey-json
com.sun.jersey
+ jersey-json
- jersey-core
com.sun.jersey
+ jersey-core
- jackson-core-asl
org.codehaus.jackson
+ jackson-core-asl
- jackson-mapper-asl
org.codehaus.jackson
+ jackson-mapper-asl
- slf4j-log4j12
org.slf4j
+ slf4j-log4j12
- commons-logging
commons-logging
+ commons-logging
- httpclient
org.apache.httpcomponents
+ httpclient
- commons-lang
commons-lang
+ commons-lang
- jsch
com.jcraft
+ jsch
- slf4j-reload4j
org.slf4j
+ slf4j-reload4j
- reload4j
ch.qos.reload4j
+ reload4j
@@ -207,40 +207,40 @@
${hadoop.version}
- apacheds-kerberos-codec
org.apache.directory.server
+ apacheds-kerberos-codec
- slf4j-log4j12
org.slf4j
+ slf4j-log4j12
- log4j
log4j
+ log4j
- httpclient
org.apache.httpcomponents
+ httpclient
- slf4j-api
org.slf4j
+ slf4j-api
- guava
com.google.guava
+ guava
- nimbus-jose-jwt
com.nimbusds
+ nimbus-jose-jwt
- reload4j
ch.qos.reload4j
+ reload4j
- slf4j-reload4j
org.slf4j
+ slf4j-reload4j
diff --git a/datasophon-common/src/main/java/com/datasophon/common/Constants.java b/datasophon-common/src/main/java/com/datasophon/common/Constants.java
index 6bc8207a..baa13418 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/Constants.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/Constants.java
@@ -25,32 +25,32 @@
* Constants
*/
public final class Constants {
-
+
public static final String INSTALL_PATH = PropertyUtils.getString("install.path");
public static final String DATA = "data";
public static final String INSTALL_TYPE = "install_type";
public static final String TOTAL = "total";
-
+
public static final String DATASOPHON = "datasophon";
-
+
public static final String HOST_MAP = "_host_map";
public static final String COMMAND_HOST_ID = "command_host_id";
public static final String HOST_MD5 = "_host_md5";
public static final String ID_RSA = PropertyUtils.getString("id_rsa", "/.ssh/id_rsa");
public static final String HOSTNAME = "hostname";
-
+
public static final String MASTER_MANAGE_PACKAGE_PATH = INSTALL_PATH + "/DDP/packages";
public static final String UNZIP_DDH_WORKER_CMD =
"tar -zxvf " + INSTALL_PATH + "/datasophon-worker.tar.gz -C " + INSTALL_PATH;
public static final String START_DDH_WORKER_CMD = "service datasophon-worker restart";
-
+
public static final String WORKER_PACKAGE_NAME = "datasophon-worker.tar.gz";
public static final String WORKER_SCRIPT_PATH = INSTALL_PATH + "/datasophon-worker/script/";
public static final String WORKER_PATH = INSTALL_PATH + "/datasophon-worker";
public static final String SHELL_SCRIPT_PATH = "/scripts";
-
+
public static final String META_PATH = "meta";
-
+
public static final String CLUSTER_ID = "cluster_id";
public static final String MANAGED = "managed";
public static final String JSON = "json";
@@ -78,9 +78,9 @@ public final class Constants {
public static final String UPDATE_COMMON_CMD = "sh " + INSTALL_PATH + "/datasophon-worker/script/sed_common.sh ";
public static final String MASTER_HOST = "masterHost";
public static final String MASTER_WEB_PORT = "masterWebPort";
-
+
public static final String HOST_COMMAND_ID = "host_command_id";
-
+
public static final String CONFIG_VERSION = "config_version";
public static final String HAS_EN = ".*[a-zA-z].*";
public static final String ALERT_TARGET_NAME = "alert_target_name";
@@ -91,7 +91,7 @@ public final class Constants {
public static final String MULTIPLE = "multiple";
public static final String CLUSTER_STATE = "cluster_state";
public static final String PATH = "path";
-
+
public static final String MV_PATH = "mv_path";
public static final String SERVICE_INSTANCE_ID = "service_instance_id";
public static final String IS_ENABLED = "is_enabled";
@@ -109,7 +109,7 @@ public final class Constants {
public static final String ROLE_GROUP_ID = "role_group_id";
public static final String ROLE_GROUP_TYPE = "role_group_type";
public static final String NEET_RESTART = "need_restart";
-
+
public static final String CPU_ARCHITECTURE = "cpu_architecture";
public static final String HOST_STATE = "host_state";
public static final String FAILED = "failed";
@@ -122,45 +122,45 @@ public final class Constants {
public static final String RACK = "rack";
public static final String SERVICE_STATE = "service_state";
public static final String EQUAL_SIGN = "=";
-
+
private Constants() {
throw new IllegalStateException("Constants Exception");
}
-
+
public static final String USERNAME = "username";
-
+
public static final String PASSWORD = "password";
/**
* session user
*/
public static final String SESSION_USER = "session.user";
-
+
public static final String SESSION_ID = "sessionId";
/**
* session timeout
*/
public static final int SESSION_TIME_OUT = 7200;
-
+
/**
* http header
*/
public static final String HTTP_HEADER_UNKNOWN = "unKnown";
-
+
/**
* http X-Forwarded-For
*/
public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For";
-
+
/**
* http X-Real-IP
*/
public static final String HTTP_X_REAL_IP = "X-Real-IP";
-
+
/**
* UTF-8
*/
public static final String UTF_8 = "UTF-8";
-
+
/**
* user name regex
*/
@@ -169,17 +169,17 @@ private Constants() {
* comma ,
*/
public static final String COMMA = ",";
-
+
/**
* slash /
*/
public static final String SLASH = "/";
-
+
/**
* SPACE " "
*/
public static final String SPACE = " ";
-
+
/**
* SINGLE_SLASH /
*/
@@ -188,68 +188,69 @@ private Constants() {
* status
*/
public static final String STATUS = "status";
-
+
/**
* message
*/
public static final String MSG = "msg";
-
+
public static final String REGEX_VARIABLE = "\\$\\{(.*?)\\}";
-
+
/**
* email regex
*/
public static final Pattern REGEX_MAIL_NAME =
Pattern.compile("^([a-z0-9A-Z]+[_|\\-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
-
+
/**
* 常量-数值100
*/
public static final int ONE_HUNDRRD = 100;
-
+
/**
* 常量-数值200
*/
public static final int TWO_HUNDRRD = 200;
-
+
/**
* 常量-数值10
*/
public static final int TEN = 10;
-
+
/**
* 常量-zkserver
*/
public static final String ZKSERVER = "zkserver";
-
+
public static final String CENTER_BRACKET_LEFT = "[";
-
+
public static final String CENTER_BRACKET_RIGHT = "]";
/**
* 常量-连接号
*/
public static final String HYPHEN = "-";
-
+
public static final String TASK_MANAGER = "taskmanager";
public static final String JOB_MANAGER = "jobmanager";
- public static final String x86_64 = "x86_64";
+ public static final String X86_64 = "x86_64";
+
public static final String PROMETHEUS = "prometheus";
-
+
public static final String XML = "xml";
public static final String PROPERTIES = "properties";
public static final String PROPERTIES2 = "properties2";
public static final String PROPERTIES3 = "properties3";
-
+
/**
* os name properties
*/
public static final String OSNAME_PROPERTIES = "os.name";
-
+
/**
* windows os name
*/
public static final String OSNAME_WINDOWS = "Windows";
-
+
/**
* windows hosts file basedir
*/
@@ -258,6 +259,6 @@ private Constants() {
* root user
*/
public static final String ROOT = "root";
-
+
public static final String DISPATCHER_WORK = "dispatcher-worker.sh";
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/cache/CacheUtils.java b/datasophon-common/src/main/java/com/datasophon/common/cache/CacheUtils.java
index e0b5d3e7..af209914 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/cache/CacheUtils.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/cache/CacheUtils.java
@@ -27,40 +27,40 @@
* Cache工具类
*/
public class CacheUtils {
-
+
private static Logger logger = LoggerFactory.getLogger(CacheUtils.class);
private static Cache cache = CacheUtil.newLRUCache(4096);
-
+
public static Object get(String key) {
Object data = cache.get(key);
return data;
- };
-
+ }
+
public static void put(String key, Object value) {
cache.put(key, value);
}
-
+
public static boolean constainsKey(String key) {
return cache.containsKey(key);
}
-
+
public static void removeKey(String key) {
cache.remove(key);
}
-
+
public static Integer getInteger(String key) {
Object data = cache.get(key);
return (Integer) data;
}
-
+
public static Boolean getBoolean(String key) {
Object data = cache.get(key);
return (Boolean) data;
}
-
+
public static String getString(String key) {
Object data = cache.get(key);
return (String) data;
}
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommand.java
index 2d42e50e..a786455b 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommand.java
@@ -26,28 +26,28 @@
@Data
public class BaseCommand implements Serializable {
-
+
private static final long serialVersionUID = -1495156573211152639L;
-
+
private String frameCode;
-
+
private String serviceName;
-
+
private String serviceRoleName;
-
+
private ServiceRoleType serviceRoleType;
-
+
private String hostCommandId;
-
+
private String packageName;
-
+
private Integer clusterId;
-
+
private ServiceRoleRunner startRunner;
-
+
private ServiceRoleRunner stopRunner;
-
+
private ServiceRoleRunner statusRunner;
-
+
private ServiceRoleRunner restartRunner;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommandResult.java b/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommandResult.java
index c2a84448..2615adba 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommandResult.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/BaseCommandResult.java
@@ -23,8 +23,8 @@
@Data
public class BaseCommandResult implements Serializable {
-
+
private Boolean execResult;
-
+
private String execOut;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/CheckCommandExecuteProgressCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/CheckCommandExecuteProgressCommand.java
index 79560754..f688bfbf 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/CheckCommandExecuteProgressCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/CheckCommandExecuteProgressCommand.java
@@ -27,11 +27,11 @@
@Data
public class CheckCommandExecuteProgressCommand {
-
+
private List serviceRoleInfoList;
-
+
private Map completeTaskList;
-
+
public CheckCommandExecuteProgressCommand(Map completeTaskList,
List serviceRoleInfoList) {
this.completeTaskList = completeTaskList;
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/CheckServiceExecuteStateCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/CheckServiceExecuteStateCommand.java
index d93d4065..1792af0a 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/CheckServiceExecuteStateCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/CheckServiceExecuteStateCommand.java
@@ -26,11 +26,11 @@
@Data
public class CheckServiceExecuteStateCommand implements Serializable {
-
+
private ServiceNode serviceNode;
-
+
private ServiceRoleType serviceRoleType;
-
+
public CheckServiceExecuteStateCommand(ServiceNode serviceNode, ServiceRoleType serviceRoleType) {
this.serviceNode = serviceNode;
this.serviceRoleType = serviceRoleType;
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/ClusterCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/ClusterCommand.java
index b8b47627..55684d0f 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/ClusterCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/ClusterCommand.java
@@ -25,18 +25,18 @@
@Data
public class ClusterCommand implements Serializable {
-
+
private final ClusterCommandType commandType;
-
+
private Integer clusterId;
-
+
public ClusterCommand(ClusterCommandType commandType) {
this.commandType = commandType;
}
-
+
public ClusterCommand(ClusterCommandType commandType, Integer clusterId) {
this.commandType = commandType;
this.clusterId = clusterId;
}
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/DispatcherHostAgentCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/DispatcherHostAgentCommand.java
index d06fc1dc..935c6413 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/DispatcherHostAgentCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/DispatcherHostAgentCommand.java
@@ -23,13 +23,13 @@
@Data
public class DispatcherHostAgentCommand {
-
+
private HostInfo hostInfo;
-
+
private Integer clusterId;
-
+
private String clusterFrame;
-
+
public DispatcherHostAgentCommand(HostInfo hostInfo, Integer clusterId, String clusterFrame) {
this.hostInfo = hostInfo;
this.clusterId = clusterId;
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteCmdCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteCmdCommand.java
index 6d7a9187..ead54c79 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteCmdCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteCmdCommand.java
@@ -24,10 +24,10 @@
@Data
public class ExecuteCmdCommand implements Serializable {
-
+
private static final long serialVersionUID = 8665156195475027337L;
-
+
private List commands;
-
+
private String commandLine;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteServiceRoleCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteServiceRoleCommand.java
index 104f413f..5db8be89 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteServiceRoleCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/ExecuteServiceRoleCommand.java
@@ -31,34 +31,34 @@
@Data
public class ExecuteServiceRoleCommand {
-
+
private Integer clusterId;
-
+
private String clusterCode;
-
+
private String serviceName;
-
+
private List masterRoles;
-
+
private ServiceRoleInfo workerRole;
-
+
private ServiceRoleType serviceRoleType;
-
+
private CommandType commandType;
-
+
private DAGGraph dag;
-
+
private Map errorTaskList;
private Map activeTaskList;
private Map readyToSubmitTaskList;
private Map completeTaskList;
-
+
public ExecuteServiceRoleCommand(Integer clusterId, String serviceName, List serviceRoles) {
this.clusterId = clusterId;
this.serviceName = serviceName;
this.masterRoles = serviceRoles;
}
-
+
public ExecuteServiceRoleCommand() {
}
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/FileOperateCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/FileOperateCommand.java
index de86c1c2..0e097012 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/FileOperateCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/FileOperateCommand.java
@@ -24,10 +24,10 @@
@Data
public class FileOperateCommand implements Serializable {
-
+
private TreeSet lines;
-
+
private String content;
-
+
private String path;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateAlertConfigCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateAlertConfigCommand.java
index a6ca6f2f..fd56a3b2 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateAlertConfigCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateAlertConfigCommand.java
@@ -28,7 +28,7 @@
@Data
public class GenerateAlertConfigCommand implements Serializable {
-
+
HashMap> configFileMap;
Integer clusterId;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateHostPrometheusConfig.java b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateHostPrometheusConfig.java
index 4306b5f4..36fa5c66 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateHostPrometheusConfig.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateHostPrometheusConfig.java
@@ -23,6 +23,6 @@
@Data
public class GenerateHostPrometheusConfig implements Serializable {
-
+
private Integer clusterId;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GeneratePrometheusConfigCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/GeneratePrometheusConfigCommand.java
index 9fefa301..fd99b61b 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GeneratePrometheusConfigCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GeneratePrometheusConfigCommand.java
@@ -25,11 +25,11 @@
@Data
@Accessors(chain = true)
public class GeneratePrometheusConfigCommand implements Serializable {
-
+
private Integer serviceInstanceId;
-
+
private String clusterFrame;
-
+
private Integer clusterId;
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateRackPropCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateRackPropCommand.java
index 7e4870e3..909d80ac 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateRackPropCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateRackPropCommand.java
@@ -20,9 +20,10 @@
import java.io.Serializable;
import lombok.Data;
+
@Data
public class GenerateRackPropCommand implements Serializable {
-
+
private Integer clusterId;
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateSRPromConfigCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateSRPromConfigCommand.java
index be839b72..e6f98b7a 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateSRPromConfigCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateSRPromConfigCommand.java
@@ -23,13 +23,13 @@
@Data
public class GenerateSRPromConfigCommand implements Serializable {
-
+
private Integer serviceInstanceId;
-
+
private String clusterFrame;
-
+
private Integer clusterId;
-
+
private String filename;
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateServiceConfigCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateServiceConfigCommand.java
index 9021f1b1..9407ba4b 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateServiceConfigCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateServiceConfigCommand.java
@@ -29,18 +29,18 @@
@Data
public class GenerateServiceConfigCommand implements Serializable {
-
+
private static final long serialVersionUID = -4211566568993105684L;
-
+
private String serviceName;
-
+
private String decompressPackageName;
-
+
private Integer myid;
-
+
Map> cofigFileMap;
-
+
private String serviceRoleName;
-
+
private RunAs runAs;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateStarRocksHAMessage.java b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateStarRocksHAMessage.java
index f60e0217..e7992558 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GenerateStarRocksHAMessage.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GenerateStarRocksHAMessage.java
@@ -23,8 +23,8 @@
@Data
public class GenerateStarRocksHAMessage implements Serializable {
-
+
private Integer serviceInstanceId;
-
+
private Integer clusterId;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/GetLogCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/GetLogCommand.java
index 8751eaff..439e62db 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/GetLogCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/GetLogCommand.java
@@ -23,9 +23,9 @@
@Data
public class GetLogCommand implements Serializable {
-
+
private String logFile;
-
+
private String decompressPackageName;
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/HdfsEcCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/HdfsEcCommand.java
index fb1d0ea8..786d29ff 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/HdfsEcCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/HdfsEcCommand.java
@@ -23,6 +23,6 @@
@Data
public class HdfsEcCommand implements Serializable {
-
+
private Integer serviceInstanceId;
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/HostCheckCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/HostCheckCommand.java
index bf195108..2c203c3c 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/HostCheckCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/HostCheckCommand.java
@@ -23,16 +23,16 @@
@Data
public class HostCheckCommand {
-
+
private HostInfo hostInfo;
-
+
private String clusterCode;
-
+
public HostCheckCommand(HostInfo hostInfo, String clusterCode) {
this.hostInfo = hostInfo;
this.clusterCode = clusterCode;
}
-
+
public HostCheckCommand() {
}
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/HostInfoCollectResult.java b/datasophon-common/src/main/java/com/datasophon/common/command/HostInfoCollectResult.java
index 82afa5b1..bd67dc03 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/HostInfoCollectResult.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/HostInfoCollectResult.java
@@ -24,7 +24,7 @@
@Data
public class HostInfoCollectResult implements Serializable {
-
+
private static final long serialVersionUID = 4197649708954689128L;
private int coreNum;
private double totalMem;
@@ -36,5 +36,5 @@ public class HostInfoCollectResult implements Serializable {
private double diskUsedPersent;
private double averageLoad;
private String clusterCode;
-
+
}
diff --git a/datasophon-common/src/main/java/com/datasophon/common/command/InstallServiceRoleCommand.java b/datasophon-common/src/main/java/com/datasophon/common/command/InstallServiceRoleCommand.java
index 0556deaf..6bd78dae 100644
--- a/datasophon-common/src/main/java/com/datasophon/common/command/InstallServiceRoleCommand.java
+++ b/datasophon-common/src/main/java/com/datasophon/common/command/InstallServiceRoleCommand.java
@@ -21,31 +21,32 @@
import com.datasophon.common.model.Generators;
import com.datasophon.common.model.RunAs;
import com.datasophon.common.model.ServiceConfig;
-import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
+import lombok.Data;
+
@Data
public class InstallServiceRoleCommand extends BaseCommand implements Serializable {
-
+
private static final long serialVersionUID = -8610024764701745463L;
-
+
private Map> cofigFileMap;
-
+
private Long deliveryId;
-
+
private Integer normalSize;
-
+
private String packageMd5;
-
+
private String decompressPackageName;
-
+
private RunAs runAs;
-
+
private ServiceRoleType serviceRoleType;
-
- private List
-
\ No newline at end of file
+
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/alert/gateway/AlertHistoryGateway.java b/datasophon-domain/src/main/java/com/datasophon/domain/alert/gateway/AlertHistoryGateway.java
index 606592ea..347faaca 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/alert/gateway/AlertHistoryGateway.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/alert/gateway/AlertHistoryGateway.java
@@ -3,11 +3,12 @@
import com.datasophon.domain.alert.model.AlertHistory;
public interface AlertHistoryGateway {
+
boolean hasEnabledAlertHistory(String alertname, int clusterId, String hostname);
-
+
AlertHistory getEnabledAlertHistory(String alertname, int clusterId, String hostname);
-
+
void updateAlertHistoryToDisabled(Integer id);
-
+
boolean nodeHasWarnAlertList(String hostname, String serviceRoleName, Integer id);
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertHistory.java b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertHistory.java
index 715eaa0b..20ef0b61 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertHistory.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertHistory.java
@@ -1,10 +1,12 @@
package com.datasophon.domain.alert.model;
+import java.util.Date;
+
import lombok.Data;
-import java.util.Date;
@Data
public class AlertHistory {
+
/**
* 主键
*/
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertLabels.java b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertLabels.java
index e9f9200f..3b866bd7 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertLabels.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertLabels.java
@@ -22,12 +22,12 @@
@Data
public class AlertLabels {
-
+
private String alertname;
private int clusterId;
private String serviceRoleName;
private String instance;
private String job;
private String severity;
-
+
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertMessage.java b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertMessage.java
index 16e63e76..18b4c5ae 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertMessage.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/AlertMessage.java
@@ -18,13 +18,13 @@
package com.datasophon.domain.alert.model;
-import lombok.Data;
-
import java.util.List;
+import lombok.Data;
+
@Data
public class AlertMessage {
-
+
private String receiver;
private String status;
private List alerts;
@@ -32,5 +32,5 @@ public class AlertMessage {
private String version;
private String groupKey;
private int truncatedAlerts;
-
+
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Alerts.java b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Alerts.java
index b25164a8..1b685b59 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Alerts.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Alerts.java
@@ -22,7 +22,7 @@
@Data
public class Alerts {
-
+
private String status;
private AlertLabels labels;
private String startsAt;
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Annotations.java b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Annotations.java
index dd90cfe6..26cb7e9f 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Annotations.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/alert/model/Annotations.java
@@ -22,8 +22,8 @@
@Data
public class Annotations {
-
+
private String description;
private String summary;
-
+
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/HostState.java b/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/HostState.java
index 3a947e9d..1f0e1339 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/HostState.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/HostState.java
@@ -21,38 +21,38 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum HostState {
-
+
RUNNING(1, "正在运行"),
OFFLINE(2, "掉线"),
EXISTS_ALARM(3, "存在告警");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
HostState(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/MANAGED.java b/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/MANAGED.java
index 282be4a5..78e7a1f4 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/MANAGED.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/host/enums/MANAGED.java
@@ -20,34 +20,34 @@
import com.baomidou.mybatisplus.annotation.EnumValue;
public enum MANAGED {
-
+
YES(1, true),
NO(2, false);
-
+
@EnumValue
private int value;
-
+
private boolean desc;
-
+
MANAGED(int value, boolean desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
public boolean isDesc() {
return desc;
}
-
+
public void setDesc(boolean desc) {
this.desc = desc;
}
-
+
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/host/model/DynamicHostProp.java b/datasophon-domain/src/main/java/com/datasophon/domain/host/model/DynamicHostProp.java
index b273275e..914de4f6 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/host/model/DynamicHostProp.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/host/model/DynamicHostProp.java
@@ -1,13 +1,15 @@
package com.datasophon.domain.host.model;
import com.datasophon.domain.host.enums.HostState;
-import lombok.Data;
import java.util.Date;
import java.util.List;
+import lombok.Data;
+
@Data
public class DynamicHostProp {
+
/**
* 已用内存
*/
@@ -32,6 +34,6 @@ public class DynamicHostProp {
* 1:受管 2:断线
*/
private Integer managed;
-
+
private List serviceRoles;
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/host/model/Host.java b/datasophon-domain/src/main/java/com/datasophon/domain/host/model/Host.java
index ba74c30b..76bd96f3 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/host/model/Host.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/host/model/Host.java
@@ -1,12 +1,12 @@
package com.datasophon.domain.host.model;
-import lombok.Data;
-
import java.util.Date;
+import lombok.Data;
+
@Data
public class Host {
-
+
/**
* 主机名
*/
@@ -31,20 +31,20 @@ public class Host {
* 总磁盘
*/
private Integer totalDisk;
-
+
private DynamicHostProp dynamicHostProp;
/**
* 集群id
*/
private Integer clusterId;
-
+
private String cpuArchitecture;
-
+
private String nodeLabel;
-
+
/**
* 创建时间
*/
private Date createTime;
-
+
}
diff --git a/datasophon-domain/src/main/java/com/datasophon/domain/host/model/ServiceRole.java b/datasophon-domain/src/main/java/com/datasophon/domain/host/model/ServiceRole.java
index 3eada891..f83ed342 100644
--- a/datasophon-domain/src/main/java/com/datasophon/domain/host/model/ServiceRole.java
+++ b/datasophon-domain/src/main/java/com/datasophon/domain/host/model/ServiceRole.java
@@ -4,7 +4,7 @@
@Data
public class ServiceRole {
-
+
private String serviceRoleName;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/alert/AlertHistoryGatewayImpl.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/alert/AlertHistoryGatewayImpl.java
index fec0855e..3a664e18 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/alert/AlertHistoryGatewayImpl.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/alert/AlertHistoryGatewayImpl.java
@@ -1,25 +1,27 @@
package com.datasophon.dao.alert;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.datasophon.dao.entity.ClusterAlertHistory;
import com.datasophon.dao.enums.AlertLevel;
import com.datasophon.dao.mapper.ClusterAlertHistoryMapper;
import com.datasophon.domain.alert.gateway.AlertHistoryGateway;
import com.datasophon.domain.alert.model.AlertHistory;
+
+import java.util.List;
+import java.util.Objects;
+
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
-import java.util.List;
-import java.util.Objects;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@Component
public class AlertHistoryGatewayImpl implements AlertHistoryGateway {
-
+
@Autowired
private ClusterAlertHistoryMapper alertHistoryMapper;
-
+
@Override
public boolean hasEnabledAlertHistory(String alertname, int clusterId, String hostname) {
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
@@ -33,7 +35,7 @@ public boolean hasEnabledAlertHistory(String alertname, int clusterId, String ho
}
return false;
}
-
+
@Override
public AlertHistory getEnabledAlertHistory(String alertname, int clusterId, String hostname) {
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
@@ -42,22 +44,22 @@ public AlertHistory getEnabledAlertHistory(String alertname, int clusterId, Stri
.eq(ClusterAlertHistory::getHostname, hostname)
.eq(ClusterAlertHistory::getIsEnabled, 1);
ClusterAlertHistory clusterAlertHistory = alertHistoryMapper.selectOne(queryWrapper);
- if(Objects.nonNull(clusterAlertHistory)){
+ if (Objects.nonNull(clusterAlertHistory)) {
AlertHistory alertHistory = new AlertHistory();
- BeanUtils.copyProperties(clusterAlertHistory,alertHistory);
+ BeanUtils.copyProperties(clusterAlertHistory, alertHistory);
alertHistory.setAlertLevel(clusterAlertHistory.getAlertLevel().getValue());
return alertHistory;
}
return null;
}
-
+
@Override
public void updateAlertHistoryToDisabled(Integer id) {
ClusterAlertHistory clusterAlertHistory = alertHistoryMapper.selectById(id);
clusterAlertHistory.setIsEnabled(2);
alertHistoryMapper.updateById(clusterAlertHistory);
}
-
+
@Override
public boolean nodeHasWarnAlertList(String hostname, String serviceRoleName, Integer id) {
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
@@ -67,7 +69,7 @@ public boolean nodeHasWarnAlertList(String hostname, String serviceRoleName, Int
.eq(ClusterAlertHistory::getAlertLevel, AlertLevel.WARN)
.ne(ClusterAlertHistory::getId, id);
List clusterAlertHistories = alertHistoryMapper.selectList(queryWrapper);
- if(CollectionUtils.isEmpty(clusterAlertHistories)){
+ if (CollectionUtils.isEmpty(clusterAlertHistories)) {
return false;
}
return true;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/AlertGroupEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/AlertGroupEntity.java
index 37694d0a..15c79187 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/AlertGroupEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/AlertGroupEntity.java
@@ -29,9 +29,9 @@
@TableName("t_ddh_alert_group")
@Data
public class AlertGroupEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -45,13 +45,13 @@ public class AlertGroupEntity implements Serializable {
* 告警组类别
*/
private String alertGroupCategory;
-
+
private Date createTime;
-
+
@TableField(exist = false)
private Integer alertQuotaNum;
-
+
@TableField(exist = false)
private Integer clusterId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertExpression.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertExpression.java
index 5a795aeb..f2c114d6 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertExpression.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertExpression.java
@@ -28,9 +28,9 @@
@Data
@TableName("t_ddh_cluster_alert_expression")
public class ClusterAlertExpression implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 自增 ID
*/
@@ -72,5 +72,5 @@ public class ClusterAlertExpression implements Serializable {
* 修改时间
*/
private Date updateTime;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertGroupMap.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertGroupMap.java
index 9d56b5a2..f263feff 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertGroupMap.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertGroupMap.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_alert_group_map")
public class ClusterAlertGroupMap implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -43,5 +43,5 @@ public class ClusterAlertGroupMap implements Serializable {
*
*/
private Integer alertGroupId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertHistory.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertHistory.java
index 0c94a306..27485e2c 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertHistory.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertHistory.java
@@ -17,16 +17,18 @@
package com.datasophon.dao.entity;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
import com.datasophon.dao.enums.AlertLevel;
+
+import java.io.Serializable;
+import java.util.Date;
+
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
-import java.io.Serializable;
-import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
@Data
@Builder
@@ -34,9 +36,9 @@
@NoArgsConstructor
@AllArgsConstructor
public class ClusterAlertHistory implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -90,5 +92,5 @@ public class ClusterAlertHistory implements Serializable {
* 集群id
*/
private Integer clusterId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertQuota.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertQuota.java
index b86e7491..8398fd9f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertQuota.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertQuota.java
@@ -32,9 +32,9 @@
@Data
@TableName("t_ddh_cluster_alert_quota")
public class ClusterAlertQuota implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -88,17 +88,17 @@ public class ClusterAlertQuota implements Serializable {
* 触发时长 单位秒
*/
private Integer triggerDuration;
-
+
private String serviceRoleName;
-
+
private QuotaState quotaState;
-
+
private Date createTime;
-
+
@TableField(exist = false)
private Integer quotaStateCode;
-
+
@TableField(exist = false)
private String alertGroupName;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertRule.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertRule.java
index 54d7de23..05b9a338 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertRule.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterAlertRule.java
@@ -28,9 +28,9 @@
@Data
@TableName("t_ddh_cluster_alert_rule")
public class ClusterAlertRule implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 自增 ID
*/
@@ -96,5 +96,5 @@ public class ClusterAlertRule implements Serializable {
* 集群id
*/
private Integer clusterId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterGroup.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterGroup.java
index 4a6c04fa..4ce76616 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterGroup.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterGroup.java
@@ -28,17 +28,17 @@
@Data
@TableName("t_ddh_cluster_group")
public class ClusterGroup implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
@TableId
private Integer id;
-
+
private String groupName;
-
+
private Integer clusterId;
-
+
@TableField(exist = false)
private String clusterUsers;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterHostDO.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterHostDO.java
index bb8379be..1581c1b1 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterHostDO.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterHostDO.java
@@ -17,22 +17,24 @@
package com.datasophon.dao.entity;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
import com.datasophon.domain.host.enums.HostState;
import com.datasophon.domain.host.enums.MANAGED;
-import lombok.Data;
import java.io.Serializable;
import java.util.Date;
+import lombok.Data;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
@TableName("t_ddh_cluster_host")
@Data
public class ClusterHostDO implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -94,12 +96,12 @@ public class ClusterHostDO implements Serializable {
* 1:受管 2:断线
*/
private MANAGED managed;
-
+
private String cpuArchitecture;
-
+
private String nodeLabel;
-
+
@TableField(exist = false)
private Integer serviceRoleNum;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterInfoEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterInfoEntity.java
index 69794d40..8d95271c 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterInfoEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterInfoEntity.java
@@ -32,9 +32,9 @@
@Data
@TableName("t_ddh_cluster_info")
public class ClusterInfoEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -72,11 +72,11 @@ public class ClusterInfoEntity implements Serializable {
* 集群框架id
*/
private Integer frameId;
-
+
@TableField(exist = false)
private List clusterManagerList;
-
+
@TableField(exist = false)
private Integer clusterStateCode;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterNodeLabelEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterNodeLabelEntity.java
index 49179ac1..51147aa5 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterNodeLabelEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterNodeLabelEntity.java
@@ -25,11 +25,11 @@
@Data
@TableName("t_ddh_cluster_node_label")
public class ClusterNodeLabelEntity {
-
+
@TableId
private Integer id;
-
+
private Integer clusterId;
-
+
private String nodeLabel;
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterQueueCapacity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterQueueCapacity.java
index c9a6f12b..be6ca8aa 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterQueueCapacity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterQueueCapacity.java
@@ -27,15 +27,15 @@
@Data
@TableName("t_ddh_cluster_queue_capacity")
public class ClusterQueueCapacity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@TableId
private Integer id;
-
+
private Integer clusterId;
/**
*
@@ -53,7 +53,7 @@ public class ClusterQueueCapacity implements Serializable {
*
*/
private String aclUsers;
-
+
private String parent;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRack.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRack.java
index 6e91eec2..476a261e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRack.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRack.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_rack")
public class ClusterRack implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -43,5 +43,5 @@ public class ClusterRack implements Serializable {
*
*/
private Integer clusterId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRoleUserEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRoleUserEntity.java
index a4429561..f9bbaeb9 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRoleUserEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterRoleUserEntity.java
@@ -29,9 +29,9 @@
@Data
@TableName("t_ddh_cluster_role_user")
public class ClusterRoleUserEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -49,5 +49,5 @@ public class ClusterRoleUserEntity implements Serializable {
* 用户id
*/
private Integer userId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandEntity.java
index effff357..342473fa 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandEntity.java
@@ -30,9 +30,9 @@
@TableName("t_ddh_cluster_service_command")
@Data
public class ClusterServiceCommandEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -53,7 +53,7 @@ public class ClusterServiceCommandEntity implements Serializable {
* 命令状态 1:正在运行2:成功3:失败
*/
private CommandState commandState;
-
+
@TableField(exist = false)
private Integer commandStateCode;
/**
@@ -72,12 +72,12 @@ public class ClusterServiceCommandEntity implements Serializable {
* 命令类型
*/
private Integer commandType;
-
+
@TableField(exist = false)
private String durationTime;
-
+
private Date endTime;
-
+
private Integer serviceInstanceId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostCommandEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostCommandEntity.java
index ae7c3183..2f436a4b 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostCommandEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostCommandEntity.java
@@ -31,9 +31,9 @@
@TableName("t_ddh_cluster_service_command_host_command")
@Data
public class ClusterServiceCommandHostCommandEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -46,7 +46,7 @@ public class ClusterServiceCommandHostCommandEntity implements Serializable {
* 指令状态 1、正在运行2:成功3:失败
*/
private CommandState commandState;
-
+
@TableField(exist = false)
private Integer commandStateCode;
/**
@@ -57,21 +57,21 @@ public class ClusterServiceCommandHostCommandEntity implements Serializable {
* 主机id
*/
private String commandHostId;
-
+
private String commandId;
-
+
private String hostname;
/**
* 服务角色名称
*/
private String serviceRoleName;
-
+
private RoleType serviceRoleType;
-
+
private String resultMsg;
-
+
private Date createTime;
-
+
private Integer commandType;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostEntity.java
index 8d58d2cb..930177d0 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceCommandHostEntity.java
@@ -30,9 +30,9 @@
@TableName("t_ddh_cluster_service_command_host")
@Data
public class ClusterServiceCommandHostEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -45,7 +45,7 @@ public class ClusterServiceCommandHostEntity implements Serializable {
* 命令状态 1:正在运行2:成功3:失败
*/
private CommandState commandState;
-
+
@TableField(exist = false)
private Integer commandStateCode;
/**
@@ -56,7 +56,7 @@ public class ClusterServiceCommandHostEntity implements Serializable {
* 操作指令id
*/
private String commandId;
-
+
private Date createTime;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceDashboard.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceDashboard.java
index 262a3861..351d4d54 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceDashboard.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceDashboard.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_service_dashboard")
public class ClusterServiceDashboard implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主机
*/
@@ -43,5 +43,5 @@ public class ClusterServiceDashboard implements Serializable {
* 总览页面地址
*/
private String dashboardUrl;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceConfigEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceConfigEntity.java
index eaf0fae7..ef873137 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceConfigEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceConfigEntity.java
@@ -28,9 +28,9 @@
@TableName("t_ddh_cluster_service_instance_config")
@Data
public class ClusterServiceInstanceConfigEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主机
*/
@@ -64,9 +64,9 @@ public class ClusterServiceInstanceConfigEntity implements Serializable {
*
*/
private Integer clusterId;
-
+
private String configFileJson;
-
+
private String configFileJsonMd5;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceEntity.java
index cc461443..6668fa16 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceEntity.java
@@ -32,9 +32,9 @@
@TableName("t_ddh_cluster_service_instance")
@Data
public class ClusterServiceInstanceEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -48,13 +48,13 @@ public class ClusterServiceInstanceEntity implements Serializable {
* 服务名称
*/
private String serviceName;
-
+
private String label;
/**
* 服务状态 1、待安装 2:正在运行 3:存在告警 4:存在异常
*/
private ServiceState serviceState;
-
+
@TableField(exist = false)
private Integer serviceStateCode;
/**
@@ -65,16 +65,16 @@ public class ClusterServiceInstanceEntity implements Serializable {
* 创建时间
*/
private Date createTime;
-
+
private NeedRestart needRestart;
-
+
private Integer frameServiceId;
-
+
@TableField(exist = false)
private String dashboardUrl;
-
+
@TableField(exist = false)
private Integer alertNum;
-
+
private Integer sortNum;
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceRoleGroup.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceRoleGroup.java
index f0afc6cc..8fc91cdd 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceRoleGroup.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceInstanceRoleGroup.java
@@ -31,9 +31,9 @@
@Data
@TableName("t_ddh_cluster_service_instance_role_group")
public class ClusterServiceInstanceRoleGroup implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/** */
@TableId
private Integer id;
@@ -45,8 +45,8 @@ public class ClusterServiceInstanceRoleGroup implements Serializable {
private String serviceName;
/** */
private Integer clusterId;
-
+
private String roleGroupType;
-
+
private NeedRestart needRestart;
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleGroupConfig.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleGroupConfig.java
index cd4f9c21..5b820e83 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleGroupConfig.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleGroupConfig.java
@@ -28,9 +28,9 @@
@Data
@TableName("t_ddh_cluster_service_role_group_config")
public class ClusterServiceRoleGroupConfig implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -76,5 +76,5 @@ public class ClusterServiceRoleGroupConfig implements Serializable {
*
*/
private String serviceName;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceConfigEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceConfigEntity.java
index 84f46f84..4e90e78c 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceConfigEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceConfigEntity.java
@@ -22,15 +22,16 @@
import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@Data
@TableName("t_ddh_cluster_service_role_instance_config")
public class ClusterServiceRoleInstanceConfigEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主机
*/
@@ -39,26 +40,36 @@ public class ClusterServiceRoleInstanceConfigEntity implements Serializable {
/**
* 服务角色实例id
*/
- private Integer service_role_instance_id;
+ @TableField("service_role_instance_id")
+ private Integer serviceRoleInstanceId;
+
/**
* 创建时间
*/
- private Date create_time;
+ @TableField("create_time")
+ private Date createTime;
+
/**
* 配置json
*/
- private String config_json;
+ @TableField("config_json")
+ private String configJson;
/**
* 更新时间
*/
- private Date update_time;
+ @TableField("update_time")
+ private Date updateTime;
+
/**
* 配置json md5
*/
- private String config_json_md5;
+ @TableField("config_json_md5")
+ private String configJsonMd5;
+
/**
* 配置json版本
*/
- private String config_json_version;
-
+ @TableField("config_json_version")
+ private String configJsonVersion;
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceEntity.java
index e297c108..8c4196c8 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceEntity.java
@@ -33,9 +33,9 @@
@TableName("t_ddh_cluster_service_role_instance")
@Data
public class ClusterServiceRoleInstanceEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -53,7 +53,7 @@ public class ClusterServiceRoleInstanceEntity implements Serializable {
* 服务角色状态 1:正在运行 2:停止 3:存在告警 4:退役中 5:已退役
*/
private ServiceRoleState serviceRoleState;
-
+
@TableField(exist = false)
private Integer serviceRoleStateCode;
/**
@@ -80,12 +80,12 @@ public class ClusterServiceRoleInstanceEntity implements Serializable {
* 服务名称
*/
private String serviceName;
-
+
private Integer roleGroupId;
-
+
private NeedRestart needRestart;
-
+
@TableField(exist = false)
private String roleGroupName;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceWebuis.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceWebuis.java
index af7742bc..8b0a01b2 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceWebuis.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterServiceRoleInstanceWebuis.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_service_role_instance_webuis")
public class ClusterServiceRoleInstanceWebuis implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -43,9 +43,9 @@ public class ClusterServiceRoleInstanceWebuis implements Serializable {
* URL地址
*/
private String webUrl;
-
+
private Integer serviceInstanceId;
-
+
private String name;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUser.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUser.java
index 88fc09e8..51c831cc 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUser.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUser.java
@@ -28,20 +28,20 @@
@Data
@TableName("t_ddh_cluster_user")
public class ClusterUser implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
@TableId
private Integer id;
-
+
private String username;
-
+
private Integer clusterId;
-
+
@TableField(exist = false)
private String mainGroup;
-
+
@TableField(exist = false)
private String otherGroups;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUserGroup.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUserGroup.java
index e412b286..40f78bb2 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUserGroup.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterUserGroup.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_user_group")
public class ClusterUserGroup implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -43,9 +43,9 @@ public class ClusterUserGroup implements Serializable {
*
*/
private Integer groupId;
-
+
private Integer clusterId;
-
+
private Integer userGroupType;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterVariable.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterVariable.java
index 81525458..ef4a81ad 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterVariable.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterVariable.java
@@ -17,18 +17,19 @@
package com.datasophon.dao.entity;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+
import lombok.Data;
-import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
@Data
@TableName("t_ddh_cluster_variable")
public class ClusterVariable implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -46,10 +47,10 @@ public class ClusterVariable implements Serializable {
*
*/
private String variableValue;
-
+
/**
*
*/
private String serviceName;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnQueue.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnQueue.java
index 64a96892..04c0bd91 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnQueue.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnQueue.java
@@ -29,9 +29,9 @@
@Data
@TableName("t_ddh_cluster_yarn_queue")
public class ClusterYarnQueue implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -73,17 +73,17 @@ public class ClusterYarnQueue implements Serializable {
* 1: true 2:false
*/
private Integer allowPreemption;
-
+
private Integer clusterId;
-
+
private Date createTime;
-
+
private String amShare;
-
+
@TableField(exist = false)
private String minResources;
-
+
@TableField(exist = false)
private String maxResources;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnScheduler.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnScheduler.java
index 6435369f..02672716 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnScheduler.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterYarnScheduler.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_yarn_scheduler")
public class ClusterYarnScheduler implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -43,7 +43,7 @@ public class ClusterYarnScheduler implements Serializable {
*
*/
private String scheduler;
-
+
private Integer inUse;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterZk.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterZk.java
index cf23a986..9b83271e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterZk.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/ClusterZk.java
@@ -27,9 +27,9 @@
@Data
@TableName("t_ddh_cluster_zk")
public class ClusterZk implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -47,5 +47,5 @@ public class ClusterZk implements Serializable {
*
*/
private Integer clusterId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameInfoEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameInfoEntity.java
index eab3afdd..6a2bd64c 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameInfoEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameInfoEntity.java
@@ -29,9 +29,9 @@
@Data
@TableName("t_ddh_frame_info")
public class FrameInfoEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -49,8 +49,8 @@ public class FrameInfoEntity implements Serializable {
* 框架版本
*/
private String frameVersion;
-
+
@TableField(exist = false)
private List frameServiceList;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceEntity.java
index 687f0b48..3808db4f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceEntity.java
@@ -30,9 +30,9 @@
@Data
@Accessors(chain = true)
public class FrameServiceEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -46,7 +46,7 @@ public class FrameServiceEntity implements Serializable {
* 服务名称
*/
private String serviceName;
-
+
private String label;
/**
* 服务版本
@@ -56,28 +56,28 @@ public class FrameServiceEntity implements Serializable {
* 服务描述
*/
private String serviceDesc;
-
+
private String packageName;
-
+
private String dependencies;
-
+
private String serviceJson;
-
+
private String serviceJsonMd5;
-
+
private String serviceConfig;
-
+
private String frameCode;
-
+
private String configFileJson;
-
+
private String configFileJsonMd5;
-
+
private String decompressPackageName;
-
+
@TableField(exist = false)
private Boolean installed;
-
+
private Integer sortNum;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceRoleEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceRoleEntity.java
index bcd460c5..e7cb3f6a 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceRoleEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/FrameServiceRoleEntity.java
@@ -33,9 +33,9 @@
@Data
@Accessors(chain = true)
public class FrameServiceRoleEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -57,18 +57,18 @@ public class FrameServiceRoleEntity implements Serializable {
* 1 1+
*/
private String cardinality;
-
+
private String serviceRoleJson;
-
+
private String serviceRoleJsonMd5;
-
+
private String frameCode;
-
+
private String jmxPort;
-
+
@TableField(exist = false)
private List hosts;
-
+
private String logFile;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/InstallStepEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/InstallStepEntity.java
index f6258aff..20e2d868 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/InstallStepEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/InstallStepEntity.java
@@ -27,9 +27,9 @@
@TableName("t_ddh_install_step")
@Data
public class InstallStepEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -43,5 +43,5 @@ public class InstallStepEntity implements Serializable {
*
*/
private String stepDesc;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupEntity.java
index 9d023ef1..4f3b80c2 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupEntity.java
@@ -25,9 +25,9 @@
@TableName("t_ddh_notice_group")
public class NoticeGroupEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -41,5 +41,5 @@ public class NoticeGroupEntity implements Serializable {
* 创建时间
*/
private Date createTime;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupUserEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupUserEntity.java
index 1101ac34..8014b2db 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupUserEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/NoticeGroupUserEntity.java
@@ -24,9 +24,9 @@
@TableName("t_ddh_notice_group_user")
public class NoticeGroupUserEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -40,5 +40,5 @@ public class NoticeGroupUserEntity implements Serializable {
* 用户id
*/
private Integer userId;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/RoleInfoEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/RoleInfoEntity.java
index 79adc499..de8379bc 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/RoleInfoEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/RoleInfoEntity.java
@@ -28,9 +28,9 @@
@Data
@TableName("t_ddh_role_info")
public class RoleInfoEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -48,5 +48,5 @@ public class RoleInfoEntity implements Serializable {
* 创建时间
*/
private Date createTime;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/SessionEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/SessionEntity.java
index b81661dc..6c0691d7 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/SessionEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/SessionEntity.java
@@ -28,9 +28,9 @@
@Data
@TableName("t_ddh_session")
public class SessionEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
*
*/
@@ -48,5 +48,5 @@ public class SessionEntity implements Serializable {
*
*/
private Date lastLoginTime;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/UserInfoEntity.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/UserInfoEntity.java
index bc9f1a05..b05ab01e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/UserInfoEntity.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/entity/UserInfoEntity.java
@@ -28,9 +28,9 @@
@Data
@TableName("t_ddh_user_info")
public class UserInfoEntity implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* 主键
*/
@@ -56,7 +56,7 @@ public class UserInfoEntity implements Serializable {
* 创建时间
*/
private Date createTime;
-
+
private Integer userType;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/AlertLevel.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/AlertLevel.java
index ee497657..30983782 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/AlertLevel.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/AlertLevel.java
@@ -21,37 +21,37 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum AlertLevel {
-
+
WARN(1, "warning"),
EXCEPTION(2, "exception");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
AlertLevel(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ClusterState.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ClusterState.java
index 437868ea..fe83efcf 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ClusterState.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ClusterState.java
@@ -17,51 +17,51 @@
package com.datasophon.dao.enums;
+import java.util.Arrays;
+
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
-import java.util.Arrays;
-
public enum ClusterState {
-
+
DELETING(4, "删除中"),
-
+
STOP(3, "停止"),
-
+
RUNNING(2, "正在运行"),
NEED_CONFIG(1, "待配置");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
ClusterState(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
public static ClusterState of(int value) {
return Arrays.stream(values()).filter(state -> state.getValue() == value).findAny().orElse(null);
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/CommandState.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/CommandState.java
index c657ff12..b091d4fe 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/CommandState.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/CommandState.java
@@ -21,41 +21,41 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum CommandState {
-
+
// 命令状态 1:正在运行2:成功3:失败
WAIT(0, "待运行"),
RUNNING(1, "正在运行"),
SUCCESS(2, "成功"),
FAILED(3, "失败"),
CANCEL(4, "取消");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
CommandState(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/NeedRestart.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/NeedRestart.java
index 87c1d3ef..a451b595 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/NeedRestart.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/NeedRestart.java
@@ -21,35 +21,35 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum NeedRestart {
-
+
NO(1, false),
YES(2, true);
-
+
@EnumValue
private int value;
-
+
private boolean desc;
-
+
NeedRestart(int value, boolean desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public boolean isDesc() {
return desc;
}
-
+
public void setDesc(boolean desc) {
this.desc = desc;
}
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/QuotaState.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/QuotaState.java
index 7ab976be..446ef906 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/QuotaState.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/QuotaState.java
@@ -21,38 +21,38 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum QuotaState {
-
+
RUNNING(1, "启用"),
STOPPED(2, "未启用"),
WAIT_TO_UPDATE(3, "待更新");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
QuotaState(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/RoleType.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/RoleType.java
index a51248b7..fcdad475 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/RoleType.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/RoleType.java
@@ -21,38 +21,39 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum RoleType {
-
+
MASTER(1, "master"),
WORKER(2, "worker"),
CLIENT(3, "client"),
SLAVE(4, "slave");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
RoleType(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceRoleState.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceRoleState.java
index b3a516fa..b05bfa3e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceRoleState.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceRoleState.java
@@ -21,40 +21,40 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum ServiceRoleState {
-
+
RUNNING(1, "正在运行"),
STOP(2, "停止"),
EXISTS_ALARM(3, "存在告警"),
DECOMMISSIONING(4, "退役中"),
DECOMMISSIONED(5, "已退役");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
ServiceRoleState(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceState.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceState.java
index deaf1bea..7f3bf49a 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceState.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/ServiceState.java
@@ -21,40 +21,40 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum ServiceState {
-
+
WAIT_INSTALL(1, "待安装"),
RUNNING(2, "正常"),
EXISTS_ALARM(3, "存在告警"),
EXISTS_EXCEPTION(4, "存在异常"),
;
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
ServiceState(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/UserType.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/UserType.java
index 0c0a4560..021933e4 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/UserType.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/enums/UserType.java
@@ -21,36 +21,36 @@
import com.fasterxml.jackson.annotation.JsonValue;
public enum UserType {
-
+
CLUSTER_MANAGER(1, "集群管理员");
-
+
@EnumValue
private int value;
-
+
private String desc;
-
+
UserType(int value, String desc) {
this.value = value;
this.desc = desc;
}
-
+
public int getValue() {
return value;
}
-
+
public void setValue(int value) {
this.value = value;
}
-
+
@JsonValue
public String getDesc() {
return desc;
}
-
+
public void setDesc(String desc) {
this.desc = desc;
}
-
+
@Override
public String toString() {
return this.desc;
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/AlertGroupMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/AlertGroupMapper.java
index 2999997c..d2fde79c 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/AlertGroupMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/AlertGroupMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface AlertGroupMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertExpressionMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertExpressionMapper.java
index 5b190ba4..ee7e8768 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertExpressionMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertExpressionMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterAlertExpressionMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertGroupMapMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertGroupMapMapper.java
index ba71412d..5c866836 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertGroupMapMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertGroupMapMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterAlertGroupMapMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertHistoryMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertHistoryMapper.java
index 09b215c4..ab548921 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertHistoryMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertHistoryMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterAlertHistoryMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertQuotaMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertQuotaMapper.java
index 392395af..746bd90c 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertQuotaMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertQuotaMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterAlertQuotaMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertRuleMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertRuleMapper.java
index 4a00b958..5640a07d 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertRuleMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterAlertRuleMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterAlertRuleMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterGroupMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterGroupMapper.java
index 10f49350..31198b77 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterGroupMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterGroupMapper.java
@@ -25,5 +25,5 @@
@Mapper
public interface ClusterGroupMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterHostMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterHostMapper.java
index 5e83de5d..c4aa43fb 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterHostMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterHostMapper.java
@@ -33,8 +33,8 @@
*/
@Mapper
public interface ClusterHostMapper extends BaseMapper {
-
+
ClusterHostDO getClusterHostByHostname(@Param("hostname") String hostname);
-
+
void updateBatchNodeLabel(@Param("hostIds") String hostIds, @Param("nodeLabel") String nodeLabel);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterInfoMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterInfoMapper.java
index 282ddc8d..689c61b1 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterInfoMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterInfoMapper.java
@@ -33,6 +33,6 @@
*/
@Mapper
public interface ClusterInfoMapper extends BaseMapper {
-
+
ClusterInfoEntity getClusterByClusterCode(@Param("clusterCode") String clusterCode);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterQueueCapacityMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterQueueCapacityMapper.java
index 85d9d6b1..f8448431 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterQueueCapacityMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterQueueCapacityMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterQueueCapacityMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRackMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRackMapper.java
index a3063b9f..c346c465 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRackMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRackMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterRackMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRoleUserMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRoleUserMapper.java
index 01a6a0e5..bcb5794f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRoleUserMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterRoleUserMapper.java
@@ -36,6 +36,6 @@
*/
@Mapper
public interface ClusterRoleUserMapper extends BaseMapper {
-
+
List getAllClusterManagerByClusterId(@Param("clusterId") Integer clusterId);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostCommandMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostCommandMapper.java
index 998be9d3..a1c88b40 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostCommandMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostCommandMapper.java
@@ -33,7 +33,7 @@
*/
@Mapper
public interface ClusterServiceCommandHostCommandMapper extends BaseMapper {
-
+
Integer getHostCommandTotalProgressByHostnameAndCommandHostId(@Param("hostname") String hostname,
@Param("commandHostId") String commandHostId);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostMapper.java
index 01c3f0a8..cb973a02 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandHostMapper.java
@@ -33,6 +33,6 @@
*/
@Mapper
public interface ClusterServiceCommandHostMapper extends BaseMapper {
-
+
Integer getCommandHostTotalProgressByCommandId(@Param("commandId") String commandId);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandMapper.java
index ec8fa9dd..eb1bfe05 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceCommandMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceCommandMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceDashboardMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceDashboardMapper.java
index 35857f6c..e0acc0a1 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceDashboardMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceDashboardMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceDashboardMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceConfigMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceConfigMapper.java
index b5d6eb5e..adb859f8 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceConfigMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceConfigMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceInstanceConfigMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceMapper.java
index 0949bca3..b948118f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceMapper.java
@@ -33,7 +33,7 @@
*/
@Mapper
public interface ClusterServiceInstanceMapper extends BaseMapper {
-
+
String getServiceConfigByClusterIdAndServiceName(@Param("clusterId") Integer clusterId,
@Param("serviceName") String serviceName);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceRoleGroupMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceRoleGroupMapper.java
index 4de52669..a4b5c56e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceRoleGroupMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceInstanceRoleGroupMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceInstanceRoleGroupMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleGroupConfigMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleGroupConfigMapper.java
index 00624af1..d6e3f43f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleGroupConfigMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleGroupConfigMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceRoleGroupConfigMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceConfigMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceConfigMapper.java
index 47182f74..0b9cdb76 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceConfigMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceConfigMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceRoleInstanceConfigMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceMapper.java
index 1adfe5f1..c7e83065 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceMapper.java
@@ -33,8 +33,8 @@
*/
@Mapper
public interface ClusterServiceRoleInstanceMapper extends BaseMapper {
-
+
void updateToNeedRestart(@Param("roleGroupId") Integer roleGroupId);
-
+
void updateToNeedRestartByHost(@Param("hostName") String hostName);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceWebuisMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceWebuisMapper.java
index 702f402e..968866db 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceWebuisMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterServiceRoleInstanceWebuisMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterServiceRoleInstanceWebuisMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserGroupMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserGroupMapper.java
index a99eea69..a36c76cc 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserGroupMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserGroupMapper.java
@@ -25,5 +25,5 @@
@Mapper
public interface ClusterUserGroupMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserMapper.java
index bfa35640..3d06ab65 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterUserMapper.java
@@ -25,5 +25,5 @@
@Mapper
public interface ClusterUserMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterVariableMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterVariableMapper.java
index dc19243d..6541cdfc 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterVariableMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterVariableMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterVariableMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnQueueMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnQueueMapper.java
index 8e24fa0d..5b5fdfc8 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnQueueMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnQueueMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterYarnQueueMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnSchedulerMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnSchedulerMapper.java
index 2acc6498..e9cfa19f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnSchedulerMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterYarnSchedulerMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface ClusterYarnSchedulerMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterZkMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterZkMapper.java
index 6f0ef6d9..9c1f40fd 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterZkMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/ClusterZkMapper.java
@@ -33,6 +33,6 @@
*/
@Mapper
public interface ClusterZkMapper extends BaseMapper {
-
+
Integer getMaxMyId(@Param("clusterId") Integer clusterId);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameInfoMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameInfoMapper.java
index 2cc7b3f2..aa6470a5 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameInfoMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameInfoMapper.java
@@ -33,6 +33,6 @@
*/
@Mapper
public interface FrameInfoMapper extends BaseMapper {
-
+
FrameInfoEntity getFrameInfoByFrameCode(@Param("frameCode") String frameCode);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceMapper.java
index bc58c91b..35c52b51 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface FrameServiceMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceRoleMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceRoleMapper.java
index 11850f7a..bf91ff15 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceRoleMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/FrameServiceRoleMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface FrameServiceRoleMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/InstallStepMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/InstallStepMapper.java
index e27377a5..26816c38 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/InstallStepMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/InstallStepMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface InstallStepMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/NoticeGroupUserMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/NoticeGroupUserMapper.java
index 6d4b15db..53c9d16f 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/NoticeGroupUserMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/NoticeGroupUserMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface NoticeGroupUserMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/RoleInfoMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/RoleInfoMapper.java
index 6234512f..e5aed07e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/RoleInfoMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/RoleInfoMapper.java
@@ -32,5 +32,5 @@
*/
@Mapper
public interface RoleInfoMapper extends BaseMapper {
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/SessionMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/SessionMapper.java
index 0cc2453d..c3db878b 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/SessionMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/SessionMapper.java
@@ -35,10 +35,10 @@
*/
@Mapper
public interface SessionMapper extends BaseMapper {
-
+
SessionEntity queryByUserIdAndIp(@Param("userId") Integer id, @Param("ip") String ip);
-
+
List queryByUserId(@Param("userId") Integer id);
-
+
void insertSession(SessionEntity session);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/UserInfoMapper.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/UserInfoMapper.java
index cbca0a74..aa75e813 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/UserInfoMapper.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/mapper/UserInfoMapper.java
@@ -33,6 +33,6 @@
*/
@Mapper
public interface UserInfoMapper extends BaseMapper {
-
+
UserInfoEntity queryUserByToken(@Param("token") String token);
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ClusterQueueCapacityList.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ClusterQueueCapacityList.java
index 9cc0c787..eeb268ba 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ClusterQueueCapacityList.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ClusterQueueCapacityList.java
@@ -25,10 +25,10 @@
@Data
public class ClusterQueueCapacityList {
-
+
private String rootId;
-
+
private List nodes;
-
+
private List links;
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ComponentVO.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ComponentVO.java
index 0ca65f76..a2cdb685 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ComponentVO.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ComponentVO.java
@@ -28,35 +28,35 @@
*/
@Data
public class ComponentVO {
-
+
String name;
String label;
String version;
String packageName;
String hash;
String md5;
-
+
/**
* 系统架构,x86、x86_64、aarch64、RISC-V
*/
String arch;
String description;
-
+
/**
* 支持的 frame 版本
*/
String meta;
-
+
/**
* 当前阶段:下载(download)、验证(valid)、安装(install)
*/
String step;
-
+
/**
* 当前状态,executing, success, fail
*/
String state;
-
+
/**
* 下载进度:0 - 1 之间
*/
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/Links.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/Links.java
index cda7fbbf..1c0a58e1 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/Links.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/Links.java
@@ -21,8 +21,8 @@
@Data
public class Links {
-
+
private String from;
-
+
private String to;
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ParcelInfoVO.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ParcelInfoVO.java
index 0b053bb8..3e9f686e 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ParcelInfoVO.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ParcelInfoVO.java
@@ -17,10 +17,10 @@
package com.datasophon.dao.model;
-import lombok.Data;
-
import java.util.List;
+import lombok.Data;
+
/**
*
* 第三方框架组件
@@ -30,45 +30,45 @@
*/
@Data
public class ParcelInfoVO {
-
+
/**
* Parcel Remote URL
*/
String url;
-
+
/**
* Parcel 名称
*/
String parcelName;
-
+
/**
* hash 256 验证
*/
String hash;
-
+
/**
* md5 验证
*/
String md5;
-
+
/**
* 依赖的 DDP 版本
*/
String depends;
-
+
/**
* 支持的 DDP Frame 框架版本
*/
String meta;
-
+
/**
* 内部包含的组件
*/
List components;
-
+
/**
* 最后修改时间
*/
long lastUpdated;
-
+
}
diff --git a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ServiceOperateModel.java b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ServiceOperateModel.java
index 3d08440b..ae6889a6 100644
--- a/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ServiceOperateModel.java
+++ b/datasophon-infrastructure/src/main/java/com/datasophon/dao/model/ServiceOperateModel.java
@@ -21,9 +21,9 @@
@Data
public class ServiceOperateModel {
-
+
private Integer commandType;
-
+
private String serviceName;
-
+
}
diff --git a/datasophon-service/pom.xml b/datasophon-service/pom.xml
index f1cafab1..ab96f209 100644
--- a/datasophon-service/pom.xml
+++ b/datasophon-service/pom.xml
@@ -1,13 +1,12 @@
-
+ 4.0.0
- datasophon
com.datasophon
+ datasophon
${revision}
- 4.0.0
datasophon-service
@@ -22,8 +21,8 @@
fastjson
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
commons-httpclient
@@ -40,8 +39,8 @@
${project.version}
- slf4j-reload4j
org.slf4j
+ slf4j-reload4j
@@ -75,4 +74,4 @@
eddsa
-
\ No newline at end of file
+
diff --git a/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java b/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java
index baab38ab..30f0787e 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.datasophon.api.enums;
import com.alibaba.fastjson.JSONObject;
@@ -22,11 +23,11 @@
* status enum
*/
public enum Status {
-
+
SUCCESS(200, "success", "成功"),
-
+
INTERNAL_SERVER_ERROR_ARGS(10000, "Internal Server Error: {0}", "服务端异常: {0}"),
-
+
USER_NAME_EXIST(10003, "user name already exists", "用户名已存在"),
USER_NAME_NULL(10004, "user name is null", "用户名不能为空"),
USER_NOT_EXIST(10010, "user {0} not exists", "用户[{0}]不存在"),
@@ -39,7 +40,7 @@ public enum Status {
LOGIN_SUCCESS(10042, "login success", "登录成功"),
IP_IS_EMPTY(10125, "ip is empty", "IP地址不能为空"),
DELETE_USER_BY_ID_ERROR(10093, "delete user by id error", "删除用户错误"),
-
+
START_CHECK_HOST(10000, "start check host", "开始主机校验"),
CHECK_HOST_SUCCESS(10001, "check host success", "主机校验成功"),
NEED_JAVA_ENVIRONMENT(10002, "need java environment", "缺少Java环境"),
@@ -47,7 +48,7 @@ public enum Status {
NEED_HOSTNAME(10004, "need hostname", "无法获取主机名"),
CAN_NOT_GET_IP(10005, "can not get ip", "无法获取ip地址"),
INSTALL_SERVICE(10006, "Install Service ", "安装服务"),
-
+
CLUSTER_CODE_EXISTS(10007, "cluster code exists", "集群编码已存在"),
ALERT_GROUP_TIPS_ONE(10008,
"an alarm group has been bound to an alarm indicator, delete the bound alarm indicator first",
@@ -87,30 +88,30 @@ public enum Status {
"同一个服务在同一台机器上的所有实例需要在同一个角色组内"),
ODD_NUMBER_ARE_REQUIRED_FOR_DORISFE(10040, "The Number of DorisFE must be an odd number.", "DorisFE个数必须是奇数"),
NO_SERVICE_ROLE_SELECTED(10041, "No service role selected", "未选择需要安装的服务实例"),
- TWO_KYUUBISERVERS_NEED_TO_BE_DEPLOYED(10042, "two kyuubiServer deployments are required", "KyuubiServer需要两个节点"),;
-
-
+ TWO_KYUUBISERVERS_NEED_TO_BE_DEPLOYED(10042, "two kyuubiServer deployments are required", "KyuubiServer需要两个节点"),
+ ;
+
private final int code;
private final String enMsg;
private final String zhMsg;
-
+
Status(int code, String enMsg, String zhMsg) {
this.code = code;
this.enMsg = enMsg;
this.zhMsg = zhMsg;
}
-
+
public int getCode() {
return this.code;
}
-
+
public JSONObject toJson() {
JSONObject json = new JSONObject();
json.put("code", this.code);
json.put("msg", getMsg());
return json;
}
-
+
public String getMsg() {
return this.zhMsg;
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/exceptions/BusinessException.java b/datasophon-service/src/main/java/com/datasophon/api/exceptions/BusinessException.java
index 92aa555a..16f2f0bb 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/exceptions/BusinessException.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/exceptions/BusinessException.java
@@ -1,8 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package com.datasophon.api.exceptions;
public class BusinessException extends RuntimeException {
-
+
public BusinessException(String message) {
super(message);
- };
+ }
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/exceptions/ServiceException.java b/datasophon-service/src/main/java/com/datasophon/api/exceptions/ServiceException.java
index f7e5fe4a..8c35619e 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/exceptions/ServiceException.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/exceptions/ServiceException.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.datasophon.api.exceptions;
import com.datasophon.api.enums.Status;
@@ -22,33 +23,33 @@
* service exception
*/
public class ServiceException extends RuntimeException {
-
+
/**
* code
*/
private Integer code;
-
+
public ServiceException() {
}
-
+
public ServiceException(Status status) {
super(status.getMsg());
this.code = status.getCode();
}
-
+
public ServiceException(Integer code, String message) {
super(message);
this.code = code;
}
-
+
public ServiceException(String message) {
super(message);
}
-
+
public Integer getCode() {
return this.code;
}
-
+
public void setCode(Integer code) {
this.code = code;
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/ConfigBean.java b/datasophon-service/src/main/java/com/datasophon/api/load/ConfigBean.java
index 2a0c8636..d90dfc3f 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/ConfigBean.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/ConfigBean.java
@@ -25,8 +25,8 @@
@Component
@Data
public class ConfigBean {
-
+
@Value("${server.port}")
private String serverPort;
-
+
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/GlobalVariables.java b/datasophon-service/src/main/java/com/datasophon/api/load/GlobalVariables.java
index a2c9d24b..d9083459 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/GlobalVariables.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/GlobalVariables.java
@@ -4,18 +4,18 @@
import java.util.Map;
public class GlobalVariables {
-
+
// cluster variable
private static Map> map = new HashMap<>();
-
+
public static void put(Integer key, Map value) {
map.put(key, value);
}
-
+
public static Map get(Integer key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/LoadServiceMeta.java b/datasophon-service/src/main/java/com/datasophon/api/load/LoadServiceMeta.java
index a53a1129..50d6748f 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/LoadServiceMeta.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/LoadServiceMeta.java
@@ -19,22 +19,45 @@
package com.datasophon.api.load;
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.io.file.FileReader;
-import cn.hutool.crypto.SecureUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.datasophon.api.service.*;
+import static com.datasophon.common.Constants.META_PATH;
+
+import com.datasophon.api.service.ClusterInfoService;
+import com.datasophon.api.service.ClusterServiceInstanceRoleGroupService;
+import com.datasophon.api.service.ClusterServiceInstanceService;
+import com.datasophon.api.service.ClusterServiceRoleGroupConfigService;
+import com.datasophon.api.service.ClusterVariableService;
+import com.datasophon.api.service.FrameInfoService;
+import com.datasophon.api.service.FrameServiceRoleService;
+import com.datasophon.api.service.FrameServiceService;
import com.datasophon.api.utils.CommonUtils;
import com.datasophon.api.utils.PackageUtils;
import com.datasophon.api.utils.ProcessUtils;
import com.datasophon.common.Constants;
-import com.datasophon.common.model.*;
-import com.datasophon.dao.entity.*;
-import org.apache.commons.lang.StringUtils;
+import com.datasophon.common.model.ConfigWriter;
+import com.datasophon.common.model.Generators;
+import com.datasophon.common.model.ServiceConfig;
+import com.datasophon.common.model.ServiceInfo;
+import com.datasophon.common.model.ServiceRoleInfo;
+import com.datasophon.dao.entity.ClusterInfoEntity;
+import com.datasophon.dao.entity.ClusterServiceInstanceEntity;
+import com.datasophon.dao.entity.ClusterServiceRoleGroupConfig;
+import com.datasophon.dao.entity.ClusterVariable;
+import com.datasophon.dao.entity.FrameInfoEntity;
+import com.datasophon.dao.entity.FrameServiceEntity;
+import com.datasophon.dao.entity.FrameServiceRoleEntity;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@@ -44,50 +67,52 @@
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
-import java.io.File;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.stream.Collectors;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import static com.datasophon.common.Constants.META_PATH;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.io.file.FileReader;
+import cn.hutool.crypto.SecureUtil;
@Component
public class LoadServiceMeta implements ApplicationRunner {
-
+
private static final Logger logger = LoggerFactory.getLogger(LoadServiceMeta.class);
-
+
@Autowired
private FrameServiceService frameServiceService;
-
+
@Autowired
private FrameInfoService frameInfoService;
-
+
@Autowired
private FrameServiceRoleService roleService;
-
+
@Autowired
private ClusterVariableService variableService;
-
+
@Autowired
private ClusterInfoService clusterInfoService;
-
+
@Autowired
private ConfigBean configBean;
-
+
@Autowired
private ClusterServiceInstanceService serviceInstanceService;
-
+
@Autowired
private ClusterServiceInstanceRoleGroupService roleGroupService;
-
+
@Autowired
private ClusterServiceRoleGroupConfigService roleGroupConfigService;
-
+
private static final String HDFS = "HDFS";
-
+
private static final String HADOOP = "HADOOP";
-
+
@Override
@Transactional(rollbackFor = Exception.class)
public void run(ApplicationArguments args) throws Exception {
@@ -95,7 +120,7 @@ public void run(ApplicationArguments args) throws Exception {
// load global variable, 加载 frame
List clusters = clusterInfoService.list();
loadGlobalVariables(clusters);
-
+
for (File path : ddps) {
List files = FileUtil.loopFiles(path);
String frameCode = path.getName();
@@ -114,8 +139,7 @@ public void run(ApplicationArguments args) throws Exception {
}
}
}
-
-
+
/**
* 解析 DDL 并存储到 frame 库
*
@@ -132,7 +156,7 @@ public void parseServiceDdl(final String frameCode,
final String serviceDdl) {
ServiceInfo serviceInfo = JSONObject.parseObject(serviceDdl, ServiceInfo.class);
String serviceInfoMd5 = SecureUtil.md5(serviceDdl);
-
+
// save service config
List allParameters = serviceInfo.getParameters();
Map map =
@@ -143,12 +167,12 @@ public void parseServiceDdl(final String frameCode,
serviceConfig -> serviceConfig,
(v1, v2) -> v1));
Map> configFileMap = new HashMap<>();
-
+
buildConfigFileMap(serviceInfo, map, configFileMap);
-
+
PackageUtils.putServicePackageName(
frameCode, serviceName, serviceInfo.getDecompressPackageName());
-
+
putServiceHomeToVariable(frameCode,
clusters, serviceName, serviceInfo.getDecompressPackageName());
// save service and service config
@@ -165,13 +189,12 @@ public void parseServiceDdl(final String frameCode,
// save frame service role
saveFrameServiceRole(frameCode, serviceName, serviceInfo, serviceEntity);
}
-
-
+
private void putServiceHomeToVariable(String frameCode,
- List clusters, String serviceName,
- String decompressPackageName) {
+ List clusters, String serviceName,
+ String decompressPackageName) {
for (ClusterInfoEntity cluster : clusters) {
- if(cluster.getClusterFrame().equals(frameCode)) {
+ if (cluster.getClusterFrame().equals(frameCode)) {
Map globalVariables = GlobalVariables.get(cluster.getId());
if (HDFS.equals(serviceName)) {
serviceName = HADOOP;
@@ -182,14 +205,14 @@ private void putServiceHomeToVariable(String frameCode,
}
}
}
-
+
private void saveFrameServiceRole(
- String frameCode,
- String serviceName,
- ServiceInfo serviceInfo,
- FrameServiceEntity serviceEntity) {
+ String frameCode,
+ String serviceName,
+ ServiceInfo serviceInfo,
+ FrameServiceEntity serviceEntity) {
List serviceRoles = serviceInfo.getRoles();
-
+
for (ServiceRoleInfo serviceRole : serviceRoles) {
serviceRole.setParentName(serviceName);
String key =
@@ -242,16 +265,16 @@ private void saveFrameServiceRole(
logger.info("put {} {} service info into cache", frameCode, serviceName);
ServiceInfoMap.put(frameCode + Constants.UNDERLINE + serviceName, serviceInfo);
}
-
+
private FrameServiceEntity saveFrameService(
- String frameCode,
- FrameInfoEntity frameInfo,
- String serviceName,
- String serviceDdl,
- ServiceInfo serviceInfo,
- String serviceInfoMd5,
- List allParameters,
- Map> configFileMap) {
+ String frameCode,
+ FrameInfoEntity frameInfo,
+ String serviceName,
+ String serviceDdl,
+ ServiceInfo serviceInfo,
+ String serviceInfoMd5,
+ List allParameters,
+ Map> configFileMap) {
FrameServiceEntity serviceEntity =
frameServiceService.getServiceByFrameIdAndServiceName(
frameInfo.getId(), serviceName);
@@ -267,7 +290,7 @@ private FrameServiceEntity saveFrameService(
serviceEntity,
configFileMap,
serviceInfo.getDecompressPackageName());
-
+
frameServiceService.save(serviceEntity);
} else if (!serviceEntity.getServiceJsonMd5().equals(serviceInfoMd5)) {
String configMapStr = JSONObject.toJSONString(configFileMap);
@@ -289,21 +312,21 @@ private FrameServiceEntity saveFrameService(
serviceInfo.getDecompressPackageName());
frameServiceService.updateById(serviceEntity);
}
-
+
ServiceConfigMap.put(
frameCode + Constants.UNDERLINE + serviceInfo.getName() + Constants.CONFIG,
allParameters);
ServiceConfigFileMap.put(
frameCode + Constants.UNDERLINE + serviceInfo.getName() + Constants.CONFIG_FILE,
configFileMap);
-
+
return serviceEntity;
}
-
+
private void buildConfigFileMap(
- ServiceInfo serviceInfo,
- Map map,
- Map> configFileMap) {
+ ServiceInfo serviceInfo,
+ Map map,
+ Map> configFileMap) {
ConfigWriter configWriter = serviceInfo.getConfigWriter();
List generators = configWriter.getGenerators();
for (Generators generator : generators) {
@@ -324,7 +347,7 @@ private void buildConfigFileMap(
}
}
}
-
+
private FrameInfoEntity saveClusterFrame(String frameCode) {
FrameInfoEntity frameInfo =
frameInfoService.getOne(
@@ -336,7 +359,7 @@ private FrameInfoEntity saveClusterFrame(String frameCode) {
}
return frameInfo;
}
-
+
public void loadGlobalVariables(List clusters) throws UnknownHostException {
if (CollUtil.isNotEmpty(clusters)) {
for (ClusterInfoEntity cluster : clusters) {
@@ -351,16 +374,16 @@ public void loadGlobalVariables(List clusters) throws Unknown
globalVariables.put("${apiHost}", InetAddress.getLocalHost().getHostName());
globalVariables.put("${apiPort}", configBean.getServerPort());
globalVariables.put("${INSTALL_PATH}", Constants.INSTALL_PATH);
-
+
GlobalVariables.put(cluster.getId(), globalVariables);
-
+
ProcessUtils.createServiceActor(cluster);
}
}
}
-
+
private void updateServiceInstanceConfig(
- String frameCode, String serviceName, List parameters) {
+ String frameCode, String serviceName, List parameters) {
// 查询frameCode相同的集群
List clusters = clusterInfoService.getClusterByFrameCode(frameCode);
// 查询集群的服务实例
@@ -381,14 +404,14 @@ private void updateServiceInstanceConfig(
}
}
}
-
+
private void buildFrameServiceRole(
- String frameCode,
- FrameServiceEntity serviceEntity,
- ServiceRoleInfo serviceRole,
- String serviceRoleJson,
- String serviceRoleJsonMd5,
- FrameServiceRoleEntity role) {
+ String frameCode,
+ FrameServiceEntity serviceEntity,
+ ServiceRoleInfo serviceRole,
+ String serviceRoleJson,
+ String serviceRoleJsonMd5,
+ FrameServiceRoleEntity role) {
role.setServiceId(serviceEntity.getId());
role.setServiceRoleName(serviceRole.getName());
role.setCardinality(serviceRole.getCardinality());
@@ -399,17 +422,17 @@ private void buildFrameServiceRole(
role.setServiceRoleJsonMd5(serviceRoleJsonMd5);
role.setLogFile(serviceRole.getLogFile());
}
-
+
private void buildServiceEntity(
- String frameCode,
- Integer frameInfoId,
- String serviceName,
- String serviceDdl,
- ServiceInfo serviceInfo,
- String serviceInfoMd5,
- FrameServiceEntity serviceEntity,
- Map> configFileMap,
- String decompressPackageName) {
+ String frameCode,
+ Integer frameInfoId,
+ String serviceName,
+ String serviceDdl,
+ ServiceInfo serviceInfo,
+ String serviceInfoMd5,
+ FrameServiceEntity serviceEntity,
+ Map> configFileMap,
+ String decompressPackageName) {
serviceEntity.setServiceName(serviceName);
serviceEntity.setLabel(serviceInfo.getLabel());
serviceEntity.setFrameId(frameInfoId);
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigFileMap.java b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigFileMap.java
index 216d7940..dd70bce9 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigFileMap.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigFileMap.java
@@ -25,18 +25,18 @@
import java.util.Map;
public class ServiceConfigFileMap {
-
+
private static HashMap>> map =
new HashMap>>();
-
+
public static void put(String key, Map> configs) {
map.put(key, configs);
}
-
+
public static Map> get(String key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigMap.java b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigMap.java
index 7b3b37b9..8e5d647e 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigMap.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceConfigMap.java
@@ -23,17 +23,17 @@
import java.util.List;
public class ServiceConfigMap {
-
+
private static HashMap> map = new HashMap>();
-
+
public static void put(String key, List configs) {
map.put(key, configs);
}
-
+
public static List get(String key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceInfoMap.java b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceInfoMap.java
index 977d2790..20b9a7f4 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceInfoMap.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceInfoMap.java
@@ -22,17 +22,17 @@
import java.util.HashMap;
public class ServiceInfoMap {
-
+
private static HashMap map = new HashMap();
-
+
public static void put(String key, ServiceInfo value) {
map.put(key, value);
}
-
+
public static ServiceInfo get(String key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleJmxMap.java b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleJmxMap.java
index 583f4975..269651f7 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleJmxMap.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleJmxMap.java
@@ -20,17 +20,17 @@
import java.util.HashMap;
public class ServiceRoleJmxMap {
-
+
private static HashMap map = new HashMap();
-
+
public static void put(String key, String value) {
map.put(key, value);
}
-
+
public static String get(String key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleMap.java b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleMap.java
index 90caa3ba..26dc8dc1 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleMap.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/load/ServiceRoleMap.java
@@ -22,17 +22,17 @@
import java.util.HashMap;
public class ServiceRoleMap {
-
+
private static HashMap map = new HashMap();
-
+
public static void put(String key, ServiceRoleInfo value) {
map.put(key, value);
}
-
+
public static ServiceRoleInfo get(String key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/ActorUtils.java b/datasophon-service/src/main/java/com/datasophon/api/master/ActorUtils.java
index f2ec42f8..79e5c693 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/master/ActorUtils.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/master/ActorUtils.java
@@ -17,21 +17,14 @@
package com.datasophon.api.master;
-import akka.actor.ActorRef;
-import akka.actor.ActorSelection;
-import akka.actor.ActorSystem;
-import akka.actor.Props;
-import akka.util.Timeout;
import com.datasophon.api.master.alert.ServiceRoleCheckActor;
import com.datasophon.common.command.ClusterCommand;
import com.datasophon.common.command.HostCheckCommand;
import com.datasophon.common.command.ServiceRoleCheckCommand;
import com.datasophon.common.enums.ClusterCommandType;
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.commons.lang3.StringUtils;
+
import scala.concurrent.Await;
import scala.concurrent.Future;
import scala.concurrent.duration.Duration;
@@ -45,21 +38,33 @@
import java.util.Random;
import java.util.concurrent.TimeUnit;
-public class ActorUtils {
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
- private static final Logger logger = LoggerFactory.getLogger(ActorUtils.class);
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
- public static ActorSystem actorSystem;
+import akka.actor.ActorRef;
+import akka.actor.ActorSelection;
+import akka.actor.ActorSystem;
+import akka.actor.Props;
+import akka.util.Timeout;
+public class ActorUtils {
+
+ private static final Logger logger = LoggerFactory.getLogger(ActorUtils.class);
+
+ public static ActorSystem actorSystem;
+
public static final String DATASOPHON = "datasophon";
-
+
public static final String AKKA_REMOTE_NETTY_TCP_HOSTNAME = "akka.remote.netty.tcp.hostname";
-
+
private static Random rand;
-
+
private ActorUtils() throws NoSuchAlgorithmException {
}
-
+
public static void init() throws UnknownHostException, NoSuchAlgorithmException {
String hostname = InetAddress.getLocalHost().getHostName();
Config config = ConfigFactory.parseString(AKKA_REMOTE_NETTY_TCP_HOSTNAME + "=" + hostname);
@@ -71,10 +76,10 @@ public static void init() throws UnknownHostException, NoSuchAlgorithmException
actorSystem.actorOf(Props.create(HostCheckActor.class), getActorRefName(HostCheckActor.class));
actorSystem.actorOf(Props.create(MasterNodeProcessingActor.class),
getActorRefName(MasterNodeProcessingActor.class));
-
+
ActorRef clusterCheckActor =
actorSystem.actorOf(Props.create(ClusterActor.class), getActorRefName(ClusterActor.class));
-
+
// 节点检测 5m 检测一次
actorSystem.scheduler().schedule(
FiniteDuration.apply(30L, TimeUnit.SECONDS),
@@ -83,7 +88,7 @@ public static void init() throws UnknownHostException, NoSuchAlgorithmException
new HostCheckCommand(),
actorSystem.dispatcher(),
ActorRef.noSender());
-
+
actorSystem.scheduler().schedule(
FiniteDuration.apply(15L, TimeUnit.SECONDS),
FiniteDuration.apply(15L, TimeUnit.SECONDS),
@@ -91,7 +96,7 @@ public static void init() throws UnknownHostException, NoSuchAlgorithmException
new ServiceRoleCheckCommand(),
actorSystem.dispatcher(),
ActorRef.noSender());
-
+
// 集群检测 1m 检测一次
actorSystem.scheduler().schedule(
FiniteDuration.apply(30L, TimeUnit.SECONDS),
@@ -100,11 +105,10 @@ public static void init() throws UnknownHostException, NoSuchAlgorithmException
new ClusterCommand(ClusterCommandType.CHECK),
actorSystem.dispatcher(),
ActorRef.noSender());
-
-
+
rand = SecureRandom.getInstanceStrong();
}
-
+
public static ActorRef getLocalActor(Class actorClass, String actorName) {
ActorSelection actorSelection = actorSystem.actorSelection("/user/" + actorName);
Timeout timeout = new Timeout(Duration.create(30, TimeUnit.SECONDS));
@@ -123,7 +127,7 @@ public static ActorRef getLocalActor(Class actorClass, String actorName) {
}
return actorRef;
}
-
+
private static ActorRef createActor(Class actorClass, String actorName) {
ActorRef actorRef;
try {
@@ -134,10 +138,10 @@ private static ActorRef createActor(Class actorClass, String actorName) {
actorRef = actorSystem.actorOf(Props.create(actorClass).withDispatcher("my-forkjoin-dispatcher"),
actorName + num);
}
-
+
return actorRef;
}
-
+
public static ActorRef getRemoteActor(String hostname, String actorName) {
String actorPath = "akka.tcp://datasophon@" + hostname + ":2552/user/worker/" + actorName;
ActorSelection actorSelection = actorSystem.actorSelection(actorPath);
@@ -149,10 +153,10 @@ public static ActorRef getRemoteActor(String hostname, String actorName) {
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
-
+
return actorRef;
}
-
+
/**
* shutdown
*/
@@ -165,12 +169,12 @@ public static void shutdown() {
actorSystem = null;
}
}
-
+
/**
* Get ActorRef name from Class name.
*/
public static String getActorRefName(Class clazz) {
return StringUtils.uncapitalize(clazz.getSimpleName());
}
-
+
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/CancelCommandMap.java b/datasophon-service/src/main/java/com/datasophon/api/master/CancelCommandMap.java
index c316605f..aae58673 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/master/CancelCommandMap.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/master/CancelCommandMap.java
@@ -3,16 +3,17 @@
import java.util.HashMap;
public class CancelCommandMap {
+
private static HashMap map = new HashMap();
-
+
public static void put(String key, String value) {
map.put(key, value);
}
-
+
public static String get(String key) {
return map.get(key);
}
-
+
public static boolean exists(String key) {
return map.containsKey(key);
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/ClusterActor.java b/datasophon-service/src/main/java/com/datasophon/api/master/ClusterActor.java
index 71571786..ea0bd01b 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/master/ClusterActor.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/master/ClusterActor.java
@@ -17,10 +17,6 @@
package com.datasophon.api.master;
-import akka.actor.UntypedActor;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.extra.spring.SpringUtil;
-import com.alibaba.fastjson.JSONArray;
import com.datasophon.api.service.ClusterInfoService;
import com.datasophon.api.service.ClusterServiceInstanceService;
import com.datasophon.api.service.ClusterServiceRoleGroupConfigService;
@@ -41,8 +37,6 @@
import com.datasophon.dao.entity.ClusterServiceRoleInstanceEntity;
import com.datasophon.dao.enums.ClusterState;
import com.datasophon.dao.enums.ServiceRoleState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
@@ -50,16 +44,25 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.alibaba.fastjson.JSONArray;
+
+import akka.actor.UntypedActor;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.extra.spring.SpringUtil;
/**
* 节点状态监测
*/
public class ClusterActor extends UntypedActor {
-
+
private static final Logger logger = LoggerFactory.getLogger(ClusterActor.class);
-
+
private static final String DEPRECATED = "Deprecated";
-
+
@Override
public void onReceive(Object msg) throws Throwable {
if (msg instanceof ClusterCommand) {
@@ -68,47 +71,54 @@ public void onReceive(Object msg) throws Throwable {
SpringUtil.getBean(ClusterServiceRoleInstanceService.class);
ClusterInfoService clusterInfoService =
SpringUtil.getBean(ClusterInfoService.class);
-
+
// Host or cluster
final ClusterCommand clusterCommand = (ClusterCommand) msg;
-
+
if (ClusterCommandType.CHECK.equals(clusterCommand.getCommandType())) {
// 获取所有集群
Result result = clusterInfoService.getClusterList();
List clusterList = (List) result.getData();
-
+
for (ClusterInfoEntity clusterInfoEntity : clusterList) {
// 获取集群上正在运行的服务
int clusterId = clusterInfoEntity.getId();
- List roleInstanceList = roleInstanceService.getServiceRoleInstanceListByClusterId(clusterId);
+ List roleInstanceList =
+ roleInstanceService.getServiceRoleInstanceListByClusterId(clusterId);
if (!ClusterState.NEED_CONFIG.equals(clusterInfoEntity.getClusterState())) {
if (!roleInstanceList.isEmpty()) {
- if (roleInstanceList.stream().allMatch(roleInstance -> ServiceRoleState.STOP.equals(roleInstance.getServiceRoleState()))) {
+ if (roleInstanceList.stream().allMatch(
+ roleInstance -> ServiceRoleState.STOP.equals(roleInstance.getServiceRoleState()))) {
clusterInfoService.updateClusterState(clusterId, ClusterState.STOP.getValue());
} else {
clusterInfoService.updateClusterState(clusterId, ClusterState.RUNNING.getValue());
}
}
-
+
}
}
-
+
} else if (ClusterCommandType.DELETE.equals(clusterCommand.getCommandType())) {
Integer clusterId = clusterCommand.getClusterId();
if (Objects.nonNull(clusterId)) {
ClusterInfoEntity clusterInfo = clusterInfoService.getById(clusterId);
if (Objects.nonNull(clusterInfo)) {
ClusterHostService clusterHostService = SpringUtil.getBean(ClusterHostService.class);
- ClusterServiceInstanceService clusterServiceInstanceService = SpringUtil.getBean(ClusterServiceInstanceService.class);
- ClusterServiceRoleInstanceService clusterServiceRoleInstanceService = SpringUtil.getBean(ClusterServiceRoleInstanceService.class);
- ClusterServiceRoleGroupConfigService clusterServiceRoleGroupConfigService = SpringUtil.getBean(ClusterServiceRoleGroupConfigService.class);
-
+ ClusterServiceInstanceService clusterServiceInstanceService =
+ SpringUtil.getBean(ClusterServiceInstanceService.class);
+ ClusterServiceRoleInstanceService clusterServiceRoleInstanceService =
+ SpringUtil.getBean(ClusterServiceRoleInstanceService.class);
+ ClusterServiceRoleGroupConfigService clusterServiceRoleGroupConfigService =
+ SpringUtil.getBean(ClusterServiceRoleGroupConfigService.class);
+
// 检查服务实例配置与目录
- List roleInstanceList = clusterServiceRoleInstanceService.getServiceRoleInstanceListByClusterId(clusterId);
+ List roleInstanceList =
+ clusterServiceRoleInstanceService.getServiceRoleInstanceListByClusterId(clusterId);
for (ClusterServiceRoleInstanceEntity roleInstance : roleInstanceList) {
String roleName = roleInstance.getServiceRoleName();
String hostname = roleInstance.getHostname();
- ClusterServiceRoleGroupConfig config = clusterServiceRoleGroupConfigService.getConfigByRoleGroupId(roleInstance.getRoleGroupId());
+ ClusterServiceRoleGroupConfig config = clusterServiceRoleGroupConfigService
+ .getConfigByRoleGroupId(roleInstance.getRoleGroupId());
Map> configFileMap = new ConcurrentHashMap<>();
ProcessUtils.generateConfigFileMap(configFileMap, config, clusterId);
for (Map.Entry> configFile : configFileMap.entrySet()) {
@@ -118,17 +128,20 @@ public void onReceive(Object msg) throws Throwable {
if (Constants.INPUT.equals(c.getType())) {
String oldPath = (String) c.getValue();
if (!oldPath.contains(DEPRECATED)) {
- String newPath = String.format("%s_%s_%s_%s", oldPath, DEPRECATED, clusterId, DateUtil.today());
+ String newPath = String.format("%s_%s_%s_%s", oldPath, DEPRECATED,
+ clusterId, DateUtil.today());
c.setValue(newPath);
c.setConfigType(Constants.MV_PATH);
}
} else if (Constants.MULTIPLE.equals(c.getType())) {
JSONArray value = (JSONArray) c.getValue();
List oldPaths = value.toJavaList(String.class);
- List newPaths = oldPaths.stream().map(path -> !path.contains(DEPRECATED) ?
- String.format("%s_%s_%s_%s", path, DEPRECATED, clusterId, DateUtil.today())
- : path
- ).collect(Collectors.toList());
+ List newPaths = oldPaths.stream()
+ .map(path -> !path.contains(DEPRECATED)
+ ? String.format("%s_%s_%s_%s", path, DEPRECATED,
+ clusterId, DateUtil.today())
+ : path)
+ .collect(Collectors.toList());
c.setValue(newPaths);
c.setConfigType(Constants.MV_PATH);
}
@@ -141,7 +154,7 @@ public void onReceive(Object msg) throws Throwable {
configFileMap.remove(configFile.getKey());
}
}
-
+
if (!configFileMap.isEmpty()) {
// 分发重命名命令
ExecResult execResult = new ExecResult();
@@ -150,7 +163,8 @@ public void onReceive(Object msg) throws Throwable {
"start to uninstall {} in host {}",
roleName,
hostname);
- execResult = ProcessUtils.configServiceRoleInstance(clusterInfo, configFileMap, roleInstance);
+ execResult = ProcessUtils.configServiceRoleInstance(clusterInfo, configFileMap,
+ roleInstance);
if (Objects.nonNull(execResult) && execResult.getExecResult()) {
logger.info(
"{} uninstall success in {}",
@@ -163,7 +177,7 @@ public void onReceive(Object msg) throws Throwable {
hostname);
return;
}
-
+
} catch (Exception e) {
logger.info(
"{} uninstall failed in {}",
@@ -174,10 +188,13 @@ public void onReceive(Object msg) throws Throwable {
}
}
}
- List serviceInstanceList = clusterServiceInstanceService.listAll(clusterId);
- if (serviceInstanceList.stream().allMatch(instance -> clusterServiceInstanceService.delServiceInstance(instance.getId()).isSuccess())) {
+ List serviceInstanceList =
+ clusterServiceInstanceService.listAll(clusterId);
+ if (serviceInstanceList.stream().allMatch(instance -> clusterServiceInstanceService
+ .delServiceInstance(instance.getId()).isSuccess())) {
List hostList = clusterHostService.getHostListByClusterId(clusterId);
- clusterHostService.deleteHosts(hostList.stream().map(h -> String.valueOf(h.getId())).collect(Collectors.joining(Constants.COMMA)));
+ clusterHostService.deleteHosts(hostList.stream().map(h -> String.valueOf(h.getId()))
+ .collect(Collectors.joining(Constants.COMMA)));
clusterInfoService.removeById(clusterId);
}
}
diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/DAGBuildActor.java b/datasophon-service/src/main/java/com/datasophon/api/master/DAGBuildActor.java
index 52b4abc0..3eea6f57 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/master/DAGBuildActor.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/master/DAGBuildActor.java
@@ -17,7 +17,11 @@
package com.datasophon.api.master;
-import com.datasophon.api.service.*;
+import com.datasophon.api.service.ClusterInfoService;
+import com.datasophon.api.service.ClusterServiceCommandHostCommandService;
+import com.datasophon.api.service.ClusterServiceCommandService;
+import com.datasophon.api.service.FrameServiceRoleService;
+import com.datasophon.api.service.FrameServiceService;
import com.datasophon.api.strategy.ServiceRoleStrategy;
import com.datasophon.api.strategy.ServiceRoleStrategyContext;
import com.datasophon.api.utils.SpringTool;
@@ -30,11 +34,19 @@
import com.datasophon.common.model.DAGGraph;
import com.datasophon.common.model.ServiceNode;
import com.datasophon.common.model.ServiceRoleInfo;
-import com.datasophon.dao.entity.*;
-
-import org.apache.commons.lang.StringUtils;
-
-import java.util.*;
+import com.datasophon.dao.entity.ClusterInfoEntity;
+import com.datasophon.dao.entity.ClusterServiceCommandEntity;
+import com.datasophon.dao.entity.ClusterServiceCommandHostCommandEntity;
+import com.datasophon.dao.entity.FrameServiceEntity;
+import com.datasophon.dao.entity.FrameServiceRoleEntity;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
@@ -47,18 +59,18 @@
import cn.hutool.core.util.ArrayUtil;
public class DAGBuildActor extends UntypedActor {
-
+
private static final Logger logger = LoggerFactory.getLogger(DAGBuildActor.class);
-
+
@Override
public void onReceive(Object message) throws Throwable {
if (message instanceof StartExecuteCommandCommand) {
DAGGraph dag = new DAGGraph<>();
-
+
StartExecuteCommandCommand executeCommandCommand = (StartExecuteCommandCommand) message;
CommandType commandType = executeCommandCommand.getCommandType();
logger.info("start execute command");
-
+
ClusterServiceCommandService commandService =
SpringTool.getApplicationContext().getBean(ClusterServiceCommandService.class);
ClusterServiceCommandHostCommandService hostCommandService =
@@ -68,11 +80,11 @@ public void onReceive(Object message) throws Throwable {
FrameServiceService frameService = SpringTool.getApplicationContext().getBean(FrameServiceService.class);
ClusterInfoService clusterInfoService =
SpringTool.getApplicationContext().getBean(ClusterInfoService.class);
-
+
ClusterInfoEntity clusterInfo = clusterInfoService.getById(executeCommandCommand.getClusterId());
List commandList = commandService.lambdaQuery()
.in(ClusterServiceCommandEntity::getCommandId, executeCommandCommand.getCommandIds()).list();
-
+
ArrayList frameServiceList = new ArrayList<>();
if (ArrayUtil.isNotEmpty(commandList)) {
for (ClusterServiceCommandEntity command : commandList) {
@@ -80,21 +92,21 @@ public void onReceive(Object message) throws Throwable {
List masterRoles = new ArrayList<>();
List elseRoles = new ArrayList<>();
ServiceNode serviceNode = new ServiceNode();
-
+
List hostCommandList =
hostCommandService.getHostCommandListByCommandId(command.getCommandId());
-
+
FrameServiceEntity serviceEntity = frameService.getServiceByFrameCodeAndServiceName(
clusterInfo.getClusterFrame(), command.getServiceName());
frameServiceList.add(serviceEntity);
-
+
serviceNode.setCommandId(command.getCommandId());
for (ClusterServiceCommandHostCommandEntity hostCommand : hostCommandList) {
logger.info("service role is {}", hostCommand.getServiceRoleName());
FrameServiceRoleEntity frameServiceRoleEntity =
frameServiceRoleService.getServiceRoleByFrameCodeAndServiceRoleName(
clusterInfo.getClusterFrame(), hostCommand.getServiceRoleName());
-
+
ServiceRoleInfo serviceRoleInfo = JSONObject
.parseObject(frameServiceRoleEntity.getServiceRoleJson(), ServiceRoleInfo.class);
serviceRoleInfo.setHostname(hostCommand.getHostname());
@@ -106,13 +118,13 @@ public void onReceive(Object message) throws Throwable {
serviceRoleInfo.setCommandType(commandType);
serviceRoleInfo.setServiceInstanceId(command.getServiceInstanceId());
serviceRoleInfo.setFrameCode(serviceEntity.getFrameCode());
-
+
ServiceRoleStrategy serviceRoleHandler =
ServiceRoleStrategyContext.getServiceRoleHandler(serviceRoleInfo.getName());
if (Objects.nonNull(serviceRoleHandler)) {
serviceRoleHandler.handlerServiceRoleInfo(serviceRoleInfo, hostCommand.getHostname());
}
-
+
if (ServiceRoleType.MASTER.equals(serviceRoleInfo.getRoleType())) {
masterRoles.add(serviceRoleInfo);
} else {
@@ -134,23 +146,23 @@ public void onReceive(Object message) throws Throwable {
}
}
}
-
+
if (commandType == CommandType.STOP_SERVICE) {
logger.info("reverse dag");
dag = dag.getReverseDagGraph(dag);
}
-
+
Map errorTaskList = new ConcurrentHashMap<>();
Map activeTaskList = new ConcurrentHashMap<>();
Map readyToSubmitTaskList = new ConcurrentHashMap<>();
Map completeTaskList = new ConcurrentHashMap<>();
-
+
Collection beginNode = dag.getBeginNode();
logger.info("beginNode is {}", beginNode.toString());
for (String node : beginNode) {
readyToSubmitTaskList.put(node, "");
}
-
+
SubmitActiveTaskNodeCommand submitActiveTaskNodeCommand = new SubmitActiveTaskNodeCommand();
submitActiveTaskNodeCommand.setCommandType(executeCommandCommand.getCommandType());
submitActiveTaskNodeCommand.setDag(dag);
@@ -160,7 +172,7 @@ public void onReceive(Object message) throws Throwable {
submitActiveTaskNodeCommand.setReadyToSubmitTaskList(readyToSubmitTaskList);
submitActiveTaskNodeCommand.setCompleteTaskList(completeTaskList);
submitActiveTaskNodeCommand.setClusterCode(clusterInfo.getClusterCode());
-
+
ActorRef submitTaskNodeActor = ActorUtils.getLocalActor(SubmitTaskNodeActor.class,
ActorUtils.getActorRefName(SubmitTaskNodeActor.class));
submitTaskNodeActor.tell(submitActiveTaskNodeCommand, getSelf());
diff --git a/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java b/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java
index 7ac37809..8007d384 100644
--- a/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java
+++ b/datasophon-service/src/main/java/com/datasophon/api/master/DispatcherWorkerActor.java
@@ -19,7 +19,6 @@
package com.datasophon.api.master;
-import cn.hutool.core.io.FileUtil;
import com.datasophon.api.master.handler.host.CheckWorkerMd5Handler;
import com.datasophon.api.master.handler.host.DecompressWorkerHandler;
import com.datasophon.api.master.handler.host.DispatcherWorkerHandlerChain;
@@ -34,30 +33,32 @@
import com.datasophon.common.command.DispatcherHostAgentCommand;
import com.datasophon.common.enums.InstallState;
import com.datasophon.common.model.HostInfo;
-
import com.datasophon.common.utils.HostUtils;
+
import org.apache.sshd.client.session.ClientSession;
import scala.Option;
+import java.nio.charset.Charset;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import akka.actor.UntypedActor;
-import cn.hutool.core.util.ObjectUtil;
-import java.nio.charset.Charset;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ObjectUtil;
public class DispatcherWorkerActor extends UntypedActor {
-
+
private static final Logger logger = LoggerFactory.getLogger(DispatcherWorkerActor.class);
-
+
@Override
public void preRestart(Throwable reason, Option