Skip to content

Commit

Permalink
[Improve] trivial improvements (#3699)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallyao authored May 9, 2024
1 parent 12ff1be commit fbdbd27
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,25 +311,6 @@ create table `t_variable` (
unique key `un_team_vcode_inx` (`team_id`,`variable_code`) using btree
) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci;

-- ----------------------------
-- Table of t_resource
-- ----------------------------
drop table if exists `t_resource`;
create table `t_resource` (
`id` bigint not null auto_increment,
`resource_name` varchar(128) collate utf8mb4_general_ci not null comment 'The name of the resource file',
`resource_type` int not null comment '0:app 1:common 2:connector 3:format 4:udf',
`resource` text collate utf8mb4_general_ci comment 'resource content, including jars and poms',
`engine_type` int not null comment 'compute engine type, 0:apache flink 1:apache spark',
`main_class` varchar(255) collate utf8mb4_general_ci default null,
`description` text collate utf8mb4_general_ci default null comment 'More detailed description of resource',
`creator_id` bigint collate utf8mb4_general_ci not null comment 'user id of creator',
`team_id` bigint collate utf8mb4_general_ci not null comment 'team id',
`create_time` datetime default null comment 'create time',
`modify_time` datetime default null comment 'modify time',
primary key (`id`) using btree,
unique key `un_team_vcode_inx` (`team_id`,`resource_name`) using btree
) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for t_role
Expand Down Expand Up @@ -541,11 +522,11 @@ create table `t_yarn_queue` (
-- ----------------------------
drop table if exists `t_resource`;
create table if not exists `t_resource` (
`id` bigint not null auto_increment primary key,
`id` bigint not null auto_increment ,
`resource_name` varchar(128) not null comment 'The name of the resource',
`resource_type` int not null comment '0:app 1:common 2:connector 3:format 4:udf',
`resource_path` varchar(255) default null,
`resource` text,
`resource` text comment 'resource content, including jars and poms',
`engine_type` int not null comment 'compute engine type, 0:apache flink 1:apache spark',
`main_class` varchar(255) default null,
`description` text default null comment 'More detailed description of resource',
Expand All @@ -554,8 +535,10 @@ create table if not exists `t_resource` (
`connector_optional_options` text default null,
`team_id` bigint not null comment 'team id',
`create_time` datetime default null comment 'create time',
`modify_time` datetime not null default current_timestamp comment 'modify time'
);
`modify_time` datetime not null default current_timestamp comment 'modify time',
primary key (`id`) using btree,
unique key `un_team_vcode_inx` (`team_id`,`resource_name`) using btree
) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci;


-- ----------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@ public ResponseResult check(FlinkCluster cluster) {
ResponseResult result = new ResponseResult();
result.setStatus(0);

// 1) Check name is already exists
// 1) Check name if already exists
Boolean existsByClusterName =
this.existsByClusterName(cluster.getClusterName(), cluster.getId());
if (existsByClusterName) {
result.setMsg("ClusterName is already exists, please check!");
result.setMsg("ClusterName already exists, please check!");
result.setStatus(1);
return result;
}

// 2) Check target-cluster is already exists
// 2) Check target-cluster if already exists
String clusterId = cluster.getClusterId();
if (StringUtils.isNotBlank(clusterId) && this.existsByClusterId(clusterId, cluster.getId())) {
result.setMsg("The clusterId " + clusterId + " is already exists,please check!");
result.setMsg("The clusterId " + clusterId + " already exists,please check!");
result.setStatus(2);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private RestResponse checkConnector(Resource resourceParam) throws JsonProcessin
boolean exists =
existsFlinkConnector(resourceParam.getId(), connectorResource.getFactoryIdentifier());
if (exists) {
return buildExceptResponse(new RuntimeException("connector is already exists"), 4);
return buildExceptResponse(new RuntimeException("connector already exists"), 4);
}

if (resourceParam.getId() != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private Optional<Integer> tryGetChkNumRetainedFromDynamicProps(String dynamicPro
return Optional.of(value);
}
log.warn(
"This value of dynamicProperties key: state.checkpoints.num-retained is invalid, must be gt 0");
"This value of dynamicProperties key: state.checkpoints.num-retained is invalid, must be greater than 0");
} catch (NumberFormatException e) {
log.warn(
"This value of dynamicProperties key: state.checkpoints.num-retained invalid, must be number");
Expand Down Expand Up @@ -425,11 +425,11 @@ private int getChkNumRetainedFromFlinkEnv(
return value;
}
log.warn(
"The value of key: state.checkpoints.num-retained in flink-conf.yaml is invalid, must be gt 0, default value: {} will be use",
"The value of key: state.checkpoints.num-retained in flink-conf.yaml is invalid, must be greater than 0, default value: {} will be used",
MAX_RETAINED_CHECKPOINTS.defaultValue());
} catch (NumberFormatException e) {
log.warn(
"The value of key: state.checkpoints.num-retained in flink-conf.yaml is invalid, must be number, flink env: {}, default value: {} will be use",
"The value of key: state.checkpoints.num-retained in flink-conf.yaml is invalid, must be number, flink env: {}, default value: {} will be used",
flinkEnv.getFlinkHome(),
flinkConfNumRetained);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
executionMode: 'Execution Mode',
historyVersion: 'History Version',
resource: 'Resource',
resourcePlaceHolder: 'please choose resource',
resourcePlaceHolder: 'Please choose resource',
selectAppPlaceHolder: 'choose app jar',
dependency: 'Dependency',
appConf: 'Application Conf',
Expand Down Expand Up @@ -244,38 +244,38 @@ export default {
terminated: 'TERMINATED',
},
addAppTips: {
developmentModePlaceholder: 'please select job type',
developmentModePlaceholder: 'Please select job type',
developmentModeIsRequiredMessage: 'Job Type is required',
executionModePlaceholder: 'please select execution mode',
executionModePlaceholder: 'Please select execution mode',
executionModeIsRequiredMessage: 'Execution Mode is required',
hadoopEnvInitMessage:
'Hadoop environment initialization failed, please check the environment settings',
resourceFromMessage: 'resource from is required',
mainClassPlaceholder: 'Please enter Main class',
mainClassIsRequiredMessage: 'Program Main is required',
projectPlaceholder: 'Please select Project',
projectPlaceholder: 'Please select project',
projectIsRequiredMessage: 'Project is required',
projectModulePlaceholder: 'Please select module of this project',
appTypePlaceholder: 'Please select Application type',
appTypePlaceholder: 'Please select application type',
appTypeIsRequiredMessage: 'Application Type is required',
programJarIsRequiredMessage: 'Program Jar is required',
useSysHadoopConf: 'Use System Hadoop Conf',
flinkVersionIsRequiredMessage: 'Flink Version is required',
appNamePlaceholder: 'Please enter application Name',
appNameIsRequiredMessage: 'The application Name is required',
appNameNotUniqueMessage: 'The application Name is already exists, must be unique. ',
appNamePlaceholder: 'Please enter application name',
appNameIsRequiredMessage: 'The application name is required',
appNameNotUniqueMessage: 'The application name already exists, must be unique. ',
appNameExistsInYarnMessage:
'The application name is already exists in YARN, cannot be repeated. Please check',
'The application name already exists in YARN, cannot be repeated. Please check',
appNameExistsInK8sMessage:
'The application name is already exists in Kubernetes,cannot be repeated. Please check',
'The application name already exists in Kubernetes,cannot be repeated. Please check',
appNameNotValid:
'The application name is invalid, must be (Chinese or English or "-" or "_"), two consecutive spaces cannot appear.Please check',
flinkClusterIsRequiredMessage: 'Flink Cluster is required',
flinkSqlIsRequiredMessage: 'Flink SQL is required',
tagsPlaceholder: 'Please enter tags,if more than one, separate them with commas(,)',
parallelismPlaceholder: 'The parallelism with which to run the program',
slotsOfPerTaskManagerPlaceholder: 'Number of slots per TaskManager',
restartSizePlaceholder: 'restart max size',
restartSizePlaceholder: 'Restart max size',
alertTemplatePlaceholder: 'Alert Template',
totalMemoryOptionsPlaceholder: 'Please select the resource parameters to set',
tmPlaceholder: 'Please select the resource parameters to set',
Expand All @@ -293,7 +293,7 @@ export default {
hadoopXmlConfigFileTips:
'Automatically copy configuration files from system environment parameters',
dynamicPropertiesPlaceholder:
'$key=$value,If there are multiple parameters,you can new line enter them (-D <arg>)',
'Enter $key=$value,if there are multiple parameters,you can enter them on the new line (-D <arg>)',
},
noteInfo: {
note: 'Note',
Expand All @@ -308,7 +308,7 @@ export default {
totalMemoryNote:
'Explicitly configuring both "total process memory" and "total Flink memory" is not recommended. It may lead to deployment failures due to potential memory configuration conflicts. Configuring other memory components also requires caution as it can produce further configuration conflicts, The easiest way is to set "total process memory"',
dynamicProperties:
'It works the same as -D$property=$value in CLI mode, Allows specifying multiple generic configuration options. The available options can be found from',
'It works the same as -D$property=$value in CLI mode, allows specifying multiple generic configuration options. The available options can be found from',
yarnQueue:
'It\'s used to quickly specify not only "yarn.application.name" but also "yarn.application.node-label". For example, "queue1" represents the value of "yarn.application.name" is "queue1", but "queue1{\'@\'}label1,label2" represents that the value of "yarn.application.name" is "queue1" and the value of "yarn.application.node-label" is "label1,label2". The queue and label are joined by {\'@\'}.',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default {
searchPlaceholder: 'please enter a keyword search',
form: {
projectName: 'Project Name',
projectNamePlaceholder: 'please input Project Name',
projectNamePlaceholder: 'Please input project name',
projectType: 'Project Type',
projectTypePlaceholder: 'please select project type',
projectTypePlaceholder: 'Please select project type',
cvs: 'CVS',
prvkeyPath: 'Private Key Path',
prvkeyPathPlaceholder: 'private key path, e.g: ~/.ssh/id_rsa',
Expand All @@ -47,7 +47,7 @@ export default {
branchesPlaceholder: 'Select a branch',
pom: 'POM',
pomPlaceholder:
'By default,lookup pom.xml in root path,You can manually specify the module to compile pom.xmlh',
'By default,lookup pom.xml in root path,you can manually specify the module to compile pom.xml',
buildArgs: 'Build Argument',
buildArgsPlaceholder: 'Build Argument, e.g: -Pprod',
description: 'description',
Expand All @@ -57,12 +57,12 @@ export default {
},
operationTips: {
projectNameIsRequiredMessage: 'Project Name is required',
projectNameIsUniqueMessage: 'The Project Name is already exists. Please check',
projectNameIsUniqueMessage: 'The Project Name already exists. Please check',
projectTypeIsRequiredMessage: 'Project Type is required',
cvsIsRequiredMessage: 'CVS is required',
repositoryURLIsRequiredMessage: 'Repository URL is required',
pomSpecifiesModuleMessage:
'Specifies the module to compile pom.xml If it is not specified, it is found under the root path pom.xml',
'Specifies the module to compile pom.xml if it is not specified, it is found under the root path pom.xml',
projectIsbuildingMessage: 'The current project is building',
projectIsbuildFailedMessage: 'Build Fail',
deleteProjectSuccessMessage: 'delete successful',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export default {
description: 'Description',
},
form: {
descriptionMessage: 'exceeds maximum length limit of 100 characters',
resourceNameIsRequiredMessage: 'resource name is required',
engineTypeIsRequiredMessage: 'compute engine type is required',
resourceTypeIsRequiredMessage: 'resource type is required',
descriptionMessage: 'Exceeds maximum length limit of 100 characters',
resourceNameIsRequiredMessage: 'Resource name is required',
engineTypeIsRequiredMessage: 'Compute engine type is required',
resourceTypeIsRequiredMessage: 'Resource type is required',
resourceTypePlaceholder: 'Please select resource type',
exists: 'Sorry, the Resource already exists',
empty: 'Resource cannot be empty',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default {
},
fail: {
title: 'Failed create AlertConfig',
subTitle: 'alertName {0} is already exists!',
subTitle: 'alertName {0} already exists!',
update: 'Failed update AlertConfig',
},
success: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default {
placeholder: {
addType: 'Please select cluster Add Type',
clusterName: 'Please enter cluster name',
executionMode: 'Please enter cluster name',
versionId: 'please select Flink Version',
executionMode: 'Please enter execution mode',
versionId: 'Please select flink version',
addressRemoteMode: 'Please enter jobManager URL',
addressNoRemoteMode: 'Please enter cluster address, e.g: http://host:port',
yarnSessionClusterId: 'Please enter Yarn Session cluster',
Expand All @@ -65,7 +65,7 @@ export default {
clusterDescription: 'Please enter description for this application',
},
required: {
address: 'cluster address is required',
address: 'Cluster address is required',
executionMode: 'Execution Mode is required',
clusterId: 'Yarn Session Cluster is required',
versionId: 'Flink Version is required',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ export default {
description: 'description',
descriptionPlaceholder: 'Please enter description',
operateMessage: {
flinkNameTips: 'the flink name, e.g: flink-1.12',
flinkNameIsRepeated: 'flink name is already exists',
flinkNameIsRequired: 'flink name is required',
flinkNameTips: 'The flink name, e.g: flink-1.12',
flinkNameIsRepeated: 'Flink name already exists',
flinkNameIsRequired: 'Flink name is required',
flinkHomeTips: 'The absolute path of the FLINK_HOME',
flinkHomeIsRequired: 'flink home is required',
flinkHomePathIsInvalid: 'flink home path is invalid',
flinkDistNotFound: 'can no found flink-dist in FLINK_HOME/lib',
flinkDistIsRepeated: 'found multiple flink-dist in FLINK_HOME/lib, Must be only one',
flinkHomeIsRequired: 'Flink home is required',
flinkHomePathIsInvalid: 'Flink home path is invalid',
flinkDistNotFound: 'Can not find flink-dist in FLINK_HOME/lib',
flinkDistIsRepeated: 'Found multiple flink-dist in FLINK_HOME/lib, must be only one',
createFlinkHomeSuccessful: ' create successful!',
updateFlinkHomeSuccessful: ' update successful!',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ export default {
createTime: 'Create Time',
modifyTime: 'Modify Time',
},
userNameRequire: 'please select a user name',
roleRequire: 'please select role',
userNameRequire: 'Please select a user name',
roleRequire: 'Please select a role',
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default {
table: {
title: 'Team List',
teamName: 'Team Name',
teamNamePlaceholder: 'please enter Team Name',
teamNamePlaceholder: 'Please enter team name',
description: 'Description',
descriptionMessage: 'exceeds maximum length limit of 100 characters',
teamMessage: 'teamName must be at least 4 characters',
descriptionMessage: 'Exceeds maximum length limit of 100 characters',
teamMessage: 'Team name must be at least 4 characters',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export const renderDynamicProperties = ({ model, field }: RenderCallbackParams)
<Input.TextArea
rows={8}
name="dynamicProperties"
placeholder="$key=$value,If there are multiple parameters,you can new line enter them (-D <arg>)"
placeholder="Enter $key=$value,if there are multiple parameters,you can enter them on the new line(-D <arg>)"
value={model[field]}
onInput={(e: ChangeEvent) => (model[field] = e?.target?.value)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const useProject = () => {
componentProps: {
placeholder: t('flink.project.form.projectTypePlaceholder'),
options: [
{ label: 'apache flink', value: ProjectTypeEnum.FLINK, disabled: false },
{ label: 'apache spark', value: ProjectTypeEnum.SPARK, disabled: true },
{ label: 'Apache Flink', value: ProjectTypeEnum.FLINK, disabled: false },
{ label: 'Apache Spark', value: ProjectTypeEnum.SPARK, disabled: true },
],
showSearch: true,
optionFilterProp: 'children',
Expand Down

0 comments on commit fbdbd27

Please sign in to comment.