Browse Source

api server useless code and chinese modify (#1198)

* add ConnectionFactoryTest and ConnectionFactory read datasource from appliction.yml

* .escheduler_env.sh to dolphinscheduler_env.sh

* dao yml assembly to conf directory

* table name modify

* entity title table  name modify

* logback log name modify

* running through the big process

* running through the big process error modify

* logback log name modify

* data_source.properties rename

* logback log name modify

* install.sh optimization

* install.sh optimization

* command count modify

* command state update

* countCommandState sql update

* countCommandState sql update

* remove application.yml file

* master.properties modify

* install.sh modify

* install.sh modify

* api server startup modify

* the current user quits and the session is completely emptied. bug fix

* remove pom package resources

* checkQueueNameExist method update

* checkQueueExist

* install.sh error output update

* signOut error update

* ProcessDao is null bug fix

* install.sh add mail.user

* request url variables replace

* process define import bug fix

* process define import export bug fix

* processdefine import export bug fix

* down log suffix format modify

* import export process define contains crontab error bug fix

* add Flink local mode

* ProcessDao is null bug fix

* loadAverage display problem bug fix

* MasterServer rename Server

* rollback .env

* rollback .env

* MasterServer rename Server

* the task is abnormal and task is running bug fix

* owners and administrators can delete

* dockerfile optimization

* dockerfile optimization

* dockerfile optimization

* remove application-alert.properties

* task log print worker log bug fix

* remove .escheduler_env.sh

* change dockerfile email address

* dockerfile dao application.properties and install.sh modify

* application.properties modify

* application.properties modify

* dockerfile startup.sh modify

* remove docs

* nginx conf modify

* dockerfile application.properties modify

* dockerfile email address change

* the alert module is modified in English.

* alert server comment and chinese modify

* api server useless code and chinese modify
pull/2/head
qiaozhanwei 5 years ago committed by bao liang
parent
commit
1fad357fc2
  1. 225
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java
  2. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/DefineUserDto.java
  3. 1
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ScheduleParam.java
  4. 5
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/gantt/GanttDto.java
  5. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/gantt/Task.java
  6. 7
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/treeview/Instance.java
  7. 1
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/treeview/TreeViewDto.java
  8. 10
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/ExecuteType.java
  9. 3
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
  10. 29
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/DruidStatFilter.java
  11. 34
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/DruidStatViewServlet.java
  12. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/Result.java
  13. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZooKeeperState.java

225
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java

@ -281,229 +281,4 @@ public class ServiceModelToSwagger2MapperImpl extends ServiceModelToSwagger2Mapp
return modelMapper.mapModels(definitions);
}
//
//
//
// private static final VendorExtensionsMapper vendorMapper = new VendorExtensionsMapper();
//
//
//
// public Parameter mapParameter(springfox.documentation.service.Parameter source) {
// Parameter bodyParameter = bodyParameter(source);
// return SerializableParameterFactories.create(source).or(bodyParameter);
// }
//
// private Parameter bodyParameter(springfox.documentation.service.Parameter source) {
// BodyParameter parameter = new BodyParameter()
// .description(source.getDescription())
// .name(source.getName())
// .schema(fromModelRef(source.getModelRef()));
// parameter.setIn(source.getParamType());
// parameter.setAccess(source.getParamAccess());
// parameter.setPattern(source.getPattern());
// parameter.setRequired(source.isRequired());
// parameter.getVendorExtensions().putAll(vendorMapper.mapExtensions(source.getVendorExtentions()));
// for (Map.Entry<String, Collection<Example>> each : source.getExamples().asMap().entrySet()) {
// Optional<Example> example = FluentIterable.from(each.getValue()).first();
// if (example.isPresent() && example.get().getValue() != null) {
// parameter.addExample(each.getKey(), String.valueOf(example.get().getValue()));
// }
// }
//
// //TODO: swagger-core Body parameter does not have an enum property
// return parameter;
// }
//
// Model fromModelRef(ModelReference modelRef) {
// if (modelRef.isCollection()) {
// if (modelRef.getItemType().equals("byte")) {
// ModelImpl baseModel = new ModelImpl();
// baseModel.setType("string");
// baseModel.setFormat("byte");
// return maybeAddAllowableValuesToParameter(baseModel, modelRef.getAllowableValues());
// } else if (modelRef.getItemType().equals("file")) {
// ArrayModel files = new ArrayModel();
// files.items(new FileProperty());
// return files;
// }
// ModelReference itemModel = modelRef.itemModel().get();
// return new ArrayModel()
// .items(maybeAddAllowableValues(itemTypeProperty(itemModel), itemModel.getAllowableValues()));
// }
// if (modelRef.isMap()) {
// ModelImpl baseModel = new ModelImpl();
// ModelReference itemModel = modelRef.itemModel().get();
// baseModel.additionalProperties(
// maybeAddAllowableValues(
// itemTypeProperty(itemModel),
// itemModel.getAllowableValues()));
// return baseModel;
// }
// if (isBaseType(modelRef.getType())) {
// Property property = property(modelRef.getType());
// ModelImpl baseModel = new ModelImpl();
// baseModel.setType(property.getType());
// baseModel.setFormat(property.getFormat());
// return maybeAddAllowableValuesToParameter(baseModel, modelRef.getAllowableValues());
//
// }
// return new RefModel(modelRef.getType());
// }
//
//
// private static class Properties {
// private static final Map<String, Function<String, ? extends Property>> typeFactory
// = ImmutableMap.<String, Function<String, ? extends Property>>builder()
// .put("int", newInstanceOf(IntegerProperty.class))
// .put("long", newInstanceOf(LongProperty.class))
// .put("float", newInstanceOf(FloatProperty.class))
// .put("double", newInstanceOf(DoubleProperty.class))
// .put("string", newInstanceOf(StringProperty.class))
// .put("boolean", newInstanceOf(BooleanProperty.class))
// .put("date", newInstanceOf(DateProperty.class))
// .put("date-time", newInstanceOf(DateTimeProperty.class))
// .put("bigdecimal", newInstanceOf(DecimalProperty.class))
// .put("biginteger", newInstanceOf(BaseIntegerProperty.class))
// .put("uuid", newInstanceOf(UUIDProperty.class))
// .put("object", newInstanceOf(ObjectProperty.class))
// .put("byte", bytePropertyFactory())
// .put("__file", filePropertyFactory())
// .build();
//
// private Properties() {
// throw new UnsupportedOperationException();
// }
//
// public static Property property(final String typeName) {
// String safeTypeName = nullToEmpty(typeName);
// Function<String, Function<String, ? extends Property>> propertyLookup
// = forMap(typeFactory, voidOrRef(safeTypeName));
// return propertyLookup.apply(safeTypeName.toLowerCase()).apply(safeTypeName);
// }
//
// public static Property property(final ModelReference modelRef) {
// if (modelRef.isMap()) {
// return new MapProperty(property(modelRef.itemModel().get()));
// } else if (modelRef.isCollection()) {
// if ("byte".equals(modelRef.itemModel().transform(toTypeName()).or(""))) {
// return new ByteArrayProperty();
// }
// return new ArrayProperty(
// maybeAddAllowableValues(itemTypeProperty(modelRef.itemModel().get()), modelRef.getAllowableValues()));
// }
// return property(modelRef.getType());
// }
//
// private static Function<? super ModelReference, String> toTypeName() {
// return new Function<ModelReference, String>() {
// @Override
// public String apply(ModelReference input) {
// return input.getType();
// }
// };
// }
//
// public static Property itemTypeProperty(ModelReference paramModel) {
// if (paramModel.isCollection()) {
// return new ArrayProperty(
// maybeAddAllowableValues(itemTypeProperty(paramModel.itemModel().get()), paramModel.getAllowableValues()));
// }
// return property(paramModel.getType());
// }
//
// private static <T extends Property> Function<String, T> newInstanceOf(final Class<T> clazz) {
// return new Function<String, T>() {
// @Override
// public T apply(String input) {
// try {
// return clazz.newInstance();
// } catch (Exception e) {
// //This is bad! should never come here
// throw new IllegalStateException(e);
// }
// }
// };
// }
//
// static Ordering<String> defaultOrdering(Map<String, ModelProperty> properties) {
// return Ordering.from(byPosition(properties)).compound(byName());
// }
//
// private static Function<String, ? extends Property> voidOrRef(final String typeName) {
// return new Function<String, Property>() {
// @Override
// public Property apply(String input) {
// if (typeName.equalsIgnoreCase("void")) {
// return null;
// }
// return new RefProperty(typeName);
// }
// };
// }
//
// private static Function<String, ? extends Property> bytePropertyFactory() {
// return new Function<String, Property>() {
// @Override
// public Property apply(String input) {
// final IntegerProperty integerProperty = new IntegerProperty();
// integerProperty.setFormat("int32");
// integerProperty.setMaximum(BigDecimal.valueOf(Byte.MAX_VALUE));
// integerProperty.setMinimum(BigDecimal.valueOf(Byte.MIN_VALUE));
// return integerProperty;
// }
// };
// }
//
// private static Function<String, ? extends Property> filePropertyFactory() {
// return new Function<String, Property>() {
// @Override
// public Property apply(String input) {
// return new FileProperty();
// }
// };
// }
//
// private static Comparator<String> byName() {
// return new Comparator<String>() {
// @Override
// public int compare(String first, String second) {
// return first.compareTo(second);
// }
// };
// }
//
// private static Comparator<String> byPosition(final Map<String, ModelProperty> modelProperties) {
// return new Comparator<String>() {
// @Override
// public int compare(String first, String second) {
// ModelProperty p1 = modelProperties.get(first);
// ModelProperty p2 = modelProperties.get(second);
// return Ints.compare(p1.getPosition(), p2.getPosition());
// }
// };
// }
//
// static Predicate<Map.Entry<String, ModelProperty>> voidProperties() {
// return new Predicate<Map.Entry<String, ModelProperty>>() {
// @Override
// public boolean apply(Map.Entry<String, ModelProperty> input) {
// return isVoid(input.getValue().getType())
// || collectionOfVoid(input.getValue().getType())
// || arrayTypeOfVoid(input.getValue().getType().getArrayElementType());
// }
// };
// }
//
// private static boolean arrayTypeOfVoid(ResolvedType arrayElementType) {
// return arrayElementType != null && isVoid(arrayElementType);
// }
//
// private static boolean collectionOfVoid(ResolvedType type) {
// return isContainerType(type) && isVoid(collectionElementType(type));
// }
}

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/DefineUserDto.java

