diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java index 8ae2dbc529..73ff74fd3d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java @@ -48,6 +48,7 @@ public class AppConfiguration implements WebMvcConfigurer { /** * Cookie + * @return local resolver */ @Bean(name = "localeResolver") public LocaleResolver localeResolver() { @@ -102,7 +103,7 @@ public class AppConfiguration implements WebMvcConfigurer { /** * Turn off suffix-based content negotiation * - * @param configurer + * @param configurer configurer */ @Override public void configureContentNegotiation(final ContentNegotiationConfigurer configurer) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/SwaggerConfig.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/SwaggerConfig.java index d4f52e4b06..6240e7d924 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/SwaggerConfig.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/SwaggerConfig.java @@ -31,7 +31,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * - * swager2 config class
+ * swager2 config class * */ @Configuration diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java index d26d0fddbf..c03281df7e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java @@ -54,8 +54,11 @@ public class AccessTokenController extends BaseController{ /** * create token - * @param loginUser - * @return + * @param loginUser login user + * @param userId token for user id + * @param expireTime expire time for the token + * @param token token + * @return create result state code */ @ApiIgnore @PostMapping(value = "/create") @@ -77,9 +80,11 @@ public class AccessTokenController extends BaseController{ } /** - * create token - * @param loginUser - * @return + * generate token string + * @param loginUser login user + * @param userId token for user + * @param expireTime expire time + * @return token string */ @ApiIgnore @PostMapping(value = "/generate") @@ -100,11 +105,11 @@ public class AccessTokenController extends BaseController{ /** * query access token list paging * - * @param loginUser - * @param pageNo - * @param searchVal - * @param pageSize - * @return + * @param loginUser login user + * @param pageNo page number + * @param searchVal search value + * @param pageSize page size + * @return token list of page number and page size */ @ApiOperation(value = "queryAccessTokenList", notes= "QUERY_ACCESS_TOKEN_LIST_NOTES") @ApiImplicitParams({ @@ -136,9 +141,9 @@ public class AccessTokenController extends BaseController{ /** * delete access token by id - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id token id + * @return delete result code */ @ApiIgnore @PostMapping(value = "/delete") @@ -158,8 +163,12 @@ public class AccessTokenController extends BaseController{ /** * update token - * @param loginUser - * @return + * @param loginUser login user + * @param id token id + * @param userId token for user + * @param expireTime token expire time + * @param token token string + * @return update result code */ @ApiIgnore @PostMapping(value = "/update") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java index 826a8637ea..e9bffa510b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java @@ -53,11 +53,11 @@ public class AlertGroupController extends BaseController{ /** * create alert group - * @param loginUser - * @param groupName - * @param groupType - * @param description - * @return + * @param loginUser login user + * @param groupName group name + * @param groupType group type + * @param description description + * @return create result code */ @ApiOperation(value = "createAlertgroup", notes= "CREATE_ALERT_GROUP_NOTES") @ApiImplicitParams({ @@ -84,8 +84,8 @@ public class AlertGroupController extends BaseController{ /** * alert group list - * @param loginUser - * @return + * @param loginUser login user + * @return alert group list */ @ApiOperation(value = "list", notes= "QUERY_ALERT_GROUP_LIST_NOTES") @GetMapping(value = "/list") @@ -105,13 +105,13 @@ public class AlertGroupController extends BaseController{ /** * paging query alarm group list * - * @param loginUser - * @param pageNo - * @param searchVal - * @param pageSize - * @return + * @param loginUser login user + * @param pageNo page number + * @param searchVal search value + * @param pageSize page size + * @return alert group list page */ - @ApiOperation(value = "queryTaskListPaging", notes= "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") + @ApiOperation(value = "queryAlertGroupListPaging", notes= "QUERY_ALERT_GROUP_LIST_PAGING_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", type ="String"), @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataType = "Int", example = "1"), @@ -142,12 +142,12 @@ public class AlertGroupController extends BaseController{ /** * updateProcessInstance alert group - * @param loginUser - * @param id - * @param groupName - * @param groupType - * @param description - * @return + * @param loginUser login user + * @param id alert group id + * @param groupName group name + * @param groupType group type + * @param description description + * @return update result code */ @ApiOperation(value = "updateAlertgroup", notes= "UPDATE_ALERT_GROUP_NOTES") @ApiImplicitParams({ @@ -177,9 +177,9 @@ public class AlertGroupController extends BaseController{ /** * delete alert group by id - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id alert group id + * @return delete result code */ @ApiOperation(value = "delAlertgroupById", notes= "DELETE_ALERT_GROUP_BY_ID_NOTES") @ApiImplicitParams({ @@ -203,9 +203,9 @@ public class AlertGroupController extends BaseController{ /** * check alert group exist - * @param loginUser - * @param groupName - * @return + * @param loginUser login user + * @param groupName group name + * @return check result code */ @ApiOperation(value = "verifyGroupName", notes= "VERIFY_ALERT_GROUP_NAME_NOTES") @ApiImplicitParams({ @@ -225,9 +225,10 @@ public class AlertGroupController extends BaseController{ /** * grant user * - * @param loginUser - * @param userIds - * @return + * @param loginUser login user + * @param userIds user ids in the group + * @param alertgroupId alert group id + * @return grant result code */ @ApiOperation(value = "grantUser", notes= "GRANT_ALERT_GROUP_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java index 295224d509..ba062472b3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/BaseController.java @@ -38,9 +38,9 @@ public class BaseController { /** * check params * - * @param pageNo - * @param pageSize - * @return + * @param pageNo page number + * @param pageSize page size + * @return check result code */ public Map checkPageParams(int pageNo, int pageSize) { Map result = new HashMap<>(2); @@ -61,7 +61,7 @@ public class BaseController { /** * get ip address in the http request * - * @param request + * @param request http servlet request * @return client ip address */ public static String getClientIpAddress(HttpServletRequest request) { @@ -87,8 +87,8 @@ public class BaseController { /** * return data list * - * @param result - * @return + * @param result result code + * @return result code */ public Result returnDataList(Map result) { Status status = (Status) result.get(Constants.STATUS); @@ -105,8 +105,8 @@ public class BaseController { /** * return data list with paging - * @param result - * @return + * @param result result code + * @return result code */ public Result returnDataListPaging(Map result) { Status status = (Status) result.get(Constants.STATUS); @@ -125,7 +125,7 @@ public class BaseController { /** * success * - * @return + * @return success result code */ public Result success() { Result result = new Result(); @@ -138,8 +138,8 @@ public class BaseController { /** * success does not need to return data * - * @param msg - * @return + * @param msg success message + * @return success result code */ public Result success(String msg) { Result result = new Result(); @@ -152,9 +152,9 @@ public class BaseController { /** * return data no paging * - * @param msg - * @param list - * @return + * @param msg success message + * @param list data list + * @return success result code */ public Result success(String msg, Object list) { Result result = getResult(msg, list); @@ -164,8 +164,8 @@ public class BaseController { /** * return data no paging * - * @param list - * @return + * @param list success + * @return success result code */ public Result success(Object list) { Result result = getResult(Status.SUCCESS.getMsg(), list); @@ -176,9 +176,9 @@ public class BaseController { * return the data use Map format, for example, passing the value of key, value, passing a value * eg. "/user/add" then return user name: zhangsan * - * @param msg - * @param object - * @return + * @param msg message + * @param object success object data + * @return success result code */ public Result success(String msg, Map object) { Result result = getResult(msg, object); @@ -188,10 +188,11 @@ public class BaseController { /** * return data with paging * - * @param totalList - * @param currentPage - * @param total - * @return + * @param totalList success object list + * @param currentPage current page + * @param total total + * @param totalPage total page + * @return success result code */ public Result success(Object totalList, Integer currentPage, Integer total, Integer totalPage) { @@ -211,9 +212,9 @@ public class BaseController { /** * error handle * - * @param code - * @param msg - * @return + * @param code result code + * @param msg result message + * @return error result code */ public Result error(Integer code, String msg) { Result result = new Result(); @@ -225,9 +226,9 @@ public class BaseController { /** * put message to map * - * @param result - * @param status - * @param statusParams + * @param result result + * @param status status + * @param statusParams object messages */ protected void putMsg(Map result, Status status, Object... statusParams) { result.put(Constants.STATUS, status); @@ -241,8 +242,9 @@ public class BaseController { /** * put message to result object * - * @param result - * @param status + * @param result result + * @param status status + * @param statusParams status parameters */ protected void putMsg(Result result, Status status, Object... statusParams) { result.setCode(status.getCode()); @@ -257,9 +259,9 @@ public class BaseController { /** * get result - * @param msg - * @param list - * @return + * @param msg message + * @param list object list + * @return result code */ private Result getResult(String msg, Object list) { Result result = new Result(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java index 82aab67979..92897ac7ff 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java @@ -49,13 +49,14 @@ public class DataAnalysisController extends BaseController{ @Autowired DataAnalysisService dataAnalysisService; - /** * statistical task instance status data * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param startDate count start date + * @param endDate count end date + * @param projectId project id + * @return task instance count data */ @ApiOperation(value = "countTaskState", notes= "COUNT_TASK_STATE_NOTES") @ApiImplicitParams({ @@ -83,9 +84,11 @@ public class DataAnalysisController extends BaseController{ /** * statistical process instance status data * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param startDate start date + * @param endDate end date + * @param projectId project id + * @return process instance data */ @ApiOperation(value = "countProcessInstanceState", notes= "COUNT_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @@ -113,9 +116,9 @@ public class DataAnalysisController extends BaseController{ /** * statistics the process definition quantities of certain person * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return definition count in project id */ @ApiOperation(value = "countDefinitionByUser", notes= "COUNT_PROCESS_DEFINITION_BY_USER_NOTES") @ApiImplicitParams({ @@ -140,9 +143,11 @@ public class DataAnalysisController extends BaseController{ /** * statistical command status data * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param startDate start date + * @param endDate end date + * @param projectId project id + * @return command state in project id */ @ApiOperation(value = "countCommandState", notes= "COUNT_COMMAND_STATE_NOTES") @ApiImplicitParams({ @@ -170,14 +175,12 @@ public class DataAnalysisController extends BaseController{ /** * queue count * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return queue state count */ @ApiOperation(value = "countQueueState", notes= "COUNT_QUEUE_STATE_NOTES") @ApiImplicitParams({ - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataType = "String"), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataType ="String"), @ApiImplicitParam(name = "projectId", value = "PROJECT_ID", dataType ="Int", example = "100") }) @GetMapping(value="/queue-count") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java index 564fbba104..d4844a693d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java @@ -53,18 +53,18 @@ public class DataSourceController extends BaseController { /** * create data source - * @param loginUser - * @param name - * @param note - * @param type - * @param host - * @param port - * @param database - * @param principal - * @param userName - * @param password - * @param other - * @return + * @param loginUser login user + * @param name data source name + * @param note data source description + * @param type data source type + * @param host host + * @param port port + * @param database data base + * @param principal principal + * @param userName user name + * @param password password + * @param other other arguments + * @return create result code */ @ApiOperation(value = "createDataSource", notes= "CREATE_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -108,12 +108,19 @@ public class DataSourceController extends BaseController { /** * updateProcessInstance data source * - * @param loginUser - * @param name - * @param note - * @param type - * @param other - * @return + * @param loginUser login user + * @param name data source name + * @param note description + * @param type data source type + * @param other other arguments + * @param id data source di + * @param host host + * @param port port + * @param database database + * @param principal principal + * @param userName user name + * @param password password + * @return update result code */ @ApiOperation(value = "updateDataSource", notes= "UPDATE_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -157,11 +164,11 @@ public class DataSourceController extends BaseController { } /** - * query data source + * query data source detail * - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id datasource id + * @return data source detail */ @ApiOperation(value = "queryDataSource", notes= "QUERY_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -188,8 +195,9 @@ public class DataSourceController extends BaseController { /** * query datasouce by type * - * @param loginUser - * @return + * @param loginUser login user + * @param type data source type + * @return data source list page */ @ApiOperation(value = "queryDataSourceList", notes= "QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES") @ApiImplicitParams({ @@ -211,11 +219,11 @@ public class DataSourceController extends BaseController { /** * query datasource with paging * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return data source list page */ @ApiOperation(value = "queryDataSourceListPaging", notes= "QUERY_DATA_SOURCE_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -244,14 +252,20 @@ public class DataSourceController extends BaseController { } /** - * connec datasource + * connect datasource * - * @param loginUser - * @param name - * @param note - * @param type - * @param other - * @return + * @param loginUser login user + * @param name data source name + * @param note data soruce description + * @param type data source type + * @param other other parameters + * @param host host + * @param port port + * @param database data base + * @param principal principal + * @param userName user name + * @param password password + * @return connect result code */ @ApiOperation(value = "connectDataSource", notes= "CONNECT_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -300,8 +314,9 @@ public class DataSourceController extends BaseController { /** * connection test * - * @param loginUser - * @return + * @param loginUser login user + * @param id data source id + * @return connect result code */ @ApiOperation(value = "connectionTest", notes= "CONNECT_DATA_SOURCE_TEST_NOTES") @ApiImplicitParams({ @@ -333,9 +348,9 @@ public class DataSourceController extends BaseController { /** * delete datasource by id * - * @param loginUser + * @param loginUser login user * @param id datasource id - * @return + * @return delete result */ @ApiOperation(value = "delete", notes= "DELETE_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -357,9 +372,9 @@ public class DataSourceController extends BaseController { /** * verify datasource name * - * @param loginUser - * @param name - * @return + * @param loginUser login user + * @param name data source name + * @return true if data source name not exists.otherwise return false */ @ApiOperation(value = "verifyDataSourceName", notes= "VERIFY_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -386,9 +401,9 @@ public class DataSourceController extends BaseController { /** * unauthorized datasource * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return unauthed data source result code */ @ApiOperation(value = "unauthDatasource", notes= "UNAUTHORIZED_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -413,9 +428,9 @@ public class DataSourceController extends BaseController { /** * authorized datasource * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return authorized result code */ @ApiOperation(value = "authedDatasource", notes= "AUTHORIZED_DATA_SOURCE_NOTES") @ApiImplicitParams({ @@ -439,8 +454,8 @@ public class DataSourceController extends BaseController { /** * get user info * - * @param loginUser - * @return + * @param loginUser login user + * @return user info data */ @ApiOperation(value = "getKerberosStartupState", notes= "GET_USER_INFO_NOTES") @GetMapping(value="/kerberos-startup-state") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java index 12b0be04cb..93b095ddf8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java @@ -50,6 +50,23 @@ public class ExecutorController extends BaseController { /** * execute process instance + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @param scheduleTime schedule time + * @param failureStrategy failure strategy + * @param startNodeList start nodes list + * @param taskDependType task depend type + * @param execType execute type + * @param warningType warning type + * @param warningGroupId warning group id + * @param receivers receivers + * @param receiversCc receivers cc + * @param runMode run mode + * @param processInstancePriority process instance priority + * @param workerGroupId worker group id + * @param timeout timeout + * @return start process result code */ @ApiOperation(value = "startProcessInstance", notes= "RUN_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @@ -112,10 +129,11 @@ public class ExecutorController extends BaseController { /** * do action to process instance:pause, stop, repeat, recover from pause, recover from stop * - * @param loginUser - * @param projectName - * @param processInstanceId - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @param executeType execute type + * @return execute result code */ @ApiOperation(value = "execute", notes= "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @@ -126,8 +144,8 @@ public class ExecutorController extends BaseController { @ResponseStatus(HttpStatus.OK) public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, - @RequestParam("processInstanceId") Integer processInstanceId, - @RequestParam("executeType") ExecuteType executeType + @RequestParam("processInstanceId") Integer processInstanceId, + @RequestParam("executeType") ExecuteType executeType ) { try { logger.info("execute command, login user: {}, project:{}, process instance id:{}, execute type:{}", @@ -143,9 +161,9 @@ public class ExecutorController extends BaseController { /** * check process definition and all of the son process definitions is on line. * - * @param loginUser - * @param processDefinitionId - * @return + * @param loginUser login user + * @param processDefinitionId process definition id + * @return check result code */ @ApiOperation(value = "startCheckProcessDefinition", notes= "START_CHECK_PROCESS_DEFINITION_NOTES") @ApiImplicitParams({ @@ -169,9 +187,10 @@ public class ExecutorController extends BaseController { /** * query recipients and copyers by process definition ID * - * @param loginUser - * @param processDefinitionId - * @return + * @param loginUser login user + * @param processDefinitionId process definition id + * @param processInstanceId process instance id + * @return receivers cc list */ @ApiIgnore @ApiOperation(value = "getReceiverCc", notes= "GET_RECEIVER_CC_NOTES") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java index 29d63624d0..802f09ff20 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java @@ -52,6 +52,11 @@ public class LoggerController extends BaseController { /** * query task log + * @param loginUser login user + * @param taskInstanceId task instance id + * @param skipNum skip number + * @param limit limit + * @return task log content */ @ApiOperation(value = "queryLog", notes= "QUERY_TASK_INSTANCE_LOG_NOTES") @ApiImplicitParams({ @@ -80,8 +85,9 @@ public class LoggerController extends BaseController { /** * download log file * - * @param loginUser - * @param taskInstanceId + * @param loginUser login user + * @param taskInstanceId task instance id + * @return log file content */ @ApiOperation(value = "downloadTaskLog", notes= "DOWNLOAD_TASK_INSTANCE_LOG_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java index c5beb2885b..63b2d8447d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java @@ -61,11 +61,11 @@ public class LoginController extends BaseController { /** * login * - * @param userName - * @param userPassword - * @param request - * @param response - * @return + * @param userName user name + * @param userPassword user password + * @param request request + * @param response response + * @return login result */ @ApiOperation(value = "login", notes= "LOGIN_NOTES") @ApiImplicitParams({ @@ -124,8 +124,9 @@ public class LoginController extends BaseController { /** * sign out * - * @param loginUser - * @return + * @param loginUser login user + * @param request request + * @return sign out result */ @ApiOperation(value = "signOut", notes = "SIGNOUT_NOTES") @PostMapping(value = "/signOut") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java index 6888d4fabb..74a5d91a6c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java @@ -48,8 +48,8 @@ public class MonitorController extends BaseController{ /** * master list - * @param loginUser - * @return + * @param loginUser login user + * @return master list */ @ApiOperation(value = "listMaster", notes= "MASTER_LIST_NOTES") @GetMapping(value = "/master/list") @@ -69,8 +69,8 @@ public class MonitorController extends BaseController{ /** * worker list - * @param loginUser - * @return + * @param loginUser login user + * @return worker information list */ @ApiOperation(value = "listWorker", notes= "WORKER_LIST_NOTES") @GetMapping(value = "/worker/list") @@ -89,8 +89,8 @@ public class MonitorController extends BaseController{ /** * query database state - * @param loginUser - * @return + * @param loginUser login user + * @return data base state */ @ApiOperation(value = "queryDatabaseState", notes= "QUERY_DATABASE_STATE_NOTES") @GetMapping(value = "/database") @@ -110,8 +110,8 @@ public class MonitorController extends BaseController{ /** * query zookeeper state - * @param loginUser - * @return + * @param loginUser login user + * @return zookeeper information list */ @ApiOperation(value = "queryZookeeperState", notes= "QUERY_ZOOKEEPER_STATE_NOTES") @GetMapping(value = "/zookeeper/list") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java index dcd8d8202d..715e012cb2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java @@ -50,12 +50,14 @@ public class ProcessDefinitionController extends BaseController{ /** * create process definition * - * @param loginUser - * @param projectName - * @param name + * @param loginUser login user + * @param projectName project name + * @param name process definition name * @param json process definition json - * @param description - * @return + * @param description description + * @param locations locations for nodes + * @param connects connects for nodes + * @return create result code */ @ApiOperation(value = "save", notes= "CREATE_PROCESS_DEFINITION_NOTES") @ApiImplicitParams({ @@ -91,10 +93,10 @@ public class ProcessDefinitionController extends BaseController{ /** * verify process definition name unique * - * @param loginUser - * @param projectName - * @param name - * @return + * @param loginUser login user + * @param projectName project name + * @param name name + * @return true if process definition name not exists, otherwise false */ @ApiOperation(value = "verify-name", notes = "VERIFY_PROCCESS_DEFINITION_NAME_NOTES") @ApiImplicitParams({ @@ -119,13 +121,15 @@ public class ProcessDefinitionController extends BaseController{ /** * update process definition * - * @param loginUser - * @param projectName - * @param name - * @param id - * @param processDefinitionJson - * @param description - * @return + * @param loginUser login user + * @param projectName project name + * @param name process definition name + * @param id process definition id + * @param processDefinitionJson process definition json + * @param description description + * @param locations locations for nodes + * @param connects connects for nodes + * @return update result code */ @ApiOperation(value = "updateProccessDefinition", notes= "UPDATE_PROCCESS_DEFINITION_NOTES") @ApiImplicitParams({ @@ -163,11 +167,11 @@ public class ProcessDefinitionController extends BaseController{ /** * release process definition * - * @param loginUser - * @param projectName - * @param processId - * @param releaseState - * @return + * @param loginUser login user + * @param projectName project name + * @param processId process definition id + * @param releaseState release state + * @return release result code */ @ApiOperation(value = "releaseProccessDefinition", notes= "RELEASE_PROCCESS_DEFINITION_NOTES") @ApiImplicitParams({ @@ -197,10 +201,10 @@ public class ProcessDefinitionController extends BaseController{ /** * query datail of process definition * - * @param loginUser - * @param projectName - * @param processId - * @return + * @param loginUser login user + * @param projectName project name + * @param processId process definition id + * @return process definition detail */ @ApiOperation(value = "queryProccessDefinitionById", notes= "QUERY_PROCCESS_DEFINITION_BY_ID_NOTES") @ApiImplicitParams({ @@ -227,9 +231,9 @@ public class ProcessDefinitionController extends BaseController{ /** * query proccess definition list * - * @param loginUser - * @param projectName - * @return + * @param loginUser login user + * @param projectName project name + * @return process definition list */ @ApiOperation(value = "queryProccessDefinitionList", notes= "QUERY_PROCCESS_DEFINITION_LIST_NOTES") @GetMapping(value="/list") @@ -250,11 +254,13 @@ public class ProcessDefinitionController extends BaseController{ /** * query proccess definition list paging - * @param loginUser - * @param projectName - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param projectName project name + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @param userId user id + * @return process definition page */ @ApiOperation(value = "queryProcessDefinitionListPaging", notes= "QUERY_PROCCESS_DEFINITION_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -290,10 +296,11 @@ public class ProcessDefinitionController extends BaseController{ /** * encapsulation treeview structure * - * @param loginUser - * @param projectName - * @param id - * @return + * @param loginUser login user + * @param projectName project name + * @param id process definition id + * @param limit limit + * @return tree view json data */ @ApiOperation(value = "viewTree", notes= "VIEW_TREE_NOTES") @ApiImplicitParams({ @@ -321,10 +328,10 @@ public class ProcessDefinitionController extends BaseController{ * get tasks list by process definition id * * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @return task list */ @ApiOperation(value = "getNodeListByDefinitionId", notes= "GET_NODE_LIST_BY_DEFINITION_ID_NOTES") @ApiImplicitParams({ @@ -352,10 +359,10 @@ public class ProcessDefinitionController extends BaseController{ * get tasks list by process definition id * * - * @param loginUser - * @param projectName - * @param processDefinitionIdList - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionIdList process definition id list + * @return node list data */ @ApiOperation(value = "getNodeListByDefinitionIdList", notes= "GET_NODE_LIST_BY_DEFINITION_ID_NOTES") @ApiImplicitParams({ @@ -382,10 +389,10 @@ public class ProcessDefinitionController extends BaseController{ /** * delete process definition by id * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @return delete result code */ @ApiOperation(value = "deleteProcessDefinitionById", notes= "DELETE_PROCESS_DEFINITION_BY_ID_NOTES") @ApiImplicitParams({ @@ -411,10 +418,10 @@ public class ProcessDefinitionController extends BaseController{ /** * batch delete process definition by ids * - * @param loginUser - * @param projectName - * @param processDefinitionIds - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionIds process definition id list + * @return delete result code */ @ApiOperation(value = "batchDeleteProcessDefinitionByIds", notes= "BATCH_DELETE_PROCESS_DEFINITION_BY_IDS_NOTES") @ApiImplicitParams({ @@ -440,10 +447,10 @@ public class ProcessDefinitionController extends BaseController{ /** * export process definition by id * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @param response response */ @ApiOperation(value = "exportProcessDefinitionById", notes= "EXPORT_PROCCESS_DEFINITION_BY_ID_NOTES") @ApiImplicitParams({ @@ -469,8 +476,9 @@ public class ProcessDefinitionController extends BaseController{ /** * query proccess definition all by project id * - * @param loginUser - * @return + * @param loginUser login user + * @param projectId project id + * @return process definition list */ @ApiOperation(value = "queryProccessDefinitionAllByProjectId", notes= "QUERY_PROCCESS_DEFINITION_All_BY_PROJECT_ID_NOTES") @GetMapping(value="/queryProccessDefinitionAllByProjectId") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java index 393c3704af..1c61475729 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java @@ -55,11 +55,17 @@ public class ProcessInstanceController extends BaseController{ /** * query process instance list paging * - * @param loginUser - * @param projectName - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param projectName project name + * @param pageNo page number + * @param pageSize page size + * @param processDefinitionId process definition id + * @param searchVal search value + * @param stateType state type + * @param host host + * @param startTime start time + * @param endTime end time + * @return process instance list */ @ApiOperation(value = "queryProcessInstanceList", notes= "QUERY_PROCESS_INSTANCE_LIST_NOTES") @ApiImplicitParams({ @@ -102,10 +108,10 @@ public class ProcessInstanceController extends BaseController{ /** * query task list by process instance id * - * @param loginUser - * @param projectName - * @param processInstanceId - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @return task list for the process instance */ @ApiOperation(value = "queryTaskListByProcessId", notes= "QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES") @ApiImplicitParams({ @@ -131,14 +137,16 @@ public class ProcessInstanceController extends BaseController{ /** * update process instance * - * @param loginUser - * @param projectName - * @param processInstanceJson - * @param processInstanceId - * @param scheduleTime - * @param syncDefine - * @param flag - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceJson process instance json + * @param processInstanceId process instance id + * @param scheduleTime schedule time + * @param syncDefine sync define + * @param flag flag + * @param locations locations + * @param connects connects + * @return update result code */ @ApiOperation(value = "updateProcessInstance", notes= "UPDATE_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @@ -179,10 +187,10 @@ public class ProcessInstanceController extends BaseController{ /** * query process instance by id * - * @param loginUser - * @param projectName - * @param processInstanceId - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @return process instance detail */ @ApiOperation(value = "queryProcessInstanceById", notes= "QUERY_PROCESS_INSTANCE_BY_ID_NOTES") @ApiImplicitParams({ @@ -209,10 +217,10 @@ public class ProcessInstanceController extends BaseController{ * delete process instance by id, at the same time, * delete task instance and their mapping relation data * - * @param loginUser - * @param projectName - * @param processInstanceId - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @return delete result code */ @ApiOperation(value = "deleteProcessInstanceById", notes= "DELETE_PROCESS_INSTANCE_BY_ID_NOTES") @ApiImplicitParams({ @@ -240,10 +248,10 @@ public class ProcessInstanceController extends BaseController{ /** * query sub process instance detail info by task id * - * @param loginUser - * @param projectName - * @param taskId - * @return + * @param loginUser login user + * @param projectName project name + * @param taskId task id + * @return sub process instance detail */ @ApiOperation(value = "querySubProcessInstanceByTaskId", notes= "QUERY_SUBPROCESS_INSTANCE_BY_TASK_ID_NOTES") @ApiImplicitParams({ @@ -266,10 +274,10 @@ public class ProcessInstanceController extends BaseController{ /** * query parent process instance detail info by sub process instance id * - * @param loginUser - * @param projectName - * @param subId - * @return + * @param loginUser login user + * @param projectName project name + * @param subId sub process id + * @return parent instance detail */ @ApiOperation(value = "queryParentInstanceBySubId", notes= "QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES") @ApiImplicitParams({ @@ -292,9 +300,9 @@ public class ProcessInstanceController extends BaseController{ /** * query process instance global variables and local variables * - * @param loginUser - * @param processInstanceId - * @return + * @param loginUser login user + * @param processInstanceId process instance id + * @return variables data */ @ApiOperation(value = "viewVariables", notes= "QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES") @ApiImplicitParams({ @@ -316,10 +324,10 @@ public class ProcessInstanceController extends BaseController{ /** * encapsulation gantt structure * - * @param loginUser - * @param projectName - * @param processInstanceId - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @return gantt tree data */ @ApiOperation(value = "vieGanttTree", notes= "VIEW_GANTT_NOTES") @ApiImplicitParams({ @@ -343,10 +351,10 @@ public class ProcessInstanceController extends BaseController{ * batch delete process instance by ids, at the same time, * delete task instance and their mapping relation data * - * @param loginUser - * @param projectName - * @param processInstanceIds - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceIds process instance id + * @return delete result code */ @GetMapping(value="/batch-delete") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java index edd5390b40..484d00bf2c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java @@ -59,9 +59,9 @@ public class ProjectController extends BaseController { /** * create project * - * @param loginUser - * @param projectName - * @param description + * @param loginUser login user + * @param projectName project name + * @param description description * @return returns an error if it exists */ @ApiOperation(value = "createProject", notes= "CREATE_PROJECT_NOTES") @@ -88,11 +88,11 @@ public class ProjectController extends BaseController { /** * updateProcessInstance project * - * @param loginUser - * @param projectId - * @param projectName - * @param description - * @return + * @param loginUser login user + * @param projectId project id + * @param projectName project name + * @param description description + * @return update result code */ @ApiOperation(value = "updateProject", notes= "UPDATE_PROJECT_NOTES") @ApiImplicitParams({ @@ -119,9 +119,9 @@ public class ProjectController extends BaseController { /** * query project details by id * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return project detail information */ @ApiOperation(value = "queryProjectById", notes= "QUERY_PROJECT_BY_ID_NOTES") @ApiImplicitParams({ @@ -145,11 +145,11 @@ public class ProjectController extends BaseController { /** * query project list paging * - * @param loginUser - * @param searchVal - * @param pageSize - * @param pageNo - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageSize page size + * @param pageNo page number + * @return project list which the login user have permission to see */ @ApiOperation(value = "queryProjectListPaging", notes= "QUERY_PROJECT_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -179,9 +179,9 @@ public class ProjectController extends BaseController { /** * delete project by id * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return delete result code */ @ApiOperation(value = "deleteProjectById", notes= "DELETE_PROJECT_BY_ID_NOTES") @ApiImplicitParams({ @@ -206,9 +206,9 @@ public class ProjectController extends BaseController { /** * query unauthorized project * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return the projects which user have not permission to see */ @ApiOperation(value = "queryUnauthorizedProject", notes= "QUERY_UNAUTHORIZED_PROJECT_NOTES") @ApiImplicitParams({ @@ -232,9 +232,9 @@ public class ProjectController extends BaseController { /** * query authorized project * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return projects which the user have permission to see, Except for items created by this user */ @ApiOperation(value = "queryAuthorizedProject", notes= "QUERY_AUTHORIZED_PROJECT_NOTES") @ApiImplicitParams({ @@ -257,9 +257,9 @@ public class ProjectController extends BaseController { /** * import process definition * - * @param loginUser - * @param file - * @return + * @param loginUser login user + * @param file resource file + * @return import result code */ @ApiOperation(value = "importProcessDefinition", notes= "EXPORT_PROCCESS_DEFINITION_NOTES") @ApiImplicitParams({ @@ -281,8 +281,8 @@ public class ProjectController extends BaseController { /** * query all project list - * @param loginUser - * @return + * @param loginUser login user + * @return all project list */ @ApiOperation(value = "queryAllProjectList", notes= "QUERY_ALL_PROJECT_LIST_NOTES") @GetMapping(value = "/queryAllProjectList") diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java index 14899bec37..056ca618f5 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java @@ -53,8 +53,8 @@ public class QueueController extends BaseController{ /** * query queue list - * @param loginUser - * @return + * @param loginUser login user + * @return queue list */ @ApiOperation(value = "queryList", notes= "QUERY_QUEUE_LIST_NOTES") @GetMapping(value="/list") @@ -72,8 +72,11 @@ public class QueueController extends BaseController{ /** * query queue list paging - * @param loginUser - * @return + * @param loginUser login user + * @param pageNo page number + * @param searchVal search value + * @param pageSize page size + * @return queue list */ @ApiOperation(value = "queryQueueListPaging", notes= "QUERY_QUEUE_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -106,10 +109,10 @@ public class QueueController extends BaseController{ /** * create queue * - * @param loginUser - * @param queue - * @param queueName - * @return + * @param loginUser login user + * @param queue queue + * @param queueName queue name + * @return create result */ @ApiOperation(value = "createQueue", notes= "CREATE_QUEUE_NOTES") @ApiImplicitParams({ @@ -136,10 +139,11 @@ public class QueueController extends BaseController{ /** * update queue * - * @param loginUser - * @param queue - * @param queueName - * @return + * @param loginUser login user + * @param queue queue + * @param id queue id + * @param queueName queue name + * @return update result code */ @ApiOperation(value = "updateQueue", notes= "UPDATE_QUEUE_NOTES") @ApiImplicitParams({ @@ -168,10 +172,10 @@ public class QueueController extends BaseController{ /** * verify queue and queue name * - * @param loginUser - * @param queue - * @param queueName - * @return + * @param loginUser login user + * @param queue queue + * @param queueName queue name + * @return true if the queue name not exists, otherwise return false */ @ApiOperation(value = "verifyQueue", notes= "VERIFY_QUEUE_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java index 6382897b7c..1a6ef3bb35 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java @@ -63,10 +63,12 @@ public class ResourcesController extends BaseController{ /** * create resource * - * @param loginUser - * @param alias - * @param description - * @param file + * @param loginUser login user + * @param alias alias + * @param description description + * @param type type + * @param file file + * @return create result code */ @ApiOperation(value = "createResource", notes= "CREATE_RESOURCE_NOTES") @ApiImplicitParams({ @@ -94,11 +96,14 @@ public class ResourcesController extends BaseController{ /** * update resource * - * @param loginUser - * @param alias - * @param description + * @param loginUser login user + * @param alias alias + * @param resourceId resource id + * @param type resource type + * @param description description + * @return update result code */ - @ApiOperation(value = "createResource", notes= "CREATE_RESOURCE_NOTES") + @ApiOperation(value = "updateResource", notes= "UPDATE_RESOURCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType ="Int", example = "100"), @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType ="ResourceType"), @@ -125,8 +130,9 @@ public class ResourcesController extends BaseController{ /** * query resources list * - * @param loginUser - * @return + * @param loginUser login user + * @param type resource type + * @return resource list */ @ApiOperation(value = "querytResourceList", notes= "QUERY_RESOURCE_LIST_NOTES") @ApiImplicitParams({ @@ -150,10 +156,12 @@ public class ResourcesController extends BaseController{ /** * query resources list paging * - * @param loginUser - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param type resource type + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return resource list page */ @ApiOperation(value = "querytResourceListPaging", notes= "QUERY_RESOURCE_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -191,8 +199,9 @@ public class ResourcesController extends BaseController{ /** * delete resource * - * @param loginUser - * @param resourceId + * @param loginUser login user + * @param resourceId resource id + * @return delete result code */ @ApiOperation(value = "deleteResource", notes= "DELETE_RESOURCE_BY_ID_NOTES") @ApiImplicitParams({ @@ -217,10 +226,10 @@ public class ResourcesController extends BaseController{ /** * verify resource by alias and type * - * @param loginUser - * @param alias - * @param type - * @return + * @param loginUser login user + * @param alias resource name + * @param type resource type + * @return true if the resource name not exists, otherwise return false */ @ApiOperation(value = "verifyResourceName", notes= "VERIFY_RESOURCE_NAME_NOTES") @ApiImplicitParams({ @@ -247,8 +256,11 @@ public class ResourcesController extends BaseController{ /** * view resource file online * - * @param loginUser - * @param resourceId + * @param loginUser login user + * @param resourceId resource id + * @param skipLineNum skip line number + * @param limit limit + * @return resource content */ @ApiOperation(value = "viewResource", notes= "VIEW_RESOURCE_BY_ID_NOTES") @ApiImplicitParams({ @@ -276,13 +288,13 @@ public class ResourcesController extends BaseController{ /** * create resource file online * - * @param loginUser - * @param type - * @param fileName - * @param fileSuffix - * @param description - * @param content - * @return + * @param loginUser login user + * @param type resource type + * @param fileName file name + * @param fileSuffix file suffix + * @param description description + * @param content content + * @return create result code */ @ApiOperation(value = "onlineCreateResource", notes= "ONLINE_CREATE_RESOURCE_NOTES") @ApiImplicitParams({ @@ -317,8 +329,10 @@ public class ResourcesController extends BaseController{ /** * edit resource file online * - * @param loginUser - * @param resourceId + * @param loginUser login user + * @param resourceId resource id + * @param content content + * @return update result code */ @ApiOperation(value = "updateResourceContent", notes= "UPDATE_RESOURCE_NOTES") @ApiImplicitParams({ @@ -347,8 +361,9 @@ public class ResourcesController extends BaseController{ /** * download resource file * - * @param loginUser - * @param resourceId + * @param loginUser login user + * @param resourceId resource id + * @return resource content */ @ApiOperation(value = "downloadResource", notes= "DOWNLOAD_RESOURCE_NOTES") @ApiImplicitParams({ @@ -378,14 +393,15 @@ public class ResourcesController extends BaseController{ /** * create udf function - * @param loginUser - * @param type - * @param funcName - * @param argTypes - * @param database - * @param description - * @param resourceId - * @return + * @param loginUser login user + * @param type udf type + * @param funcName function name + * @param argTypes argument types + * @param database database + * @param description description + * @param className class name + * @param resourceId resource id + * @return create result code */ @ApiOperation(value = "createUdfFunc", notes= "CREATE_UDF_FUNCTION_NOTES") @ApiImplicitParams({ @@ -423,9 +439,9 @@ public class ResourcesController extends BaseController{ /** * view udf function * - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id resource id + * @return udf function detail */ @ApiOperation(value = "viewUIUdfFunction", notes= "VIEW_UDF_FUNCTION_NOTES") @ApiImplicitParams({ @@ -437,7 +453,6 @@ public class ResourcesController extends BaseController{ public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") int id) { - Result result = new Result(); logger.info("login user {}, query udf{}", loginUser.getUserName(), id); try { @@ -450,16 +465,18 @@ public class ResourcesController extends BaseController{ } /** - * updateProcessInstance udf function + * update udf function * - * @param loginUser - * @param type - * @param funcName - * @param argTypes - * @param database - * @param description - * @param resourceId - * @return + * @param loginUser login user + * @param type resource type + * @param funcName function name + * @param argTypes argument types + * @param database data base + * @param description description + * @param resourceId resource id + * @param className class name + * @param udfFuncId udf function id + * @return update result code */ @ApiOperation(value = "updateUdfFunc", notes= "UPDATE_UDF_FUNCTION_NOTES") @ApiImplicitParams({ @@ -496,10 +513,11 @@ public class ResourcesController extends BaseController{ /** * query udf function list paging * - * @param loginUser - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return udf function list page */ @ApiOperation(value = "queryUdfFuncListPaging", notes= "QUERY_UDF_FUNCTION_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -533,8 +551,9 @@ public class ResourcesController extends BaseController{ /** * query resource list by type * - * @param loginUser - * @return + * @param loginUser login user + * @param type resource type + * @return resource list */ @ApiOperation(value = "queryResourceList", notes= "QUERY_RESOURCE_LIST_NOTES") @ApiImplicitParams({ @@ -557,9 +576,9 @@ public class ResourcesController extends BaseController{ /** * verify udf function name can use or not * - * @param loginUser - * @param name - * @return + * @param loginUser login user + * @param name name + * @return true if the name can user, otherwise return false */ @ApiOperation(value = "verifyUdfFuncName", notes= "VERIFY_UDF_FUNCTION_NAME_NOTES") @ApiImplicitParams({ @@ -586,8 +605,9 @@ public class ResourcesController extends BaseController{ /** * delete udf function * - * @param loginUser - * @param udfFuncId + * @param loginUser login user + * @param udfFuncId udf function id + * @return delete result code */ @ApiOperation(value = "deleteUdfFunc", notes= "DELETE_UDF_FUNCTION_NOTES") @ApiImplicitParams({ @@ -611,9 +631,9 @@ public class ResourcesController extends BaseController{ /** * authorized file resource list * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return authorized result */ @ApiOperation(value = "authorizedFile", notes= "AUTHORIZED_FILE_NOTES") @ApiImplicitParams({ @@ -637,9 +657,9 @@ public class ResourcesController extends BaseController{ /** * unauthorized file resource list * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return unauthorized result code */ @ApiOperation(value = "unauthorizedFile", notes= "UNAUTHORIZED_FILE_NOTES") @ApiImplicitParams({ @@ -663,9 +683,9 @@ public class ResourcesController extends BaseController{ /** * unauthorized udf function * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return unauthorized result code */ @ApiOperation(value = "unauthUDFFunc", notes= "UNAUTHORIZED_UDF_FUNC_NOTES") @ApiImplicitParams({ @@ -690,9 +710,9 @@ public class ResourcesController extends BaseController{ /** * authorized udf function * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return authorized result code */ @ApiOperation(value = "authUDFFunc", notes= "AUTHORIZED_UDF_FUNC_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java index 90ce0d0002..96038dcf8c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java @@ -60,14 +60,18 @@ public class SchedulerController extends BaseController { /** * create schedule * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @param schedule - * @param warningType - * @param warningGroupId - * @param failureStrategy - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @param schedule scheduler + * @param warningType warning type + * @param warningGroupId warning group id + * @param failureStrategy failure strategy + * @param processInstancePriority process instance priority + * @param receivers receivers + * @param receiversCc receivers cc + * @param workerGroupId worker group id + * @return create result code */ @ApiOperation(value = "createSchedule", notes= "CREATE_SCHEDULE_NOTES") @ApiImplicitParams({ @@ -112,14 +116,18 @@ public class SchedulerController extends BaseController { /** * updateProcessInstance schedule * - * @param loginUser - * @param projectName - * @param id - * @param schedule - * @param warningType - * @param warningGroupId - * @param failureStrategy - * @return + * @param loginUser login user + * @param projectName project name + * @param id scheduler id + * @param schedule scheduler + * @param warningType warning type + * @param warningGroupId warning group id + * @param failureStrategy failure strategy + * @param receivers receivers + * @param workerGroupId worker group id + * @param processInstancePriority process instance priority + * @param receiversCc receivers cc + * @return update result code */ @ApiOperation(value = "updateSchedule", notes= "UPDATE_SCHEDULE_NOTES") @ApiImplicitParams({ @@ -164,11 +172,10 @@ public class SchedulerController extends BaseController { /** * publish schedule setScheduleState * - * @param loginUser - * @param projectName - * @param id - * @return - * @throws Exception + * @param loginUser login user + * @param projectName project name + * @param id scheduler id + * @return publish result code */ @ApiOperation(value = "online", notes= "ONLINE_SCHEDULE_NOTES") @ApiImplicitParams({ @@ -193,10 +200,10 @@ public class SchedulerController extends BaseController { /** * offline schedule * - * @param loginUser - * @param projectName - * @param id - * @return + * @param loginUser login user + * @param projectName project name + * @param id schedule id + * @return operation result code */ @ApiOperation(value = "offline", notes= "OFFLINE_SCHEDULE_NOTES") @ApiImplicitParams({ @@ -222,10 +229,13 @@ public class SchedulerController extends BaseController { /** * query schedule list paging * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @param pageNo page number + * @param pageSize page size + * @param searchVal search value + * @return schedule list page */ @ApiOperation(value = "queryScheduleListPaging", notes= "QUERY_SCHEDULE_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -258,10 +268,10 @@ public class SchedulerController extends BaseController { /** * delete schedule by id * - * @param loginUser - * @param projectName - * @param scheduleId - * @return + * @param loginUser login user + * @param projectName project name + * @param scheduleId scheule id + * @return delete result code */ @ApiOperation(value = "deleteScheduleById", notes= "OFFLINE_SCHEDULE_NOTES") @ApiImplicitParams({ @@ -286,9 +296,9 @@ public class SchedulerController extends BaseController { /** * query schedule list * - * @param loginUser - * @param projectName - * @return + * @param loginUser login user + * @param projectName project name + * @return schedule list */ @ApiOperation(value = "queryScheduleList", notes= "QUERY_SCHEDULE_LIST_NOTES") @PostMapping("/list") @@ -308,10 +318,10 @@ public class SchedulerController extends BaseController { /** * preview schedule * - * @param loginUser - * @param projectName - * @param schedule - * @return + * @param loginUser login user + * @param projectName project name + * @param schedule schedule expression + * @return the next five fire time */ @ApiOperation(value = "previewSchedule", notes= "PREVIEW_SCHEDULE_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java index 731a89e936..5f63d744cf 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java @@ -51,8 +51,18 @@ public class TaskInstanceController extends BaseController{ /** * query task list paging * - * @param loginUser - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @param searchVal search value + * @param taskName task name + * @param stateType state type + * @param host host + * @param startTime start time + * @param endTime end time + * @param pageNo page number + * @param pageSize page size + * @return task list page */ @ApiOperation(value = "queryTaskListPaging", notes= "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskRecordController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskRecordController.java index 1711af8d0a..64121c26dd 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskRecordController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskRecordController.java @@ -47,10 +47,19 @@ public class TaskRecordController extends BaseController{ TaskRecordService taskRecordService; /** - * query task record list paging + * query task record list page * - * @param loginUser - * @return + * @param loginUser login user + * @param taskName task name + * @param state state + * @param sourceTable source table + * @param destTable destination table + * @param taskDate task date + * @param startTime start time + * @param endTime end time + * @param pageNo page numbere + * @param pageSize page size + * @return task record list */ @GetMapping("/list-paging") @ResponseStatus(HttpStatus.OK) @@ -81,8 +90,17 @@ public class TaskRecordController extends BaseController{ /** * query history task record list paging * - * @param loginUser - * @return + * @param loginUser login user + * @param taskName task name + * @param state state + * @param sourceTable source table + * @param destTable destination table + * @param taskDate task date + * @param startTime start time + * @param endTime end time + * @param pageNo page number + * @param pageSize page size + * @return history task record list */ @GetMapping("/history-list-paging") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java index bc9410e97d..6b0a4ec496 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java @@ -54,12 +54,12 @@ public class TenantController extends BaseController{ /** * create tenant * - * @param loginUser - * @param tenantCode - * @param tenantName - * @param queueId - * @param description - * @return + * @param loginUser login user + * @param tenantCode tenant code + * @param tenantName tenant name + * @param queueId queue id + * @param description description + * @return create result code */ @ApiOperation(value = "createTenant", notes= "CREATE_TENANT_NOTES") @ApiImplicitParams({ @@ -92,11 +92,11 @@ public class TenantController extends BaseController{ /** * query tenant list paging * - * @param loginUser - * @param pageNo - * @param searchVal - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return tenant list page */ @ApiOperation(value = "queryTenantlistPaging", notes= "QUERY_TENANT_LIST_PAGING_NOTES") @ApiImplicitParams({ @@ -130,8 +130,8 @@ public class TenantController extends BaseController{ /** * tenant list * - * @param loginUser - * @return + * @param loginUser login user + * @return tenant list */ @ApiOperation(value = "queryTenantlist", notes= "QUERY_TENANT_LIST_NOTES") @GetMapping(value="/list") @@ -152,12 +152,13 @@ public class TenantController extends BaseController{ /** * udpate tenant * - * @param loginUser - * @param tenantCode - * @param tenantName - * @param queueId - * @param description - * @return + * @param loginUser login user + * @param id tennat id + * @param tenantCode tennat code + * @param tenantName tennat name + * @param queueId queue id + * @param description description + * @return update result code */ @ApiOperation(value = "updateTenant", notes= "UPDATE_TENANT_NOTES") @ApiImplicitParams({ @@ -190,9 +191,9 @@ public class TenantController extends BaseController{ /** * delete tenant by id * - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id tenant id + * @return delete result code */ @ApiOperation(value = "deleteTenantById", notes= "DELETE_TENANT_NOTES") @ApiImplicitParams({ @@ -217,9 +218,9 @@ public class TenantController extends BaseController{ /** * verify tenant code * - * @param loginUser - * @param tenantCode - * @return + * @param loginUser login user + * @param tenantCode tenant code + * @return true if tenant code can user, otherwise return false */ @ApiOperation(value = "verifyTenantCode", notes= "VERIFY_TENANT_CODE_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java index ddbe956c0e..b89dd0fa2c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java @@ -53,13 +53,14 @@ public class UsersController extends BaseController{ /** * create user * - * @param loginUser - * @param userName - * @param userPassword - * @param email - * @param tenantId - * @param phone - * @return + * @param loginUser login user + * @param userName user name + * @param userPassword user password + * @param email email + * @param tenantId tenant id + * @param phone phone + * @param queue queue + * @return create result code */ @ApiOperation(value = "createUser", notes= "CREATE_USER_NOTES") @ApiImplicitParams({ @@ -94,11 +95,11 @@ public class UsersController extends BaseController{ /** * query user list paging * - * @param loginUser - * @param pageNo - * @param searchVal - * @param pageSize - * @return + * @param loginUser login user + * @param pageNo page number + * @param searchVal search avlue + * @param pageSize page size + * @return user list page */ @ApiOperation(value = "queryUserList", notes= "QUERY_USER_LIST_NOTES") @ApiImplicitParams({ @@ -132,14 +133,15 @@ public class UsersController extends BaseController{ /** * update user * - * @param loginUser - * @param id - * @param userName - * @param userPassword - * @param email - * @param tenantId - * @param phone - * @return + * @param loginUser login user + * @param id user id + * @param userName user name + * @param userPassword user password + * @param email email + * @param tenantId tennat id + * @param phone phone + * @param queue queue + * @return update result code */ @ApiOperation(value = "updateUser", notes= "UPDATE_USER_NOTES") @ApiImplicitParams({ @@ -174,9 +176,9 @@ public class UsersController extends BaseController{ /** * delete user by id - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id user id + * @return delete result code */ @ApiOperation(value = "delUserById", notes= "DELETE_USER_BY_ID_NOTES") @ApiImplicitParams({ @@ -199,9 +201,10 @@ public class UsersController extends BaseController{ /** * grant project * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @param projectIds project id array + * @return grant result code */ @ApiOperation(value = "grantProject", notes= "GRANT_PROJECT_NOTES") @ApiImplicitParams({ @@ -226,9 +229,10 @@ public class UsersController extends BaseController{ /** * grant resource * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @param resourceIds resource id array + * @return grant result code */ @ApiOperation(value = "grantResource", notes= "GRANT_RESOURCE_NOTES") @ApiImplicitParams({ @@ -254,9 +258,10 @@ public class UsersController extends BaseController{ /** * grant udf function * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @param udfIds udf id array + * @return grant result code */ @ApiOperation(value = "grantUDFFunc", notes= "GRANT_UDF_FUNC_NOTES") @ApiImplicitParams({ @@ -283,9 +288,10 @@ public class UsersController extends BaseController{ /** * grant datasource * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @param datasourceIds data source id array + * @return grant result code */ @ApiOperation(value = "grantDataSource", notes= "GRANT_DATASOURCE_NOTES") @ApiImplicitParams({ @@ -311,8 +317,8 @@ public class UsersController extends BaseController{ /** * get user info * - * @param loginUser - * @return + * @param loginUser login user + * @return user info */ @ApiOperation(value = "getUserInfo", notes= "GET_USER_INFO_NOTES") @GetMapping(value="/get-user-info") @@ -331,8 +337,8 @@ public class UsersController extends BaseController{ /** * user list no paging * - * @param loginUser - * @return + * @param loginUser login user + * @return user list */ @ApiOperation(value = "listUser", notes= "LIST_USER_NOTES") @GetMapping(value="/list") @@ -352,8 +358,8 @@ public class UsersController extends BaseController{ /** * user list no paging * - * @param loginUser - * @return + * @param loginUser login user + * @return user list */ @GetMapping(value="/list-all") @ResponseStatus(HttpStatus.OK) @@ -372,9 +378,9 @@ public class UsersController extends BaseController{ /** * verify username * - * @param loginUser - * @param userName - * @return + * @param loginUser login user + * @param userName user name + * @return true if user name not exists, otherwise return false */ @ApiOperation(value = "verifyUserName", notes= "VERIFY_USER_NAME_NOTES") @ApiImplicitParams({ @@ -400,9 +406,9 @@ public class UsersController extends BaseController{ /** * unauthorized user * - * @param loginUser - * @param alertgroupId - * @return + * @param loginUser login user + * @param alertgroupId alert group id + * @return unauthorize result code */ @ApiOperation(value = "unauthorizedUser", notes= "UNAUTHORIZED_USER_NOTES") @ApiImplicitParams({ @@ -427,9 +433,9 @@ public class UsersController extends BaseController{ /** * authorized user * - * @param loginUser - * @param alertgroupId - * @return + * @param loginUser login user + * @param alertgroupId alert group id + * @return authorized result code */ @ApiOperation(value = "authorizedUser", notes= "AUTHORIZED_USER_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java index bd04868993..8ec1335442 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java @@ -53,11 +53,12 @@ public class WorkerGroupController extends BaseController{ /** * create or update a worker group - * @param loginUser - * @param id - * @param name - * @param ipList - * @return + * + * @param loginUser login user + * @param id worker group id + * @param name worker group name + * @param ipList ip list + * @return create or update result code */ @ApiOperation(value = "saveWorkerGroup", notes= "CREATE_WORKER_GROUP_NOTES") @ApiImplicitParams({ @@ -86,11 +87,12 @@ public class WorkerGroupController extends BaseController{ /** * query worker groups paging - * @param loginUser - * @param pageNo - * @param searchVal - * @param pageSize - * @return + * + * @param loginUser login user + * @param pageNo page number + * @param searchVal search value + * @param pageSize page size + * @return worker group list page */ @ApiOperation(value = "queryAllWorkerGroupsPaging", notes= "QUERY_WORKER_GROUP_PAGING_NOTES") @ApiImplicitParams({ @@ -120,8 +122,9 @@ public class WorkerGroupController extends BaseController{ /** * query all worker groups - * @param loginUser - * @return + * + * @param loginUser login user + * @return all worker group list */ @ApiOperation(value = "queryAllWorkerGroups", notes= "QUERY_WORKER_GROUP_LIST_NOTES") @GetMapping(value = "/all-groups") @@ -142,9 +145,9 @@ public class WorkerGroupController extends BaseController{ /** * delete worker group by id - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id group id + * @return delete result code */ @ApiOperation(value = "deleteById", notes= "DELETE_WORKER_GROUP_BY_ID_NOTES") @ApiImplicitParams({ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/LoginHandlerInterceptor.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/LoginHandlerInterceptor.java index 83c9770026..7fc068bee0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/LoginHandlerInterceptor.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/LoginHandlerInterceptor.java @@ -60,7 +60,6 @@ public class LoginHandlerInterceptor implements HandlerInterceptor { * @return {@code true} if the execution chain should proceed with the * next interceptor or the handler itself. Else, DispatcherServlet assumes * that this interceptor has already dealt with the response itself. - * @throws Exception in case of errors */ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/log/LogClient.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/log/LogClient.java index 792bb8a0d4..3452060ec9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/log/LogClient.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/log/LogClient.java @@ -37,6 +37,9 @@ public class LogClient { /** * construct client connecting to HelloWorld server at {@code host:port} + * + * @param host host + * @param port port */ public LogClient(String host, int port) { this(ManagedChannelBuilder.forAddress(host, port) @@ -61,7 +64,7 @@ public class LogClient { /** * shutdown * - * @throws InterruptedException + * @throws InterruptedException InterruptedException */ public void shutdown() throws InterruptedException { channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); @@ -70,10 +73,10 @@ public class LogClient { /** * roll view log * - * @param path - * @param skipLineNum - * @param limit - * @return + * @param path path + * @param skipLineNum skip line number + * @param limit limit + * @return log content */ public String rollViewLog(String path,int skipLineNum,int limit) { logger.info("roll view log : path {},skipLineNum {} ,limit {}", path, skipLineNum, limit); @@ -96,8 +99,8 @@ public class LogClient { /** * view log * - * @param path - * @return + * @param path path + * @return log content */ public String viewLog(String path) { logger.info("view log path {}",path); @@ -115,8 +118,8 @@ public class LogClient { /** * get log size * - * @param path - * @return + * @param path log path + * @return log content bytes */ public byte[] getLogBytes(String path) { logger.info("log path {}",path); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java index e6413f8fc3..4664b59763 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java @@ -49,11 +49,11 @@ public class AccessTokenService extends BaseService { /** * query access token list * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return token list for page number and page size */ public Map queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(5); @@ -73,33 +73,12 @@ public class AccessTokenService extends BaseService { return result; } - /** - * check - * - * @param result - * @param bool - * @param userNoOperationPerm - * @param status - * @return - */ - private boolean check(Map result, boolean bool, Status userNoOperationPerm, String status) { - //only admin can operate - if (bool) { - result.put(Constants.STATUS, userNoOperationPerm); - result.put(status, userNoOperationPerm.getMsg()); - return true; - } - return false; - } - - /** * create token - * - * @param userId - * @param expireTime - * @param token - * @return + * @param userId token for user + * @param expireTime token expire time + * @param token token string + * @return create result code */ public Map createToken(int userId, String expireTime, String token) { Map result = new HashMap<>(5); @@ -125,9 +104,9 @@ public class AccessTokenService extends BaseService { /** * generate token - * @param userId - * @param expireTime - * @return + * @param userId token for user + * @param expireTime token expire time + * @return token string */ public Map generateToken(int userId, String expireTime) { Map result = new HashMap<>(5); @@ -139,9 +118,9 @@ public class AccessTokenService extends BaseService { /** * delete access token - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id token id + * @return delete result code */ public Map delAccessTokenById(User loginUser, int id) { Map result = new HashMap<>(5); @@ -167,11 +146,11 @@ public class AccessTokenService extends BaseService { /** * update token by id - * @param id - * @param userId - * @param expireTime - * @param token - * @return + * @param id token id + * @param userId token for user + * @param expireTime token expire time + * @param token token string + * @return update result code */ public Map updateToken(int id,int userId, String expireTime, String token) { Map result = new HashMap<>(5); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java index e89a5c6de5..40fc65b4dc 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java @@ -58,7 +58,7 @@ public class AlertGroupService extends BaseService{ /** * query alert group list * - * @return + * @return alert group list */ public HashMap queryAlertgroup() { @@ -73,11 +73,11 @@ public class AlertGroupService extends BaseService{ /** * paging query alarm group list * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return alert group list page */ public Map listPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { @@ -101,11 +101,11 @@ public class AlertGroupService extends BaseService{ /** * create alert group * - * @param loginUser - * @param groupName - * @param groupType - * @param desc - * @return + * @param loginUser login user + * @param groupName group name + * @param groupType group type + * @param desc description + * @return create result code */ public Map createAlertgroup(User loginUser, String groupName, AlertType groupType, String desc) { Map result = new HashMap<>(5); @@ -134,25 +134,15 @@ public class AlertGroupService extends BaseService{ return result; } - /** - * check user is admin or not - * - * @param user - * @return - */ - public boolean isAdmin(User user) { - return user.getUserType() == UserType.ADMIN_USER; - } - /** * updateProcessInstance alert group * - * @param loginUser - * @param id - * @param groupName - * @param groupType - * @param desc - * @return + * @param loginUser login user + * @param id alert group id + * @param groupName group name + * @param groupType group type + * @param desc description + * @return update result code */ public Map updateAlertgroup(User loginUser, int id, String groupName, AlertType groupType, String desc) { Map result = new HashMap<>(5); @@ -190,9 +180,9 @@ public class AlertGroupService extends BaseService{ /** * delete alert group by id * - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id alert group id + * @return delete result code */ @Transactional(rollbackFor = Exception.class) public Map delAlertgroupById(User loginUser, int id) { @@ -214,10 +204,10 @@ public class AlertGroupService extends BaseService{ /** * grant user * - * @param loginUser - * @param alertgroupId - * @param userIds - * @return + * @param loginUser login user + * @param alertgroupId alert group id + * @param userIds user id list + * @return grant result code */ public Map grantUser(User loginUser, int alertgroupId, String userIds) { Map result = new HashMap<>(5); @@ -253,9 +243,9 @@ public class AlertGroupService extends BaseService{ /** * verify group name exists * - * @param loginUser - * @param groupName - * @return + * @param loginUser login user + * @param groupName group name + * @return check result code */ public Result verifyGroupName(User loginUser, String groupName) { Result result = new Result(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseDAGService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseDAGService.java index 23b7c6a52a..af66591bed 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseDAGService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseDAGService.java @@ -37,11 +37,10 @@ public class BaseDAGService extends BaseService{ /** * process instance to DAG * - * @param processInstance - * @return - * @throws Exception + * @param processInstance input process instance + * @return process instance dag. */ - public static DAG processInstance2DAG(ProcessInstance processInstance) throws Exception { + public static DAG processInstance2DAG(ProcessInstance processInstance) { String processDefinitionJson = processInstance.getProcessInstanceJson(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseService.java index eb95f56b5a..1956738f9f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseService.java @@ -37,8 +37,8 @@ public class BaseService { /** * check admin * - * @param user - * @return + * @param user input user + * @return ture if administrator, otherwise return false */ protected boolean isAdmin(User user) { return user.getUserType() == UserType.ADMIN_USER; @@ -47,9 +47,9 @@ public class BaseService { /** * check admin * - * @param loginUser - * @param result - * @return + * @param loginUser login user + * @param result result code + * @return true if administrator, otherwise false */ protected boolean checkAdmin(User loginUser, Map result) { //only admin can operate @@ -63,9 +63,9 @@ public class BaseService { /** * put message to map * - * @param result - * @param status - * @param statusParams + * @param result result code + * @param status status + * @param statusParams status message */ protected void putMsg(Map result, Status status, Object... statusParams) { result.put(Constants.STATUS, status); @@ -79,8 +79,9 @@ public class BaseService { /** * put message to result object * - * @param result - * @param status + * @param result result code + * @param status status + * @param statusParams status message */ protected void putMsg(Result result, Status status, Object... statusParams) { result.setCode(status.getCode()); @@ -95,8 +96,8 @@ public class BaseService { /** * get cookie info by name - * @param request - * @param name + * @param request request + * @param name 'sessionId' * @return get cookie info */ public static Cookie getCookie(HttpServletRequest request, String name) { @@ -114,8 +115,8 @@ public class BaseService { /** * create tenant dir if not exists - * @param tenantCode - * @throws Exception + * @param tenantCode tenant code + * @throws Exception if hdfs operation exception */ protected void createTenantDirIfNotExists(String tenantCode)throws Exception{ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java index 00ba278705..9a7591ffc1 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataAnalysisService.java @@ -74,11 +74,11 @@ public class DataAnalysisService extends BaseService{ /** * statistical task instance status data * - * @param loginUser - * @param projectId - * @param startDate - * @param endDate - * @return + * @param loginUser login user + * @param projectId project id + * @param startDate start date + * @param endDate end date + * @return task state count data */ public Map countTaskStateByProject(User loginUser, int projectId, String startDate, String endDate) { @@ -126,11 +126,11 @@ public class DataAnalysisService extends BaseService{ /** * statistical process instance status data * - * @param loginUser - * @param projectId - * @param startDate - * @param endDate - * @return + * @param loginUser login user + * @param projectId project id + * @param startDate start date + * @param endDate end date + * @return process instance state count data */ public Map countProcessInstanceStateByProject(User loginUser, int projectId, String startDate, String endDate) { @@ -169,9 +169,9 @@ public class DataAnalysisService extends BaseService{ /** * statistics the process definition quantities of certain person * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return definition count data */ public Map countDefinitionByUser(User loginUser, int projectId) { Map result = new HashMap<>(); @@ -187,24 +187,15 @@ public class DataAnalysisService extends BaseService{ return result; } - /** - * - * @param result - * @param status - */ - private void putMsg(Map result, Status status) { - result.put(Constants.STATUS, status); - result.put(Constants.MSG, status.getMsg()); - } /** * statistical command status data * - * @param loginUser - * @param projectId - * @param startDate - * @param endDate - * @return + * @param loginUser login user + * @param projectId project id + * @param startDate start date + * @param endDate end date + * @return command state count data */ public Map countCommandState(User loginUser, int projectId, String startDate, String endDate) { @@ -315,9 +306,9 @@ public class DataAnalysisService extends BaseService{ /** * count queue state - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return queue state count data */ public Map countQueueState(User loginUser, int projectId) { Map result = new HashMap<>(5); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java index 3e80e9e62e..d3a76ab26b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java @@ -79,12 +79,12 @@ public class DataSourceService extends BaseService{ /** * create data source * - * @param loginUser - * @param name - * @param desc - * @param type - * @param parameter - * @return + * @param loginUser login user + * @param name data source name + * @param desc data source description + * @param type data source type + * @param parameter datasource parameters + * @return create result code */ public Map createDataSource(User loginUser, String name, String desc, DbType type, String parameter) { @@ -130,12 +130,13 @@ public class DataSourceService extends BaseService{ /** * updateProcessInstance datasource * - * @param loginUser - * @param name - * @param desc - * @param type - * @param parameter - * @return + * @param loginUser login user + * @param name data source name + * @param desc data source description + * @param type data source type + * @param parameter datasource parameters + * @param id data source id + * @return update result code */ public Map updateDataSource(int id, User loginUser, String name, String desc, DbType type, String parameter) { @@ -188,6 +189,8 @@ public class DataSourceService extends BaseService{ /** * updateProcessInstance datasource + * @param id datasource id + * @return data source detail */ public Map queryDataSource(int id) { @@ -264,11 +267,11 @@ public class DataSourceService extends BaseService{ /** * query datasource list by keyword * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return data source list page */ public Map queryDataSourceListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); @@ -292,31 +295,6 @@ public class DataSourceService extends BaseService{ return result; } - /** - * get list paging - * - * @param loginUser - * @param searchVal - * @param pageSize - * @param pageInfo - * @return - */ - private List getDataSources(User loginUser, String searchVal, Integer pageSize, PageInfo pageInfo) { - IPage dataSourceList = null; - Page dataSourcePage = new Page(pageInfo.getStart(), pageSize); - - if (isAdmin(loginUser)) { - dataSourceList = dataSourceMapper.selectPaging(dataSourcePage, 0, searchVal); - }else{ - dataSourceList = dataSourceMapper.selectPaging(dataSourcePage, loginUser.getId(), searchVal); - } - List dataSources = dataSourceList.getRecords(); - - handlePasswd(dataSources); - return dataSources; - } - - /** * handle datasource connection password for safety * @param dataSourceList @@ -336,9 +314,9 @@ public class DataSourceService extends BaseService{ /** * query data resource list * - * @param loginUser - * @param type - * @return + * @param loginUser login user + * @param type data source type + * @return data source list page */ public Map queryDataSourceList(User loginUser, Integer type) { Map result = new HashMap<>(5); @@ -360,9 +338,9 @@ public class DataSourceService extends BaseService{ /** * verify datasource exists * - * @param loginUser - * @param name - * @return + * @param loginUser login user + * @param name datasource name + * @return true if data datasource not exists, otherwise return false */ public Result verifyDataSourceName(User loginUser, String name) { Result result = new Result(); @@ -380,9 +358,9 @@ public class DataSourceService extends BaseService{ /** * get connection * - * @param dbType - * @param parameter - * @return + * @param dbType datasource type + * @param parameter parameter + * @return connection for datasource */ private Connection getConnection(DbType dbType, String parameter) { Connection connection = null; @@ -443,9 +421,9 @@ public class DataSourceService extends BaseService{ /** * check connection * - * @param type - * @param parameter - * @return + * @param type data source type + * @param parameter data source parameters + * @return true if connect successfully, otherwise false */ public boolean checkConnection(DbType type, String parameter) { Boolean isConnection = false; @@ -465,9 +443,9 @@ public class DataSourceService extends BaseService{ /** * test connection * - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id datasource id + * @return connect result code */ public boolean connectionTest(User loginUser, int id) { DataSource dataSource = dataSourceMapper.selectById(id); @@ -477,16 +455,17 @@ public class DataSourceService extends BaseService{ /** * build paramters * - * @param name - * @param desc - * @param type - * @param host - * @param port - * @param database - * @param userName - * @param password - * @param other - * @return + * @param name data source name + * @param desc data source description + * @param type data source type + * @param host data source host + * @param port data source port + * @param database data source database name + * @param userName user name + * @param password password + * @param other other parameters + * @param principal principal + * @return datasource parameter */ public String buildParameter(String name, String desc, DbType type, String host, String port, String database,String principal,String userName, @@ -578,9 +557,9 @@ public class DataSourceService extends BaseService{ /** * delete datasource * - * @param loginUser - * @param datasourceId - * @return + * @param loginUser login user + * @param datasourceId data source id + * @return delete result code */ @Transactional(rollbackFor = Exception.class) public Result delete(User loginUser, int datasourceId) { @@ -610,9 +589,9 @@ public class DataSourceService extends BaseService{ /** * unauthorized datasource * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return unauthed data source result code */ public Map unauthDatasource(User loginUser, Integer userId) { @@ -651,9 +630,9 @@ public class DataSourceService extends BaseService{ /** * authorized datasource * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return authorized result code */ public Map authedDatasource(User loginUser, Integer userId) { Map result = new HashMap<>(5); @@ -674,17 +653,17 @@ public class DataSourceService extends BaseService{ * get host and port by address * * @param address - * @return + * @return sting array: [host,port] */ private String[] getHostsAndPort(String address) { String[] result = new String[2]; - String[] tmpArray = address.split(org.apache.dolphinscheduler.common.Constants.DOUBLE_SLASH); + String[] tmpArray = address.split(Constants.DOUBLE_SLASH); String hostsAndPorts = tmpArray[tmpArray.length - 1]; StringBuilder hosts = new StringBuilder(); - String[] hostPortArray = hostsAndPorts.split(org.apache.dolphinscheduler.common.Constants.COMMA); - String port = hostPortArray[0].split(org.apache.dolphinscheduler.common.Constants.COLON)[1]; + String[] hostPortArray = hostsAndPorts.split(Constants.COMMA); + String port = hostPortArray[0].split(Constants.COLON)[1]; for (String hostPort : hostPortArray) { - hosts.append(hostPort.split(org.apache.dolphinscheduler.common.Constants.COLON)[0]).append(org.apache.dolphinscheduler.common.Constants.COMMA); + hosts.append(hostPort.split(Constants.COLON)[0]).append(Constants.COMMA); } hosts.deleteCharAt(hosts.length() - 1); result[0] = hosts.toString(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java index 6c1ddcb319..a8a392126a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java @@ -82,8 +82,12 @@ public class ExecutorService extends BaseService{ * @param warningGroupId notify group id * @param receivers receivers * @param receiversCc receivers cc + * @param processInstancePriority process instance priority + * @param workerGroupId worker group id + * @param runMode run mode * @param timeout timeout - * @return + * @return execute process instance code + * @throws ParseException Parse Exception */ public Map execProcessInstance(User loginUser, String projectName, int processDefinitionId, String cronTime, CommandType commandType, @@ -142,9 +146,9 @@ public class ExecutorService extends BaseService{ /** * check whether the process definition can be executed * - * @param processDefinition - * @param processDefineId - * @return + * @param processDefinition process definition + * @param processDefineId process definition id + * @return check result code */ public Map checkProcessDefinitionValid(ProcessDefinition processDefinition, int processDefineId){ Map result = new HashMap<>(5); @@ -165,11 +169,11 @@ public class ExecutorService extends BaseService{ /** * do action to process instance:pause, stop, repeat, recover from pause, recover from stop * - * @param loginUser - * @param projectName - * @param processInstanceId - * @param executeType - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @param executeType execute type + * @return execute result code */ public Map execute(User loginUser, String projectName, Integer processInstanceId, ExecuteType executeType) { Map result = new HashMap<>(5); @@ -246,8 +250,8 @@ public class ExecutorService extends BaseService{ /** * check tenant suitable - * @param processDefinition - * @return + * @param processDefinition process definition + * @return true if tenant suitable, otherwise return false */ private boolean checkTenantSuitable(ProcessDefinition processDefinition) { // checkTenantExists(); @@ -262,9 +266,9 @@ public class ExecutorService extends BaseService{ /** * Check the state of process instance and the type of operation match * - * @param processInstance - * @param executeType - * @return + * @param processInstance process instance + * @param executeType execute type + * @return check result code */ private Map checkExecuteType(ProcessInstance processInstance, ExecuteType executeType) { @@ -306,9 +310,9 @@ public class ExecutorService extends BaseService{ /** * update process instance state * - * @param processInstanceId - * @param executionStatus - * @return + * @param processInstanceId process instance id + * @param executionStatus execute status + * @return update result */ private Map updateProcessInstanceState(Integer processInstanceId, ExecutionStatus executionStatus) { Map result = new HashMap<>(5); @@ -326,11 +330,11 @@ public class ExecutorService extends BaseService{ /** * insert command, used in the implementation of the page, re run, recovery (pause / failure) execution * - * @param loginUser - * @param instanceId - * @param processDefinitionId - * @param commandType - * @return + * @param loginUser login user + * @param instanceId instance id + * @param processDefinitionId process definition id + * @param commandType command type + * @return insert result code */ private Map insertCommand(User loginUser, Integer instanceId, Integer processDefinitionId, CommandType commandType) { Map result = new HashMap<>(5); @@ -358,9 +362,9 @@ public class ExecutorService extends BaseService{ } /** - * check if subprocesses are offline before starting process definition - * @param processDefineId - * @return + * check if sub processes are offline before starting process definition + * @param processDefineId process definition id + * @return check result code */ public Map startCheckByProcessDefinedId(int processDefineId) { Map result = new HashMap(); @@ -396,8 +400,9 @@ public class ExecutorService extends BaseService{ /** * query recipients and copyers by process definition id or processInstanceId * - * @param processDefineId - * @return + * @param processDefineId process definition id + * @param processInstanceId process instance id + * @return receivers cc list */ public Map getReceiverCc(Integer processDefineId,Integer processInstanceId) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/LoggerService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/LoggerService.java index 192b4382a5..20a4445235 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/LoggerService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/LoggerService.java @@ -42,10 +42,10 @@ public class LoggerService { /** * view log * - * @param taskInstId - * @param skipLineNum - * @param limit - * @return + * @param taskInstId task instance id + * @param skipLineNum skip line number + * @param limit limit + * @return log string data */ public Result queryLog(int taskInstId, int skipLineNum, int limit) { @@ -76,8 +76,8 @@ public class LoggerService { /** * get log size * - * @param taskInstId - * @return + * @param taskInstId task instance id + * @return log byte array */ public byte[] getLogBytes(int taskInstId) { TaskInstance taskInstance = processDao.findTaskInstanceById(taskInstId); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java index 18031acd28..a98806f04b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/MonitorService.java @@ -41,7 +41,8 @@ public class MonitorService extends BaseService{ /** * query database state * - * @return + * @param loginUser login user + * @return data base state */ public Map queryDatabaseState(User loginUser) { Map result = new HashMap<>(5); @@ -58,8 +59,8 @@ public class MonitorService extends BaseService{ /** * query master list * - * @param loginUser - * @return + * @param loginUser login user + * @return master information list */ public Map queryMaster(User loginUser) { @@ -75,7 +76,8 @@ public class MonitorService extends BaseService{ /** * query zookeeper state * - * @return + * @param loginUser login user + * @return zookeeper information list */ public Map queryZookeeperState(User loginUser) { Map result = new HashMap<>(5); @@ -91,10 +93,10 @@ public class MonitorService extends BaseService{ /** - * query master list + * query worker list * - * @param loginUser - * @return + * @param loginUser login user + * @return worker information list */ public Map queryWorker(User loginUser) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java index b112badde4..aea35ced38 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java @@ -102,14 +102,15 @@ public class ProcessDefinitionService extends BaseDAGService { /** * create process definition * - * @param loginUser - * @param projectName - * @param name - * @param processDefinitionJson - * @param desc - * @param locations - * @param connects - * @return + * @param loginUser login user + * @param projectName project name + * @param name process definition name + * @param processDefinitionJson process definition json + * @param desc description + * @param locations locations for nodes + * @param connects connects for nodes + * @return create result code + * @throws JsonProcessingException JsonProcessingException */ public Map createProcessDefinition(User loginUser, String projectName, String name, String processDefinitionJson, String desc, String locations, String connects) throws JsonProcessingException { @@ -163,9 +164,9 @@ public class ProcessDefinitionService extends BaseDAGService { /** * query proccess definition list * - * @param loginUser - * @param projectName - * @return + * @param loginUser login user + * @param projectName project name + * @return definition list */ public Map queryProccessDefinitionList(User loginUser, String projectName) { @@ -189,13 +190,13 @@ public class ProcessDefinitionService extends BaseDAGService { /** * query proccess definition list paging * - * @param loginUser - * @param projectName - * @param searchVal - * @param pageNo - * @param pageSize - * @param userId - * @return + * @param loginUser login user + * @param projectName project name + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @param userId user id + * @return process definition page */ public Map queryProcessDefinitionListPaging(User loginUser, String projectName, String searchVal, Integer pageNo, Integer pageSize, Integer userId) { @@ -224,10 +225,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * query datail of process definition * - * @param loginUser - * @param projectName - * @param processId - * @return + * @param loginUser login user + * @param projectName project name + * @param processId process definition id + * @return process definition detail */ public Map queryProccessDefinitionById(User loginUser, String projectName, Integer processId) { @@ -254,15 +255,15 @@ public class ProcessDefinitionService extends BaseDAGService { /** * update process definition * - * @param loginUser - * @param projectName - * @param id - * @param name - * @param processDefinitionJson - * @param desc - * @param locations - * @param connects - * @return + * @param loginUser login user + * @param projectName project name + * @param name process definition name + * @param id process definition id + * @param processDefinitionJson process definition json + * @param desc description + * @param locations locations for nodes + * @param connects connects for nodes + * @return update result code */ public Map updateProcessDefinition(User loginUser, String projectName, int id, String name, String processDefinitionJson, String desc, @@ -329,10 +330,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * verify process definition name unique * - * @param loginUser - * @param projectName - * @param name - * @return + * @param loginUser login user + * @param projectName project name + * @param name name + * @return true if process definition name not exists, otherwise false */ public Map verifyProccessDefinitionName(User loginUser, String projectName, String name) { @@ -356,10 +357,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * delete process definition by id * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @return delete result code */ @Transactional(rollbackFor = Exception.class) public Map deleteProcessDefinitionById(User loginUser, String projectName, Integer processDefinitionId) { @@ -421,10 +422,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * batch delete process definition by ids * - * @param loginUser - * @param projectName - * @param processDefinitionIds - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionIds process definition id + * @return delete result code */ public Map batchDeleteProcessDefinitionByIds(User loginUser, String projectName, String processDefinitionIds) { @@ -470,11 +471,11 @@ public class ProcessDefinitionService extends BaseDAGService { /** * release process definition: online / offline * - * @param loginUser - * @param projectName - * @param id - * @param releaseState - * @return + * @param loginUser login user + * @param projectName project name + * @param id process definition id + * @param releaseState release state + * @return release result code */ @Transactional(rollbackFor = Exception.class) public Map releaseProcessDefinition(User loginUser, String projectName, int id, int releaseState) { @@ -525,10 +526,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * export process definition by id * - * @param loginUser - * @param projectName - * @param processDefinitionId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefinitionId process definition id + * @param response response */ public void exportProcessDefinitionById(User loginUser, String projectName, Integer processDefinitionId, HttpServletResponse response) { Project project = projectMapper.queryByName(projectName); @@ -812,9 +813,9 @@ public class ProcessDefinitionService extends BaseDAGService { /** * check the process definition node meets the specifications * - * @param processData - * @param processDefinitionJson - * @return + * @param processData process data + * @param processDefinitionJson process definition json + * @return check result code */ public Map checkProcessNodeList(ProcessData processData, String processDefinitionJson) { @@ -863,6 +864,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * get task node details based on process definition + * + * @param defineId define id + * @return task node list + * @throws Exception exception */ public Map getTaskNodeListByDefinitionId(Integer defineId) throws Exception { Map result = new HashMap<>(); @@ -890,6 +895,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * get task node details based on process definition + * + * @param defineIdList define id list + * @return task node list + * @throws Exception exception */ public Map getTaskNodeListByDefinitionIdList(String defineIdList) throws Exception { Map result = new HashMap<>(); @@ -927,8 +936,8 @@ public class ProcessDefinitionService extends BaseDAGService { /** * query proccess definition all by project id * - * @param projectId - * @return + * @param projectId project id + * @return process definitions in the project */ public Map queryProccessDefinitionAllByProjectId(Integer projectId) { @@ -944,9 +953,10 @@ public class ProcessDefinitionService extends BaseDAGService { /** * Encapsulates the TreeView structure * - * @param processId - * @param limit - * @return + * @param processId process definition id + * @param limit limit + * @return tree view json data + * @throws Exception exception */ public Map viewTree(Integer processId, Integer limit) throws Exception { Map result = new HashMap<>(); @@ -1075,9 +1085,9 @@ public class ProcessDefinitionService extends BaseDAGService { /** * Generate the DAG Graph based on the process definition id * - * @param processDefinition - * @return - * @throws Exception + * @param processDefinition process definition + * @return dag graph + * @throws Exception if exception happens */ private DAG genDagGraph(ProcessDefinition processDefinition) throws Exception { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java index 91e6dd3abb..8ea0ffed70 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java @@ -100,10 +100,10 @@ public class ProcessInstanceService extends BaseDAGService { /** * query process instance by id * - * @param loginUser - * @param projectName - * @param processId - * @return + * @param loginUser login user + * @param projectName project name + * @param processId process instance id + * @return process instance detail */ public Map queryProcessInstanceById(User loginUser, String projectName, Integer processId) { Map result = new HashMap<>(5); @@ -136,20 +136,20 @@ public class ProcessInstanceService extends BaseDAGService { return result; } - /** * paging query process instance list, filtering according to project, process definition, time range, keyword, process status * - * @param loginUser - * @param projectName - * @param processDefineId - * @param startDate - * @param endDate - * @param searchVal - * @param stateType - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param projectName project name + * @param pageNo page number + * @param pageSize page size + * @param processDefineId process definition id + * @param searchVal search value + * @param stateType state type + * @param host host + * @param startDate start time + * @param endDate end time + * @return process instance list */ public Map queryProcessInstanceList(User loginUser, String projectName, Integer processDefineId, String startDate, String endDate, @@ -216,10 +216,11 @@ public class ProcessInstanceService extends BaseDAGService { /** * query task list by process instance id * - * @param loginUser - * @param projectName - * @param processId - * @return + * @param loginUser login user + * @param projectName project name + * @param processId process instance id + * @return task list for the process instance + * @throws IOException io exception */ public Map queryTaskListByProcessId(User loginUser, String projectName, Integer processId) throws IOException { Map result = new HashMap<>(); @@ -291,10 +292,10 @@ public class ProcessInstanceService extends BaseDAGService { /** * query sub process instance detail info by task id * - * @param loginUser - * @param projectName - * @param taskId - * @return + * @param loginUser login user + * @param projectName project name + * @param taskId task id + * @return sub process instance detail */ public Map querySubProcessInstanceByTaskId(User loginUser, String projectName, Integer taskId) { Map result = new HashMap<>(); @@ -332,16 +333,17 @@ public class ProcessInstanceService extends BaseDAGService { /** * update process instance * - * @param loginUser - * @param projectName - * @param processInstanceId - * @param processInstanceJson - * @param scheduleTime - * @param syncDefine - * @param flag - * @param locations - * @param connects - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceJson process instance json + * @param processInstanceId process instance id + * @param scheduleTime schedule time + * @param syncDefine sync define + * @param flag flag + * @param locations locations + * @param connects connects + * @return update result code + * @throws ParseException parse exception for json parse */ public Map updateProcessInstance(User loginUser, String projectName, Integer processInstanceId, String processInstanceJson, String scheduleTime, Boolean syncDefine, @@ -431,10 +433,10 @@ public class ProcessInstanceService extends BaseDAGService { /** * query parent process instance detail info by sub process instance id * - * @param loginUser - * @param projectName - * @param subId - * @return + * @param loginUser login user + * @param projectName project name + * @param subId sub process id + * @return parent instance detail */ public Map queryParentInstanceBySubId(User loginUser, String projectName, Integer subId) { Map result = new HashMap<>(); @@ -470,11 +472,11 @@ public class ProcessInstanceService extends BaseDAGService { /** * delete process instance by id, at the same time,delete task instance and their mapping relation data - * @param loginUser - * @param projectName - * @param processInstanceId - * @param tasksQueue - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @param tasksQueue task queue + * @return delete result code */ @Transactional(rollbackFor = Exception.class) public Map deleteProcessInstanceById(User loginUser, String projectName, Integer processInstanceId,ITaskQueue tasksQueue) { @@ -560,10 +562,10 @@ public class ProcessInstanceService extends BaseDAGService { /** * batch delete process instance by ids, at the same time,delete task instance and their mapping relation data * - * @param loginUser - * @param projectName - * @param processInstanceIds - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceIds process instance id + * @return delete result code */ public Map batchDeleteProcessInstanceByIds(User loginUser, String projectName, String processInstanceIds) { // task queue @@ -604,8 +606,9 @@ public class ProcessInstanceService extends BaseDAGService { /** * view process instance variables * - * @param processInstanceId - * @return + * @param processInstanceId process instance id + * @return variables data + * @throws Exception exception */ public Map viewVariables( Integer processInstanceId) throws Exception { Map result = new HashMap<>(5); @@ -677,9 +680,9 @@ public class ProcessInstanceService extends BaseDAGService { /** * encapsulation gantt structure * - * @param processInstanceId - * @return - * @throws Exception + * @param processInstanceId process instance id + * @return gantt tree data + * @throws Exception exception when json parse */ public Map viewGantt(Integer processInstanceId) throws Exception { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java index 1196bf55ce..f33a365912 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java @@ -59,10 +59,10 @@ public class ProjectService extends BaseService{ /** * create project * - * @param loginUser - * @param name - * @param desc - * @return + * @param loginUser login user + * @param name project name + * @param desc description + * @return returns an error if it exists */ public Map createProject(User loginUser, String name, String desc) { @@ -98,8 +98,8 @@ public class ProjectService extends BaseService{ /** * query project details by id * - * @param projectId - * @return + * @param projectId project id + * @return project detail information */ public Map queryById(Integer projectId) { @@ -117,10 +117,11 @@ public class ProjectService extends BaseService{ /** * check project and authorization - * @param loginUser - * @param project - * @param projectName - * @return + * + * @param loginUser login user + * @param project project + * @param projectName project name + * @return true if the login user havve permission to see the project */ public Map checkProjectAndAuth(User loginUser, Project project, String projectName) { @@ -153,11 +154,12 @@ public class ProjectService extends BaseService{ /** * admin can view all projects - * @param loginUser - * @param pageSize - * @param pageNo - * @param searchVal - * @return + * + * @param loginUser login user + * @param searchVal search value + * @param pageSize page size + * @param pageNo page number + * @return project list which the login user have permission to see */ public Map queryProjectListPaging(User loginUser, Integer pageSize, Integer pageNo, String searchVal) { Map result = new HashMap<>(); @@ -186,9 +188,9 @@ public class ProjectService extends BaseService{ /** * delete project by id * - * @param loginUser - * @param projectId - * @return + * @param loginUser login user + * @param projectId project id + * @return delete result code */ public Map deleteProject(User loginUser, Integer projectId) { Map result = new HashMap<>(5); @@ -220,9 +222,9 @@ public class ProjectService extends BaseService{ /** * get check result * - * @param loginUser - * @param project - * @return + * @param loginUser login user + * @param project project + * @return check result */ private Map getCheckResult(User loginUser, Project project) { Map checkResult = checkProjectAndAuth(loginUser, project, project.getName()); @@ -236,11 +238,11 @@ public class ProjectService extends BaseService{ /** * updateProcessInstance project * - * @param loginUser - * @param projectId - * @param projectName - * @param desc - * @return + * @param loginUser login user + * @param projectId project id + * @param projectName project name + * @param desc description + * @return update result code */ public Map update(User loginUser, Integer projectId, String projectName, String desc) { Map result = new HashMap<>(5); @@ -272,9 +274,9 @@ public class ProjectService extends BaseService{ /** * query unauthorized project * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return the projects which user have not permission to see */ public Map queryUnauthorizedProject(User loginUser, Integer userId) { Map result = new HashMap<>(5); @@ -302,9 +304,9 @@ public class ProjectService extends BaseService{ /** * get unauthorized project * - * @param projectSet - * @param authedProjectList - * @return + * @param projectSet project set + * @param authedProjectList authed project list + * @return project list that authorization */ private List getUnauthorizedProjects(Set projectSet, List authedProjectList) { List resultList; @@ -322,9 +324,9 @@ public class ProjectService extends BaseService{ /** * query authorized project * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return projects which the user have permission to see, Except for items created by this user */ public Map queryAuthorizedProject(User loginUser, Integer userId) { Map result = new HashMap<>(); @@ -344,9 +346,9 @@ public class ProjectService extends BaseService{ /** * check whether have read permission * - * @param user - * @param project - * @return + * @param user user + * @param project project + * @return true if the user have permission to see the project, otherwise return false */ private boolean checkReadPermission(User user, Project project) { int permissionId = queryPermission(user, project); @@ -356,9 +358,9 @@ public class ProjectService extends BaseService{ /** * query permission id * - * @param user - * @param project - * @return + * @param user user + * @param project project + * @return permission */ private int queryPermission(User user, Project project) { if (user.getUserType() == UserType.ADMIN_USER) { @@ -381,7 +383,7 @@ public class ProjectService extends BaseService{ /** * query all project list that have one or more process definitions. - * @return + * @return project list */ public Map queryAllProjectList() { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/QueueService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/QueueService.java index 5b1cb1f111..5ac3ace25c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/QueueService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/QueueService.java @@ -50,8 +50,8 @@ public class QueueService extends BaseService { /** * query queue list * - * @param loginUser - * @return + * @param loginUser login user + * @return queue list */ public Map queryList(User loginUser) { Map result = new HashMap<>(5); @@ -69,11 +69,11 @@ public class QueueService extends BaseService { /** * query queue list paging * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param pageNo page number + * @param searchVal search value + * @param pageSize page size + * @return queue list */ public Map queryList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(5); @@ -99,10 +99,10 @@ public class QueueService extends BaseService { /** * create queue * - * @param loginUser - * @param queue - * @param queueName - * @return + * @param loginUser login user + * @param queue queue + * @param queueName queue name + * @return create result */ public Map createQueue(User loginUser, String queue, String queueName) { Map result = new HashMap<>(5); @@ -147,11 +147,11 @@ public class QueueService extends BaseService { /** * update queue * - * @param loginUser - * @param id - * @param queue - * @param queueName - * @return + * @param loginUser login user + * @param queue queue + * @param id queue id + * @param queueName queue name + * @return update result code */ public Map updateQueue(User loginUser, int id, String queue, String queueName) { Map result = new HashMap<>(5); @@ -202,9 +202,9 @@ public class QueueService extends BaseService { /** * verify queue and queueName * - * @param queue - * @param queueName - * @return + * @param queue queue + * @param queueName queue name + * @return true if the queue name not exists, otherwise return false */ public Result verifyQueue(String queue, String queueName) { Result result=new Result(); @@ -240,8 +240,8 @@ public class QueueService extends BaseService { * check queue exist * if exists return true,not exists return false * check queue exist - * @param queue - * @return + * @param queue queue + * @return true if the queue not exists, otherwise return false */ private boolean checkQueueExist(String queue) { return queueMapper.queryAllQueueList(queue, null).size()>0 ? true : false; @@ -250,8 +250,8 @@ public class QueueService extends BaseService { /** * check queue name exist * if exists return true,not exists return false - * @param queueName - * @return + * @param queueName queue name + * @return true if the queue name not exists, otherwise return false */ private boolean checkQueueNameExist(String queueName) { return queueMapper.queryAllQueueList(null ,queueName).size() > 0 ? true : false; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java index c5b9f60b3a..ecf30519eb 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java @@ -72,12 +72,12 @@ public class ResourcesService extends BaseService { /** * create resource * - * @param loginUser - * @param type - * @param name - * @param desc - * @param file - * @return + * @param loginUser login user + * @param name alias + * @param desc description + * @param file file + * @param type type + * @return create result code */ @Transactional(rollbackFor = Exception.class) public Result createResource(User loginUser, @@ -180,11 +180,12 @@ public class ResourcesService extends BaseService { /** * update resource * - * @param loginUser - * @param type - * @param name - * @param desc - * @return + * @param loginUser login user + * @param name alias + * @param resourceId resource id + * @param type resource type + * @param desc description + * @return update result code */ @Transactional(rollbackFor = Exception.class) public Result updateResource(User loginUser, @@ -290,12 +291,12 @@ public class ResourcesService extends BaseService { /** * query resources list paging * - * @param loginUser - * @param type - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param type resource type + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return resource list page */ public Map queryResourceListPaging(User loginUser, ResourceType type, String searchVal, Integer pageNo, Integer pageSize) { @@ -364,9 +365,9 @@ public class ResourcesService extends BaseService { /** * query resource list * - * @param loginUser - * @param type - * @return + * @param loginUser login user + * @param type resource type + * @return resource list */ public Map queryResourceList(User loginUser, ResourceType type) { @@ -386,8 +387,10 @@ public class ResourcesService extends BaseService { /** * delete resource * - * @param loginUser - * @param resourceId + * @param loginUser login user + * @param resourceId resource id + * @return delete result code + * @throws Exception exception */ @Transactional(rollbackFor = Exception.class) public Result delete(User loginUser, int resourceId) throws Exception { @@ -430,10 +433,10 @@ public class ResourcesService extends BaseService { /** * verify resource by name and type - * @param name - * @param type - * @param loginUser - * @return + * @param loginUser login user + * @param name resource alias + * @param type resource type + * @return true if the resource name not exists, otherwise return false */ public Result verifyResourceName(String name, ResourceType type,User loginUser) { Result result = new Result(); @@ -467,29 +470,13 @@ public class ResourcesService extends BaseService { return result; } - /** - * verify resource by name and type - * - * @param name - * @return - */ - public Result verifyResourceName(String name, ResourceType type) { - Result result = new Result(); - if (checkResourceExists(name, 0, type.ordinal())) { - logger.error("resource type:{} name:{} has exist, can't create again.", type, name); - putMsg(result, Status.RESOURCE_EXIST); - } else { - putMsg(result, Status.SUCCESS); - } - - return result; - } - /** * view resource file online * - * @param resourceId - * @return + * @param resourceId resource id + * @param skipLineNum skip line number + * @param limit limit + * @return resource content */ public Result readResource(int resourceId, int skipLineNum, int limit) { Result result = new Result(); @@ -550,13 +537,13 @@ public class ResourcesService extends BaseService { /** * create resource file online * - * @param loginUser - * @param type - * @param fileName - * @param fileSuffix - * @param desc - * @param content - * @return + * @param loginUser login user + * @param type resource type + * @param fileName file name + * @param fileSuffix file suffix + * @param desc description + * @param content content + * @return create result code */ @Transactional(rollbackFor = Exception.class) public Result onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix, String desc, String content) { @@ -615,8 +602,9 @@ public class ResourcesService extends BaseService { /** * updateProcessInstance resource * - * @param resourceId - * @return + * @param resourceId resource id + * @param content content + * @return update result cod */ @Transactional(rollbackFor = Exception.class) public Result updateResourceContent(int resourceId, String content) { @@ -710,8 +698,9 @@ public class ResourcesService extends BaseService { /** * download file * - * @param resourceId - * @return + * @param resourceId resource id + * @return resource content + * @throws Exception exception */ public org.springframework.core.io.Resource downloadResource(int resourceId) throws Exception { // if resource upload startup @@ -743,9 +732,9 @@ public class ResourcesService extends BaseService { /** * unauthorized file * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return unauthorized result code */ public Map unauthorizedFile(User loginUser, Integer userId) { @@ -776,9 +765,9 @@ public class ResourcesService extends BaseService { /** * unauthorized udf function * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return unauthorized result code */ public Map unauthorizedUDFFunction(User loginUser, Integer userId) { Map result = new HashMap<>(5); @@ -809,9 +798,9 @@ public class ResourcesService extends BaseService { /** * authorized udf function * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return authorized result code */ public Map authorizedUDFFunction(User loginUser, Integer userId) { Map result = new HashMap<>(); @@ -828,9 +817,9 @@ public class ResourcesService extends BaseService { /** * authorized file * - * @param loginUser - * @param userId - * @return + * @param loginUser login user + * @param userId user id + * @return authorized result */ public Map authorizedFile(User loginUser, Integer userId) { Map result = new HashMap<>(5); @@ -847,10 +836,10 @@ public class ResourcesService extends BaseService { /** * get hdfs file name * - * @param resource - * @param tenantCode - * @param hdfsFileName - * @return + * @param resource resource + * @param tenantCode tenant code + * @param hdfsFileName hdfs file name + * @return hdfs file name */ private String getHdfsFileName(Resource resource, String tenantCode, String hdfsFileName) { if (resource.getType().equals(ResourceType.FILE)) { @@ -864,10 +853,10 @@ public class ResourcesService extends BaseService { /** * get hdfs file name * - * @param resourceType - * @param tenantCode - * @param hdfsFileName - * @return + * @param resourceType resource type + * @param tenantCode tenant code + * @param hdfsFileName hdfs file name + * @return hdfs file name */ private String getHdfsFileName(ResourceType resourceType, String tenantCode, String hdfsFileName) { if (resourceType.equals(ResourceType.FILE)) { @@ -881,8 +870,8 @@ public class ResourcesService extends BaseService { /** * get authorized resource list * - * @param resourceSet - * @param authedResourceList + * @param resourceSet resource set + * @param authedResourceList authorized resource list */ private void getAuthorizedResourceList(Set resourceSet, List authedResourceList) { Set authedResourceSet = null; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java index e22885ec4a..67384ac14b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java @@ -82,14 +82,19 @@ public class SchedulerService extends BaseService { /** * save schedule * - * @param loginUser - * @param projectName - * @param processDefineId - * @param schedule - * @param warningType - * @param warningGroupId - * @param failureStrategy - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefineId process definition id + * @param schedule scheduler + * @param warningType warning type + * @param warningGroupId warning group id + * @param failureStrategy failure strategy + * @param processInstancePriority process instance priority + * @param receivers receivers + * @param receiversCc receivers cc + * @param workerGroupId worker group id + * @return create result code + * @throws IOException ioexception */ @Transactional(rollbackFor = Exception.class) public Map insertSchedule(User loginUser, String projectName, Integer processDefineId, String schedule, WarningType warningType, @@ -162,16 +167,20 @@ public class SchedulerService extends BaseService { /** * updateProcessInstance schedule * - * @param loginUser - * @param projectName - * @param id - * @param scheduleExpression - * @param warningType - * @param warningGroupId - * @param failureStrategy - * @param scheduleStatus - * @param workerGroupId - * @return + * @param loginUser login user + * @param projectName project name + * @param id scheduler id + * @param scheduleExpression scheduler + * @param warningType warning type + * @param warningGroupId warning group id + * @param failureStrategy failure strategy + * @param workerGroupId worker group id + * @param processInstancePriority process instance priority + * @param receiversCc receiver cc + * @param receivers receivers + * @param scheduleStatus schedule status + * @return update result code + * @throws IOException ioexception */ @Transactional(rollbackFor = Exception.class) public Map updateSchedule(User loginUser, String projectName, Integer id, String scheduleExpression, WarningType warningType, @@ -261,11 +270,11 @@ public class SchedulerService extends BaseService { /** * set schedule online or offline * - * @param loginUser - * @param projectName - * @param id - * @param scheduleStatus - * @return + * @param loginUser login user + * @param projectName project name + * @param id scheduler id + * @param scheduleStatus schedule status + * @return publish result code */ @Transactional(rollbackFor = Exception.class) public Map setScheduleState(User loginUser, String projectName, Integer id, ReleaseState scheduleStatus) { @@ -375,10 +384,13 @@ public class SchedulerService extends BaseService { /** * query schedule * - * @param loginUser - * @param projectName - * @param processDefineId - * @return + * @param loginUser login user + * @param projectName project name + * @param processDefineId process definition id + * @param pageNo page number + * @param pageSize page size + * @param searchVal search value + * @return schedule list page */ public Map querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize) { @@ -415,9 +427,9 @@ public class SchedulerService extends BaseService { /** * query schedule list * - * @param loginUser - * @param projectName - * @return + * @param loginUser login user + * @param projectName project name + * @return schedule list */ public Map queryScheduleList(User loginUser, String projectName) { Map result = new HashMap<>(5); @@ -437,11 +449,6 @@ public class SchedulerService extends BaseService { return result; } - /** - * set schedule - * - * @see - */ public void setSchedule(int projectId, int scheduleId) throws RuntimeException{ logger.info("set schedule, project id: {}, scheduleId: {}", projectId, scheduleId); @@ -467,6 +474,10 @@ public class SchedulerService extends BaseService { /** * delete schedule + * + * @param projectId project id + * @param scheduleId schedule id + * @throws RuntimeException runtime exception */ public static void deleteSchedule(int projectId, int scheduleId) throws RuntimeException{ logger.info("delete schedules of project id:{}, schedule id:{}", projectId, scheduleId); @@ -484,10 +495,10 @@ public class SchedulerService extends BaseService { /** * check valid * - * @param result - * @param bool - * @param status - * @return + * @param result result + * @param bool bool + * @param status status + * @return check result code */ private boolean checkValid(Map result, boolean bool, Status status) { // timeout is valid @@ -501,10 +512,10 @@ public class SchedulerService extends BaseService { /** * delete schedule by id * - * @param loginUser - * @param projectName - * @param scheduleId - * @return + * @param loginUser login user + * @param projectName project name + * @param scheduleId scheule id + * @return delete result code */ public Map deleteScheduleById(User loginUser, String projectName, Integer scheduleId) { @@ -550,10 +561,11 @@ public class SchedulerService extends BaseService { /** * preview schedule - * @param loginUser - * @param projectName - * @param schedule - * @return + * + * @param loginUser login user + * @param projectName project name + * @param schedule schedule expression + * @return the next five fire time */ public Map previewSchedule(User loginUser, String projectName, String schedule) { Map result = new HashMap<>(5); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java index 411a5614ca..89478d3e0e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java @@ -50,8 +50,8 @@ public class SessionService extends BaseService{ /** * get user session from request * - * @param request - * @return + * @param request request + * @return session */ public Session getSession(HttpServletRequest request) { String sessionId = request.getHeader(Constants.SESSION_ID); @@ -77,9 +77,9 @@ public class SessionService extends BaseService{ /** * create session * - * @param user - * @param ip - * @return + * @param user user + * @param ip ip + * @return session string */ @Transactional(rollbackFor = Exception.class) public String createSession(User user, String ip) { @@ -136,7 +136,7 @@ public class SessionService extends BaseService{ * remove ip restrictions * * @param ip no use - * @param loginUser + * @param loginUser login user */ public void signOut(String ip, User loginUser) { try { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java index 7d5056884e..c1c5acd44c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java @@ -65,17 +65,18 @@ public class TaskInstanceService extends BaseService { /** * query task list by project, process instance, task name, task start time, task end time, task status, keyword paging * - * @param loginUser - * @param projectName - * @param processInstanceId - * @param taskName - * @param startDate - * @param endDate - * @param searchVal - * @param stateType - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param projectName project name + * @param processInstanceId process instance id + * @param searchVal search value + * @param taskName task name + * @param stateType state type + * @param host host + * @param startDate start time + * @param endDate end time + * @param pageNo page number + * @param pageSize page size + * @return task list page */ public Map queryTaskListPaging(User loginUser, String projectName, Integer processInstanceId, String taskName, String startDate, String endDate, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskRecordService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskRecordService.java index 3e3e544249..54b6a1889c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskRecordService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskRecordService.java @@ -42,16 +42,17 @@ public class TaskRecordService extends BaseService{ /** * query task record list paging * - * @param taskName - * @param startDate - * @param taskDate - * @param sourceTable - * @param destTable - * @param endDate - * @param state - * @param pageNo - * @param pageSize - * @return + * @param taskName task name + * @param state state + * @param sourceTable source table + * @param destTable destination table + * @param taskDate task date + * @param startDate start time + * @param endDate end time + * @param pageNo page numbere + * @param pageSize page size + * @param isHistory is history + * @return task record list */ public Map queryTaskRecordListPaging(boolean isHistory, String taskName, String startDate, String taskDate, String sourceTable, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TenantService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TenantService.java index 607910095a..c73ca1bc7b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TenantService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TenantService.java @@ -71,12 +71,14 @@ public class TenantService extends BaseService{ /** * create tenant * - * @param loginUser - * @param tenantCode - * @param tenantName - * @param queueId - * @param desc - * @return + * + * @param loginUser login user + * @param tenantCode tenant code + * @param tenantName tenant name + * @param queueId queue id + * @param desc description + * @return create result code + * @throws Exception exception */ @Transactional(rollbackFor = Exception.class) public Map createTenant(User loginUser, @@ -129,11 +131,11 @@ public class TenantService extends BaseService{ /** * query tenant list paging * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageNo page number + * @param pageSize page size + * @return tenant list page */ public Map queryTenantList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { @@ -157,12 +159,14 @@ public class TenantService extends BaseService{ /** * updateProcessInstance tenant * - * @param loginUser - * @param tenantCode - * @param tenantName - * @param queueId - * @param desc - * @return + * @param loginUser login user + * @param id tennat id + * @param tenantCode tennat code + * @param tenantName tennat name + * @param queueId queue id + * @param desc description + * @return update result code + * @throws Exception exception */ public Map updateTenant(User loginUser,int id,String tenantCode, String tenantName, int queueId, String desc) throws Exception { @@ -224,10 +228,11 @@ public class TenantService extends BaseService{ /** * delete tenant - * - * @param loginUser - * @param id - * @return + * + * @param loginUser login user + * @param id tenant id + * @return delete result code + * @throws Exception exception */ @Transactional(rollbackFor = Exception.class) public Map deleteTenantById(User loginUser, int id) throws Exception { @@ -282,9 +287,9 @@ public class TenantService extends BaseService{ /** * query tenant list - * - * @param loginUser - * @return + * + * @param loginUser login user + * @return tenant list */ public Map queryTenantList(User loginUser) { @@ -299,9 +304,9 @@ public class TenantService extends BaseService{ /** * verify tenant code - * - * @param tenantCode - * @return + * + * @param tenantCode tenant code + * @return true if tenant code can user, otherwise return false */ public Result verifyTenantCode(String tenantCode) { Result result=new Result(); @@ -318,8 +323,8 @@ public class TenantService extends BaseService{ /** * check tenant exists * - * @param tenantCode - * @return + * @param tenantCode tenant code + * @return ture if the tenant code exists, otherwise return false */ private boolean checkTenantExists(String tenantCode) { List tenants = tenantMapper.queryByTenantCode(tenantCode); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java index aceb26415a..1c55b565a8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java @@ -63,14 +63,15 @@ public class UdfFuncService extends BaseService{ /** * create udf function * - * @param loginUser - * @param funcName - * @param argTypes - * @param database - * @param desc - * @param type - * @param resourceId - * @return + * @param loginUser login user + * @param type udf type + * @param funcName function name + * @param argTypes argument types + * @param database database + * @param desc description + * @param resourceId resource id + * @param className class name + * @return create result code */ public Result createUdfFunction(User loginUser, String funcName, @@ -130,8 +131,8 @@ public class UdfFuncService extends BaseService{ /** * - * @param name - * @return + * @param name name + * @return check result code */ private boolean checkUdfFuncNameExists(String name){ List resource = udfFuncMapper.queryUdfByIdStr(null, name); @@ -144,6 +145,9 @@ public class UdfFuncService extends BaseService{ /** * query udf function + * + * @param id udf function id + * @return udf function detail */ public Map queryUdfFuncDetail(int id) { @@ -161,13 +165,15 @@ public class UdfFuncService extends BaseService{ /** * updateProcessInstance udf function * - * @param funcName - * @param argTypes - * @param database - * @param desc - * @param type - * @param resourceId - * @return + * @param udfFuncId udf function id + * @param type resource type + * @param funcName function name + * @param argTypes argument types + * @param database data base + * @param desc description + * @param resourceId resource id + * @param className class name + * @return update result code */ public Map updateUdfFunc(int udfFuncId, String funcName, @@ -232,11 +238,11 @@ public class UdfFuncService extends BaseService{ /** * query udf function list paging * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param pageNo page number + * @param pageSize page size + * @param searchVal search value + * @return udf function list page */ public Map queryUdfFuncListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(5); @@ -254,11 +260,11 @@ public class UdfFuncService extends BaseService{ /** * get udf functions * - * @param loginUser - * @param searchVal - * @param pageSize - * @param pageNo - * @return + * @param loginUser login user + * @param searchVal search value + * @param pageSize page size + * @param pageNo page number + * @return udf function list page */ private IPage getUdfFuncsPage(User loginUser, String searchVal, Integer pageSize, int pageNo) { @@ -273,9 +279,9 @@ public class UdfFuncService extends BaseService{ /** * query data resource by type * - * @param loginUser - * @param type - * @return + * @param loginUser login user + * @param type resource type + * @return resource list */ public Map queryResourceList(User loginUser, Integer type) { Map result = new HashMap<>(5); @@ -289,7 +295,8 @@ public class UdfFuncService extends BaseService{ /** * delete udf function * - * @param id + * @param id udf function id + * @return delete result code */ @Transactional(value = "transactionManager",rollbackFor = Exception.class) public Result delete(int id) { @@ -304,8 +311,8 @@ public class UdfFuncService extends BaseService{ /** * verify udf function by name * - * @param name - * @return + * @param name name + * @return true if the name can user, otherwise return false */ public Result verifyUdfFuncByName(String name) { Result result = new Result(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java index 9dce1f643d..a3394c434d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java @@ -76,13 +76,15 @@ public class UsersService extends BaseService { /** * create user, only system admin have permission * - * @param loginUser - * @param userName - * @param userPassword - * @param email - * @param tenantId - * @param phone - * @return + * @param loginUser login user + * @param userName user name + * @param userPassword user password + * @param email email + * @param tenantId tenant id + * @param phone phone + * @param queue queue + * @return create result code + * @throws Exception exception */ @Transactional(rollbackFor = Exception.class) public Map createUser(User loginUser, @@ -103,7 +105,7 @@ public class UsersService extends BaseService { return result; } - if (checkTenant(tenantId)) { + if (!checkTenantExists(tenantId)) { putMsg(result, Status.TENANT_NOT_EXIST); return result; } @@ -147,33 +149,23 @@ public class UsersService extends BaseService { /** * query user * - * @param name - * @param password - * @return + * @param name name + * @param password password + * @return user info */ public User queryUser(String name, String password) { String md5 = EncryptionUtils.getMd5(password); return userMapper.queryUserByNamePassword(name, md5); } - /** - * check general user or not - * - * @param user - * @return - */ - public boolean isGeneral(User user) { - return user.getUserType() == UserType.GENERAL_USER; - } - /** * query user list * - * @param loginUser - * @param searchVal - * @param pageNo - * @param pageSize - * @return + * @param loginUser login user + * @param pageNo page number + * @param searchVal search avlue + * @param pageSize page size + * @return user list page */ public Map queryUserList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(5); @@ -198,13 +190,15 @@ public class UsersService extends BaseService { /** * updateProcessInstance user * - * @param userId - * @param userName - * @param userPassword - * @param email - * @param tenantId - * @param phone - * @return + * @param userId user id + * @param userName user name + * @param userPassword user password + * @param email email + * @param tenantId tennat id + * @param phone phone + * @param queue queue + * @return update result code + * @throws Exception exception */ public Map updateUser(int userId, String userName, @@ -311,9 +305,10 @@ public class UsersService extends BaseService { /** * delete user * - * @param loginUser - * @param id - * @return + * @param loginUser login user + * @param id user id + * @return delete result code + * @throws Exception exception when operate hdfs */ public Map deleteUserById(User loginUser, int id) throws Exception { Map result = new HashMap<>(5); @@ -344,10 +339,10 @@ public class UsersService extends BaseService { /** * grant project * - * @param loginUser - * @param userId - * @param projectIds - * @return + * @param loginUser login user + * @param userId user id + * @param projectIds project id array + * @return grant result code */ public Map grantProject(User loginUser, int userId, String projectIds) { Map result = new HashMap<>(5); @@ -387,10 +382,10 @@ public class UsersService extends BaseService { /** * grant resource * - * @param loginUser - * @param userId - * @param resourceIds - * @return + * @param loginUser login user + * @param userId user id + * @param resourceIds resource id array + * @return grant result code */ public Map grantResources(User loginUser, int userId, String resourceIds) { Map result = new HashMap<>(5); @@ -432,10 +427,10 @@ public class UsersService extends BaseService { /** * grant udf function * - * @param loginUser - * @param userId - * @param udfIds - * @return + * @param loginUser login user + * @param userId user id + * @param udfIds udf id array + * @return grant result code */ public Map grantUDFFunction(User loginUser, int userId, String udfIds) { Map result = new HashMap<>(5); @@ -473,10 +468,10 @@ public class UsersService extends BaseService { /** * grant datasource * - * @param loginUser - * @param userId - * @param datasourceIds - * @return + * @param loginUser login user + * @param userId user id + * @param datasourceIds data source id array + * @return grant result code */ public Map grantDataSource(User loginUser, int userId, String datasourceIds) { Map result = new HashMap<>(5); @@ -515,8 +510,8 @@ public class UsersService extends BaseService { /** * query user info * - * @param loginUser - * @return + * @param loginUser login user + * @return user info */ public Map getUserInfo(User loginUser) { @@ -550,8 +545,8 @@ public class UsersService extends BaseService { /** * query user list * - * @param loginUser - * @return + * @param loginUser login user + * @return user list */ public Map queryAllGeneralUsers(User loginUser) { Map result = new HashMap<>(5); @@ -571,8 +566,8 @@ public class UsersService extends BaseService { /** * query user list * - * @param loginUser - * @return + * @param loginUser login user + * @return user list */ public Map queryUserList(User loginUser) { Map result = new HashMap<>(5); @@ -591,8 +586,8 @@ public class UsersService extends BaseService { /** * verify user name exists * - * @param userName - * @return + * @param userName user name + * @return true if user name not exists, otherwise return false */ public Result verifyUserName(String userName) { @@ -613,9 +608,9 @@ public class UsersService extends BaseService { /** * unauthorized user * - * @param loginUser - * @param alertgroupId - * @return + * @param loginUser login user + * @param alertgroupId alert group id + * @return unauthorize result code */ public Map unauthorizedUser(User loginUser, Integer alertgroupId) { @@ -650,9 +645,9 @@ public class UsersService extends BaseService { /** * authorized user * - * @param loginUser - * @param alertgroupId - * @return + * @param loginUser login user + * @param alertgroupId alert group id + * @return authorized result code */ public Map authorizedUser(User loginUser, Integer alertgroupId) { Map result = new HashMap<>(5); @@ -670,10 +665,10 @@ public class UsersService extends BaseService { /** * check * - * @param result - * @param bool - * @param userNoOperationPerm - * @return + * @param result result + * @param bool bool + * @param userNoOperationPerm status + * @return check result */ private boolean check(Map result, boolean bool, Status userNoOperationPerm) { //only admin can operate @@ -686,10 +681,10 @@ public class UsersService extends BaseService { } /** - * @param tenantId - * @return + * @param tenantId tenant id + * @return true if tenant exists, otherwise return false */ - private boolean checkTenant(int tenantId) { - return tenantMapper.queryById(tenantId) == null ? true : false; + private boolean checkTenantExists(int tenantId) { + return tenantMapper.queryById(tenantId) != null ? true : false; } } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java index 7514e3e282..925d01bd09 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java @@ -52,10 +52,12 @@ public class WorkerGroupService extends BaseService { /** * create or update a worker group - * @param id - * @param name - * @param ipList - * @return + * + * @param loginUser login user + * @param id worker group id + * @param name worker group name + * @param ipList ip list + * @return create or update result code */ public Map saveWorkerGroup(User loginUser,int id, String name, String ipList){ @@ -121,11 +123,12 @@ public class WorkerGroupService extends BaseService { /** * query worker group paging - * @param loginUser - * @param pageNo - * @param pageSize - * @param searchVal - * @return + * + * @param loginUser login user + * @param pageNo page number + * @param searchVal search value + * @param pageSize page size + * @return worker group list page */ public Map queryAllGroupPaging(User loginUser, Integer pageNo, Integer pageSize, String searchVal) { @@ -147,8 +150,8 @@ public class WorkerGroupService extends BaseService { /** * delete worker group by id - * @param id - * @return + * @param id worker group id + * @return delete result code */ @Transactional(rollbackFor = Exception.class) public Map deleteWorkerGroupById(Integer id) { @@ -168,7 +171,8 @@ public class WorkerGroupService extends BaseService { /** * query all worker group - * @return + * + * @return all worker group list */ public Map queryAllGroup() { Map result = new HashMap<>(5); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java index 5751204575..9731745617 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java @@ -39,7 +39,8 @@ public class CheckUtils { /** * check username * - * @param userName + * @param userName user name + * @return true if user name regex valid,otherwise return false */ public static boolean checkUserName(String userName) { return regexChecks(userName, Constants.REGEX_USER_NAME); @@ -48,7 +49,8 @@ public class CheckUtils { /** * check email * - * @param email + * @param email email + * @return true if email regex valid, otherwise return false */ public static boolean checkEmail(String email) { return email.length() > 5 && email.length() <= 40 && regexChecks(email, Constants.REGEX_MAIL_NAME) ; @@ -57,7 +59,8 @@ public class CheckUtils { /** * check project description * - * @param desc + * @param desc desc + * @return true if description regex valid, otherwise return false */ public static Map checkDesc(String desc) { Map result = new HashMap<>(); @@ -73,7 +76,8 @@ public class CheckUtils { /** * check extra info * - * @param otherParams + * @param otherParams other parames + * @return true if other parameters are valid, otherwise return false */ public static boolean checkOtherParams(String otherParams) { return StringUtils.isNotEmpty(otherParams) && !JSONUtils.checkJsonVaild(otherParams); @@ -82,7 +86,8 @@ public class CheckUtils { /** * check password * - * @param password + * @param password password + * @return true if password regex valid, otherwise return false */ public static boolean checkPassword(String password) { return StringUtils.isNotEmpty(password) && password.length() >= 2 && password.length() <= 20; @@ -91,7 +96,8 @@ public class CheckUtils { /** * check phone * phone can be empty. - * @param phone + * @param phone phone + * @return true if phone regex valid, otherwise return false */ public static boolean checkPhone(String phone) { return StringUtils.isEmpty(phone) || phone.length() <= 11; @@ -101,9 +107,9 @@ public class CheckUtils { /** * check task node parameter * - * @param parameter - * @param taskType - * @return + * @param parameter parameter + * @param taskType task type + * @return true if taks node parameters are valid, otherwise return false */ public static boolean checkTaskNodeParameters(String parameter, String taskType) { AbstractParameters abstractParameters = TaskParametersUtils.getParameters(taskType, parameter); @@ -117,11 +123,11 @@ public class CheckUtils { /** * check params - * @param userName - * @param password - * @param email - * @param phone - * @return + * @param userName user name + * @param password password + * @param email email + * @param phone phone + * @return true if user parameters are valid, other return false */ public static boolean checkUserParams(String userName, String password, String email, String phone){ return CheckUtils.checkUserName(userName) && @@ -131,11 +137,11 @@ public class CheckUtils { } /** - * 正则匹配 + * regex check * - * @param str - * @param pattern - * @return + * @param str input string + * @param pattern regex pattern + * @return true if regex pattern is right, otherwise return false */ private static boolean regexChecks(String str, Pattern pattern) { if (org.apache.commons.lang3.StringUtils.isEmpty(str)) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FileUtils.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FileUtils.java index 6e0d61ae0f..9c0e339b07 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FileUtils.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FileUtils.java @@ -38,8 +38,8 @@ public class FileUtils { /** * copy source file to target file * - * @param file - * @param destFilename + * @param file file + * @param destFilename destination file name */ public static void copyFile(MultipartFile file, String destFilename) { @@ -61,8 +61,9 @@ public class FileUtils { /** * file to resource * - * @param filename - * @return + * @param filename file name + * @return resource + * @throws MalformedURLException io exceptions */ public static Resource file2Resource(String filename) throws MalformedURLException { Path file = Paths.get(filename); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java index 9bee020d87..f946afdae2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java @@ -42,7 +42,7 @@ public class FourLetterWordMain { * @param port the destination port * @param cmd the 4letterword * @return server response - * @throws java.io.IOException + * @throws java.io.IOException io exceptions */ public static String send4LetterWord(String host, int port, String cmd) throws IOException @@ -56,7 +56,7 @@ public class FourLetterWordMain { * @param cmd the 4letterword * @param timeout in milliseconds, maximum time to wait while connecting/reading data * @return server response - * @throws java.io.IOException + * @throws java.io.IOException io exceptions */ public static String send4LetterWord(String host, int port, String cmd, int timeout) throws IOException diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java index cd2d66dfd0..625e35276b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/PageInfo.java @@ -21,7 +21,7 @@ import java.util.List; /** * page info * - * @param + * @param model */ public class PageInfo { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/Result.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/Result.java index 2c3d9c36bd..6ab9512286 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/Result.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/Result.java @@ -19,7 +19,7 @@ package org.apache.dolphinscheduler.api.utils; /** * result * - * @param + * @param T */ public class Result { /** diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZookeeperMonitor.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZookeeperMonitor.java index 3870c101d2..a6a47b2ce3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZookeeperMonitor.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/ZookeeperMonitor.java @@ -53,7 +53,7 @@ public class ZookeeperMonitor extends AbstractZKClient{ /** * get master servers - * @return + * @return master server information */ public List getMasterServers(){ return getServersList(ZKNodeType.MASTER); @@ -61,7 +61,7 @@ public class ZookeeperMonitor extends AbstractZKClient{ /** * master construct is the same with worker, use the master instead - * @return + * @return worker server informations */ public List getWorkerServers(){ return getServersList(ZKNodeType.WORKER); diff --git a/dolphinscheduler-api/src/main/resources/i18n/messages.properties b/dolphinscheduler-api/src/main/resources/i18n/messages.properties index 44787fd78f..8c155a7e0e 100644 --- a/dolphinscheduler-api/src/main/resources/i18n/messages.properties +++ b/dolphinscheduler-api/src/main/resources/i18n/messages.properties @@ -233,3 +233,4 @@ VERIFY_DATA_SOURCE_NOTES=verify data source UNAUTHORIZED_DATA_SOURCE_NOTES=unauthorized data source AUTHORIZED_DATA_SOURCE_NOTES=authorized data source DELETE_SCHEDULER_BY_ID_NOTES=delete scheduler by id +QUERY_ALERT_GROUP_LIST_PAGING_NOTES=query alert group list paging diff --git a/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties b/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties index d06b83fed5..c46d72a2d2 100644 --- a/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties +++ b/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties @@ -233,3 +233,4 @@ VERIFY_DATA_SOURCE_NOTES=verify data source UNAUTHORIZED_DATA_SOURCE_NOTES=unauthorized data source AUTHORIZED_DATA_SOURCE_NOTES=authorized data source DELETE_SCHEDULER_BY_ID_NOTES=delete scheduler by id +QUERY_ALERT_GROUP_LIST_PAGING_NOTES=query alert group list paging diff --git a/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties b/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties index 46b0270747..5b7d4aef87 100644 --- a/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties +++ b/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties @@ -231,3 +231,4 @@ VERIFY_DATA_SOURCE_NOTES=验证数据源 UNAUTHORIZED_DATA_SOURCE_NOTES=未授权的数据源 AUTHORIZED_DATA_SOURCE_NOTES=授权的数据源 DELETE_SCHEDULER_BY_ID_NOTES=根据定时id删除定时数据 +QUERY_ALERT_GROUP_LIST_PAGING_NOTES=分页查询告警组列表 diff --git a/dolphinscheduler-common/pom.xml b/dolphinscheduler-common/pom.xml index cf2c29ea9d..a015315a9f 100644 --- a/dolphinscheduler-common/pom.xml +++ b/dolphinscheduler-common/pom.xml @@ -579,13 +579,13 @@ com.baomidou mybatis-plus-annotation - RELEASE - compile + ${mybatis-plus.version} + compile org.projectlombok lombok - RELEASE + ${lombok.version} compile diff --git a/dolphinscheduler-rpc/src/main/java/org/apache/dolphinscheduler/rpc/LogViewServiceGrpc.java b/dolphinscheduler-rpc/src/main/java/org/apache/dolphinscheduler/rpc/LogViewServiceGrpc.java index ddab9bd830..ca7644fedf 100644 --- a/dolphinscheduler-rpc/src/main/java/org/apache/dolphinscheduler/rpc/LogViewServiceGrpc.java +++ b/dolphinscheduler-rpc/src/main/java/org/apache/dolphinscheduler/rpc/LogViewServiceGrpc.java @@ -38,8 +38,8 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; * */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.9.0)", - comments = "Source: scheduler.proto") + value = "by gRPC proto compiler (version 1.9.0)", + comments = "Source: scheduler.proto") public final class LogViewServiceGrpc { private LogViewServiceGrpc() {} @@ -50,98 +50,98 @@ public final class LogViewServiceGrpc { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getRollViewLogMethod()} instead. public static final io.grpc.MethodDescriptor METHOD_ROLL_VIEW_LOG = getRollViewLogMethod(); + org.apache.dolphinscheduler.rpc.RetStrInfo> METHOD_ROLL_VIEW_LOG = getRollViewLogMethod(); private static volatile io.grpc.MethodDescriptor getRollViewLogMethod; + org.apache.dolphinscheduler.rpc.RetStrInfo> getRollViewLogMethod; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor getRollViewLogMethod() { + org.apache.dolphinscheduler.rpc.RetStrInfo> getRollViewLogMethod() { io.grpc.MethodDescriptor getRollViewLogMethod; if ((getRollViewLogMethod = LogViewServiceGrpc.getRollViewLogMethod) == null) { synchronized (LogViewServiceGrpc.class) { if ((getRollViewLogMethod = LogViewServiceGrpc.getRollViewLogMethod) == null) { LogViewServiceGrpc.getRollViewLogMethod = getRollViewLogMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "schduler.LogViewService", "rollViewLog")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.dolphinscheduler.rpc.LogParameter.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.dolphinscheduler.rpc.RetStrInfo.getDefaultInstance())) - .setSchemaDescriptor(new LogViewServiceMethodDescriptorSupplier("rollViewLog")) - .build(); - } + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "schduler.LogViewService", "rollViewLog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.apache.dolphinscheduler.rpc.LogParameter.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.apache.dolphinscheduler.rpc.RetStrInfo.getDefaultInstance())) + .setSchemaDescriptor(new LogViewServiceMethodDescriptorSupplier("rollViewLog")) + .build(); } - } - return getRollViewLogMethod; + } + } + return getRollViewLogMethod; } @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getViewLogMethod()} instead. public static final io.grpc.MethodDescriptor METHOD_VIEW_LOG = getViewLogMethod(); + org.apache.dolphinscheduler.rpc.RetStrInfo> METHOD_VIEW_LOG = getViewLogMethod(); private static volatile io.grpc.MethodDescriptor getViewLogMethod; + org.apache.dolphinscheduler.rpc.RetStrInfo> getViewLogMethod; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor getViewLogMethod() { + org.apache.dolphinscheduler.rpc.RetStrInfo> getViewLogMethod() { io.grpc.MethodDescriptor getViewLogMethod; if ((getViewLogMethod = LogViewServiceGrpc.getViewLogMethod) == null) { synchronized (LogViewServiceGrpc.class) { if ((getViewLogMethod = LogViewServiceGrpc.getViewLogMethod) == null) { LogViewServiceGrpc.getViewLogMethod = getViewLogMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "schduler.LogViewService", "viewLog")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.dolphinscheduler.rpc.PathParameter.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.dolphinscheduler.rpc.RetStrInfo.getDefaultInstance())) - .setSchemaDescriptor(new LogViewServiceMethodDescriptorSupplier("viewLog")) - .build(); - } + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "schduler.LogViewService", "viewLog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.apache.dolphinscheduler.rpc.PathParameter.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.apache.dolphinscheduler.rpc.RetStrInfo.getDefaultInstance())) + .setSchemaDescriptor(new LogViewServiceMethodDescriptorSupplier("viewLog")) + .build(); } - } - return getViewLogMethod; + } + } + return getViewLogMethod; } @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getGetLogBytesMethod()} instead. public static final io.grpc.MethodDescriptor METHOD_GET_LOG_BYTES = getGetLogBytesMethod(); + org.apache.dolphinscheduler.rpc.RetByteInfo> METHOD_GET_LOG_BYTES = getGetLogBytesMethod(); private static volatile io.grpc.MethodDescriptor getGetLogBytesMethod; + org.apache.dolphinscheduler.rpc.RetByteInfo> getGetLogBytesMethod; @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static io.grpc.MethodDescriptor getGetLogBytesMethod() { + org.apache.dolphinscheduler.rpc.RetByteInfo> getGetLogBytesMethod() { io.grpc.MethodDescriptor getGetLogBytesMethod; if ((getGetLogBytesMethod = LogViewServiceGrpc.getGetLogBytesMethod) == null) { synchronized (LogViewServiceGrpc.class) { if ((getGetLogBytesMethod = LogViewServiceGrpc.getGetLogBytesMethod) == null) { LogViewServiceGrpc.getGetLogBytesMethod = getGetLogBytesMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "schduler.LogViewService", "getLogBytes")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.dolphinscheduler.rpc.PathParameter.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.apache.dolphinscheduler.rpc.RetByteInfo.getDefaultInstance())) - .setSchemaDescriptor(new LogViewServiceMethodDescriptorSupplier("getLogBytes")) - .build(); - } + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "schduler.LogViewService", "getLogBytes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.apache.dolphinscheduler.rpc.PathParameter.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.apache.dolphinscheduler.rpc.RetByteInfo.getDefaultInstance())) + .setSchemaDescriptor(new LogViewServiceMethodDescriptorSupplier("getLogBytes")) + .build(); } - } - return getGetLogBytesMethod; + } + } + return getGetLogBytesMethod; } /** @@ -155,7 +155,7 @@ public final class LogViewServiceGrpc { * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static LogViewServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { + io.grpc.Channel channel) { return new LogViewServiceBlockingStub(channel); } @@ -163,7 +163,7 @@ public final class LogViewServiceGrpc { * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static LogViewServiceFutureStub newFutureStub( - io.grpc.Channel channel) { + io.grpc.Channel channel) { return new LogViewServiceFutureStub(channel); } @@ -182,7 +182,7 @@ public final class LogViewServiceGrpc { * */ public void rollViewLog(org.apache.dolphinscheduler.rpc.LogParameter request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getRollViewLogMethod(), responseObserver); } @@ -193,7 +193,7 @@ public final class LogViewServiceGrpc { * */ public void viewLog(org.apache.dolphinscheduler.rpc.PathParameter request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getViewLogMethod(), responseObserver); } @@ -204,34 +204,34 @@ public final class LogViewServiceGrpc { * */ public void getLogBytes(org.apache.dolphinscheduler.rpc.PathParameter request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetLogBytesMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRollViewLogMethod(), - asyncUnaryCall( - new MethodHandlers< - org.apache.dolphinscheduler.rpc.LogParameter, - org.apache.dolphinscheduler.rpc.RetStrInfo>( - this, METHODID_ROLL_VIEW_LOG))) - .addMethod( - getViewLogMethod(), - asyncUnaryCall( - new MethodHandlers< - org.apache.dolphinscheduler.rpc.PathParameter, - org.apache.dolphinscheduler.rpc.RetStrInfo>( - this, METHODID_VIEW_LOG))) - .addMethod( - getGetLogBytesMethod(), - asyncUnaryCall( - new MethodHandlers< - org.apache.dolphinscheduler.rpc.PathParameter, - org.apache.dolphinscheduler.rpc.RetByteInfo>( - this, METHODID_GET_LOG_BYTES))) - .build(); + .addMethod( + getRollViewLogMethod(), + asyncUnaryCall( + new MethodHandlers< + org.apache.dolphinscheduler.rpc.LogParameter, + org.apache.dolphinscheduler.rpc.RetStrInfo>( + this, METHODID_ROLL_VIEW_LOG))) + .addMethod( + getViewLogMethod(), + asyncUnaryCall( + new MethodHandlers< + org.apache.dolphinscheduler.rpc.PathParameter, + org.apache.dolphinscheduler.rpc.RetStrInfo>( + this, METHODID_VIEW_LOG))) + .addMethod( + getGetLogBytesMethod(), + asyncUnaryCall( + new MethodHandlers< + org.apache.dolphinscheduler.rpc.PathParameter, + org.apache.dolphinscheduler.rpc.RetByteInfo>( + this, METHODID_GET_LOG_BYTES))) + .build(); } } @@ -247,13 +247,13 @@ public final class LogViewServiceGrpc { } private LogViewServiceStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { + io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected LogViewServiceStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { + io.grpc.CallOptions callOptions) { return new LogViewServiceStub(channel, callOptions); } @@ -264,9 +264,9 @@ public final class LogViewServiceGrpc { * */ public void rollViewLog(org.apache.dolphinscheduler.rpc.LogParameter request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getRollViewLogMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getRollViewLogMethod(), getCallOptions()), request, responseObserver); } /** @@ -276,9 +276,9 @@ public final class LogViewServiceGrpc { * */ public void viewLog(org.apache.dolphinscheduler.rpc.PathParameter request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getViewLogMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getViewLogMethod(), getCallOptions()), request, responseObserver); } /** @@ -288,9 +288,9 @@ public final class LogViewServiceGrpc { * */ public void getLogBytes(org.apache.dolphinscheduler.rpc.PathParameter request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getGetLogBytesMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetLogBytesMethod(), getCallOptions()), request, responseObserver); } } @@ -306,13 +306,13 @@ public final class LogViewServiceGrpc { } private LogViewServiceBlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { + io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected LogViewServiceBlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { + io.grpc.CallOptions callOptions) { return new LogViewServiceBlockingStub(channel, callOptions); } @@ -324,7 +324,7 @@ public final class LogViewServiceGrpc { */ public org.apache.dolphinscheduler.rpc.RetStrInfo rollViewLog(org.apache.dolphinscheduler.rpc.LogParameter request) { return blockingUnaryCall( - getChannel(), getRollViewLogMethod(), getCallOptions(), request); + getChannel(), getRollViewLogMethod(), getCallOptions(), request); } /** @@ -335,7 +335,7 @@ public final class LogViewServiceGrpc { */ public org.apache.dolphinscheduler.rpc.RetStrInfo viewLog(org.apache.dolphinscheduler.rpc.PathParameter request) { return blockingUnaryCall( - getChannel(), getViewLogMethod(), getCallOptions(), request); + getChannel(), getViewLogMethod(), getCallOptions(), request); } /** @@ -346,7 +346,7 @@ public final class LogViewServiceGrpc { */ public org.apache.dolphinscheduler.rpc.RetByteInfo getLogBytes(org.apache.dolphinscheduler.rpc.PathParameter request) { return blockingUnaryCall( - getChannel(), getGetLogBytesMethod(), getCallOptions(), request); + getChannel(), getGetLogBytesMethod(), getCallOptions(), request); } } @@ -362,13 +362,13 @@ public final class LogViewServiceGrpc { } private LogViewServiceFutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { + io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected LogViewServiceFutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { + io.grpc.CallOptions callOptions) { return new LogViewServiceFutureStub(channel, callOptions); } @@ -379,9 +379,9 @@ public final class LogViewServiceGrpc { * */ public com.google.common.util.concurrent.ListenableFuture rollViewLog( - org.apache.dolphinscheduler.rpc.LogParameter request) { + org.apache.dolphinscheduler.rpc.LogParameter request) { return futureUnaryCall( - getChannel().newCall(getRollViewLogMethod(), getCallOptions()), request); + getChannel().newCall(getRollViewLogMethod(), getCallOptions()), request); } /** @@ -391,9 +391,9 @@ public final class LogViewServiceGrpc { * */ public com.google.common.util.concurrent.ListenableFuture viewLog( - org.apache.dolphinscheduler.rpc.PathParameter request) { + org.apache.dolphinscheduler.rpc.PathParameter request) { return futureUnaryCall( - getChannel().newCall(getViewLogMethod(), getCallOptions()), request); + getChannel().newCall(getViewLogMethod(), getCallOptions()), request); } /** @@ -403,9 +403,9 @@ public final class LogViewServiceGrpc { * */ public com.google.common.util.concurrent.ListenableFuture getLogBytes( - org.apache.dolphinscheduler.rpc.PathParameter request) { + org.apache.dolphinscheduler.rpc.PathParameter request) { return futureUnaryCall( - getChannel().newCall(getGetLogBytesMethod(), getCallOptions()), request); + getChannel().newCall(getGetLogBytesMethod(), getCallOptions()), request); } } @@ -414,10 +414,10 @@ public final class LogViewServiceGrpc { private static final int METHODID_GET_LOG_BYTES = 2; private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { private final LogViewServiceImplBase serviceImpl; private final int methodId; @@ -432,15 +432,15 @@ public final class LogViewServiceGrpc { switch (methodId) { case METHODID_ROLL_VIEW_LOG: serviceImpl.rollViewLog((org.apache.dolphinscheduler.rpc.LogParameter) request, - (io.grpc.stub.StreamObserver) responseObserver); + (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_VIEW_LOG: serviceImpl.viewLog((org.apache.dolphinscheduler.rpc.PathParameter) request, - (io.grpc.stub.StreamObserver) responseObserver); + (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_GET_LOG_BYTES: serviceImpl.getLogBytes((org.apache.dolphinscheduler.rpc.PathParameter) request, - (io.grpc.stub.StreamObserver) responseObserver); + (io.grpc.stub.StreamObserver) responseObserver); break; default: throw new AssertionError(); @@ -450,7 +450,7 @@ public final class LogViewServiceGrpc { @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { default: throw new AssertionError(); @@ -459,7 +459,7 @@ public final class LogViewServiceGrpc { } private static abstract class LogViewServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { LogViewServiceBaseDescriptorSupplier() {} @java.lang.Override @@ -474,13 +474,13 @@ public final class LogViewServiceGrpc { } private static final class LogViewServiceFileDescriptorSupplier - extends LogViewServiceBaseDescriptorSupplier { + extends LogViewServiceBaseDescriptorSupplier { LogViewServiceFileDescriptorSupplier() {} } private static final class LogViewServiceMethodDescriptorSupplier - extends LogViewServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + extends LogViewServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final String methodName; LogViewServiceMethodDescriptorSupplier(String methodName) { @@ -502,11 +502,11 @@ public final class LogViewServiceGrpc { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new LogViewServiceFileDescriptorSupplier()) - .addMethod(getRollViewLogMethod()) - .addMethod(getViewLogMethod()) - .addMethod(getGetLogBytesMethod()) - .build(); + .setSchemaDescriptor(new LogViewServiceFileDescriptorSupplier()) + .addMethod(getRollViewLogMethod()) + .addMethod(getViewLogMethod()) + .addMethod(getGetLogBytesMethod()) + .build(); } } }