@ -21,7 +21,7 @@ import org.apache.dolphinscheduler.dao.entity.DefinitionGroupByUser;
import java.util.List;
/**
*
* user process define dto
*/
public class DefineUserDto {

1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ScheduleParam.java

@ -20,7 +20,6 @@ import java.util.Date;
/**
* schedule parameters
* 调度参数
*/
public class ScheduleParam {
private Date startTime;

5
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/gantt/GanttDto.java

@ -23,31 +23,26 @@ import java.util.Map;
/**
* gantt DTO
* 甘特图 DTO
*/
public class GanttDto {
/**
* height
* 高度
*/
private int height;
/**
* tasks list
* 任务集合
*/
private List<Task> tasks = new ArrayList<>();
/**
* task name list
* 任务名称
*/
private List<String> taskNames;
/**
* task status map
* 任务状态
*/
private Map<String,String> taskStatus;

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/gantt/Task.java

@ -22,53 +22,44 @@ import java.util.List;
/**
* Task
* 任务
*/
public class Task {
/**
* task name
* 任务名称
*/
private String taskName;
/**
* task start date
* 任务开始时间
*/
private List<Long> startDate = new ArrayList<>();
/**
* task end date
* 任务结束时间
*/
private List<Long> endDate = new ArrayList<>();
/**
* task execution date
* 任务执行时间
*/
private Date executionDate;
/**
* task iso start
* 任务开始时间
*/
private Date isoStart;
/**
* task iso end
* 任务结束时间
*/
private Date isoEnd;
/**
* task status
* 执行状态
*/
private String status;
/**
* task duration
* 运行时长
*/
private String duration;

7
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/treeview/Instance.java

@ -26,31 +26,26 @@ public class Instance {
private int id;
/**
* node name
* 节点名称
*/
private String name;
/**
* node type
* 节点类型
*/
private String type;
/**
* node status
* 状态
*/
private String state;
/**
* node start time
* 开始时间
*/
private Date startTime;
/**
* node end time
* 结束时间
*/
private Date endTime;
@ -58,13 +53,11 @@ public class Instance {
/**
* node running on which host
* 运行机器
*/
private String host;
/**
* node duration
* 运行时长
*/
private String duration;

1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/treeview/TreeViewDto.java

@ -53,7 +53,6 @@ public class TreeViewDto {
/**
* instances list
* 实例列表
*/
private List<Instance> instances = new ArrayList<>();

10
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/ExecuteType.java

@ -23,8 +23,12 @@ public enum ExecuteType {
/**
* 操作类型
* 1.重跑 2.恢复暂停 3.恢复失败 4.停止 5.暂停
* operation type
* 1 repeat running
* 2 resume pause
* 3 resume failure
* 4 stop
* 5 pause
*/
NONE,REPEAT_RUNNING, RECOVER_SUSPENDED_PROCESS, START_FAILURE_TASK_PROCESS, STOP, PAUSE;
@ -35,6 +39,6 @@ public enum ExecuteType {
return e;
}
}
return null;//For values out of enum scope
return null;
}
}

3
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java

@ -27,9 +27,7 @@ public enum Status {
TASK_TIMEOUT_PARAMS_ERROR(10002, "task timeout parameter is not valid"),
USER_NAME_EXIST(10003, "user name already exists"),
USER_NAME_NULL(10004,"user name is null"),
// DB_OPERATION_ERROR(10005, "database operation error"),
HDFS_OPERATION_ERROR(10006, "hdfs operation error"),
UPDATE_FAILED(10007, "updateProcessInstance failed"),
TASK_INSTANCE_NOT_FOUND(10008, "task instance not found"),
TENANT_NAME_EXIST(10009, "tenant code already exists"),
USER_NOT_EXIST(10010, "user {0} not exists"),
@ -176,7 +174,6 @@ public enum Status {
UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found"),
UDF_FUNCTION_EXISTS(20002, "UDF function already exists"),
// RESOURCE_EMPTY(20003, "resource file is empty"),
RESOURCE_NOT_EXIST(20004, "resource not exist"),
RESOURCE_EXIST(20005, "resource already exists"),
RESOURCE_SUFFIX_NOT_SUPPORT_VIEW(20006, "resource suffix do not support online viewing"),

29
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/DruidStatFilter.java

@ -1,29 +0,0 @@
/*
* 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 org.apache.dolphinscheduler.api.interceptor;
import com.alibaba.druid.support.http.WebStatFilter;
/* this class annotation for druid stat monitor in development
@WebFilter(filterName="druidWebStatFilter",urlPatterns="/*",
initParams={
@WebInitParam(name="exclusions",value="*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*")
}) */
public class DruidStatFilter extends WebStatFilter {
}

34
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/DruidStatViewServlet.java

@ -1,34 +0,0 @@
/*
* 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 org.apache.dolphinscheduler.api.interceptor;
import com.alibaba.druid.support.http.StatViewServlet;
/* this class annotation for druid stat monitor in development
@WebServlet(urlPatterns = "/druid/*",
initParams={
// @WebInitParam(name="allow",value="127.0.0.1"),
// @WebInitParam(name="deny",value="192.168.16.111"),
@WebInitParam(name="loginUsername",value="admin"),
@WebInitParam(name="loginPassword",value="dolphinscheduler123"),
@WebInitParam(name="resetEnable",value="true")
}) */
public class DruidStatViewServlet extends StatViewServlet {
}

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/Result.java

@ -24,13 +24,11 @@ package org.apache.dolphinscheduler.api.utils;
public class Result<T> {
/**
* status
* 状态码
*/
private Integer code;
/**
* message
* 消息
*/
private String msg;

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZooKeeperState.java

@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
import java.util.Scanner;
/**
* zookeeper状态监控:4字口诀
* zookeeper state monitor
*
*/
public class ZooKeeperState {

Loading…
Cancel
Save