status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
unknown | language
stringclasses 5
values | commit_datetime
unknown | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,310 | [Bug] [Master] TaskResponseProcessor process NullPointerException | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
[ERROR] 2021-12-10 13:01:03.481 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[156] - process command Command [type=TASK_EXECUTE_RESPONSE, opaque=15, bodyLen=130] exception
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor.process(TaskResponseProcessor.java:72)
at org.apache.dolphinscheduler.remote.handler.NettyClientHandler.lambda$processByCommandType$0(NettyClientHandler.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
### What you expected to happen
Workflow execution
### How to reproduce
Manually execute a workflow
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7310 | https://github.com/apache/dolphinscheduler/pull/7318 | f03b0e8c7b562b77715185cbaeacc598cba87e12 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | "2021-12-10T05:25:06Z" | java | "2021-12-10T08:55:56Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/processor/TaskResponseProcessor.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,310 | [Bug] [Master] TaskResponseProcessor process NullPointerException | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
[ERROR] 2021-12-10 13:01:03.481 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[156] - process command Command [type=TASK_EXECUTE_RESPONSE, opaque=15, bodyLen=130] exception
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor.process(TaskResponseProcessor.java:72)
at org.apache.dolphinscheduler.remote.handler.NettyClientHandler.lambda$processByCommandType$0(NettyClientHandler.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
### What you expected to happen
Workflow execution
### How to reproduce
Manually execute a workflow
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7310 | https://github.com/apache/dolphinscheduler/pull/7318 | f03b0e8c7b562b77715185cbaeacc598cba87e12 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | "2021-12-10T05:25:06Z" | java | "2021-12-10T08:55:56Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/processor/TaskResponseProcessor.java | * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.server.master.processor;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.remote.command.Command;
import org.apache.dolphinscheduler.remote.command.CommandType;
import org.apache.dolphinscheduler.remote.command.TaskExecuteResponseCommand;
import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor;
import org.apache.dolphinscheduler.server.master.processor.queue.TaskResponseEvent;
import org.apache.dolphinscheduler.server.master.processor.queue.TaskResponseService;
import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import io.netty.channel.Channel;
import org.springframework.beans.factory.annotation.Autowired;
/**
* task response processor
*/
public class TaskResponseProcessor implements NettyRequestProcessor { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,310 | [Bug] [Master] TaskResponseProcessor process NullPointerException | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
[ERROR] 2021-12-10 13:01:03.481 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[156] - process command Command [type=TASK_EXECUTE_RESPONSE, opaque=15, bodyLen=130] exception
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor.process(TaskResponseProcessor.java:72)
at org.apache.dolphinscheduler.remote.handler.NettyClientHandler.lambda$processByCommandType$0(NettyClientHandler.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
### What you expected to happen
Workflow execution
### How to reproduce
Manually execute a workflow
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7310 | https://github.com/apache/dolphinscheduler/pull/7318 | f03b0e8c7b562b77715185cbaeacc598cba87e12 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | "2021-12-10T05:25:06Z" | java | "2021-12-10T08:55:56Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/processor/TaskResponseProcessor.java | private final Logger logger = LoggerFactory.getLogger(TaskResponseProcessor.class);
@Autowired
private TaskResponseService taskResponseService;
/**
* task final result response
* need master process , state persistence
*
* @param channel channel
* @param command command
*/
@Override
public void process(Channel channel, Command command) {
Preconditions.checkArgument(CommandType.TASK_EXECUTE_RESPONSE == command.getType(), String.format("invalid command type : %s", command.getType()));
TaskExecuteResponseCommand responseCommand = JSONUtils.parseObject(command.getBody(), TaskExecuteResponseCommand.class);
logger.info("received command : {}", responseCommand);
TaskResponseEvent taskResponseEvent = TaskResponseEvent.newResult(ExecutionStatus.of(responseCommand.getStatus()),
responseCommand.getEndTime(),
responseCommand.getProcessId(),
responseCommand.getAppIds(),
responseCommand.getTaskInstanceId(),
responseCommand.getVarPool(),
channel,
responseCommand.getProcessInstanceId()
);
taskResponseService.addResponse(taskResponseEvent);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,310 | [Bug] [Master] TaskResponseProcessor process NullPointerException | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
[ERROR] 2021-12-10 13:01:03.481 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[156] - process command Command [type=TASK_EXECUTE_RESPONSE, opaque=15, bodyLen=130] exception
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor.process(TaskResponseProcessor.java:72)
at org.apache.dolphinscheduler.remote.handler.NettyClientHandler.lambda$processByCommandType$0(NettyClientHandler.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
### What you expected to happen
Workflow execution
### How to reproduce
Manually execute a workflow
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7310 | https://github.com/apache/dolphinscheduler/pull/7318 | f03b0e8c7b562b77715185cbaeacc598cba87e12 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | "2021-12-10T05:25:06Z" | java | "2021-12-10T08:55:56Z" | dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/processor/CacheProcessorTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,310 | [Bug] [Master] TaskResponseProcessor process NullPointerException | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
[ERROR] 2021-12-10 13:01:03.481 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[156] - process command Command [type=TASK_EXECUTE_RESPONSE, opaque=15, bodyLen=130] exception
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor.process(TaskResponseProcessor.java:72)
at org.apache.dolphinscheduler.remote.handler.NettyClientHandler.lambda$processByCommandType$0(NettyClientHandler.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
### What you expected to happen
Workflow execution
### How to reproduce
Manually execute a workflow
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7310 | https://github.com/apache/dolphinscheduler/pull/7318 | f03b0e8c7b562b77715185cbaeacc598cba87e12 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | "2021-12-10T05:25:06Z" | java | "2021-12-10T08:55:56Z" | dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/processor/CacheProcessorTest.java | *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.server.master.processor;
import org.apache.dolphinscheduler.common.enums.CacheType;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.remote.command.CacheExpireCommand;
import org.apache.dolphinscheduler.remote.command.Command;
import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import io.netty.channel.Channel;
/**
* task ack processor test
*/
@RunWith(PowerMockRunner.class) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,310 | [Bug] [Master] TaskResponseProcessor process NullPointerException | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
[ERROR] 2021-12-10 13:01:03.481 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[156] - process command Command [type=TASK_EXECUTE_RESPONSE, opaque=15, bodyLen=130] exception
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor.process(TaskResponseProcessor.java:72)
at org.apache.dolphinscheduler.remote.handler.NettyClientHandler.lambda$processByCommandType$0(NettyClientHandler.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
### What you expected to happen
Workflow execution
### How to reproduce
Manually execute a workflow
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7310 | https://github.com/apache/dolphinscheduler/pull/7318 | f03b0e8c7b562b77715185cbaeacc598cba87e12 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | "2021-12-10T05:25:06Z" | java | "2021-12-10T08:55:56Z" | dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/processor/CacheProcessorTest.java | @PrepareForTest({SpringApplicationContext.class})
public class CacheProcessorTest {
private CacheProcessor cacheProcessor;
@Mock
private Channel channel;
@Mock
private CacheManager cacheManager;
@Mock
private Cache cache;
@Before
public void before() {
PowerMockito.mockStatic(SpringApplicationContext.class);
PowerMockito.when(SpringApplicationContext.getBean(CacheManager.class)).thenReturn(cacheManager);
Mockito.when(cacheManager.getCache(CacheType.TENANT.getCacheName())).thenReturn(cache);
cacheProcessor = new CacheProcessor();
}
@Test
public void testProcess() {
Tenant tenant = new Tenant();
tenant.setId(1);
CacheExpireCommand cacheExpireCommand = new CacheExpireCommand(CacheType.TENANT, "1");
Command command = cacheExpireCommand.convert2Command();
cacheProcessor.process(channel, command);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/CacheEvictAspect.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.aspect; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/CacheEvictAspect.java | import org.apache.dolphinscheduler.common.enums.CacheType;
import org.apache.dolphinscheduler.remote.command.CacheExpireCommand;
import org.apache.dolphinscheduler.service.cache.CacheNotifyService;
import org.apache.dolphinscheduler.service.cache.impl.CacheKeyGenerator;
import org.apache.commons.lang3.StringUtils;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.stereotype.Component;
/**
* aspect for cache evict
*/
@Aspect |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/CacheEvictAspect.java | @Component
public class CacheEvictAspect {
private static final Logger logger = LoggerFactory.getLogger(CacheEvictAspect.class);
/**
* symbol of spring el
*/
private static final String EL_SYMBOL = "#";
@Autowired
private CacheKeyGenerator cacheKeyGenerator;
@Autowired
private CacheNotifyService cacheNotifyService;
@Pointcut("@annotation(org.springframework.cache.annotation.CacheEvict)")
public void cacheEvictPointCut() {
}
@Around("cacheEvictPointCut()")
public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
MethodSignature sign = (MethodSignature) proceedingJoinPoint.getSignature();
Method method = sign.getMethod();
Object target = proceedingJoinPoint.getTarget();
Object[] args = proceedingJoinPoint.getArgs();
Object result = proceedingJoinPoint.proceed();
CacheConfig cacheConfig = method.getDeclaringClass().getAnnotation(CacheConfig.class);
CacheEvict cacheEvict = method.getAnnotation(CacheEvict.class);
CacheType cacheType = getCacheType(cacheConfig, cacheEvict);
if (cacheType != null) {
String cacheKey; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/CacheEvictAspect.java | if (cacheEvict.key().isEmpty()) {
cacheKey = (String) cacheKeyGenerator.generate(target, method, args);
} else {
cacheKey = cacheEvict.key();
List<Name> paramsList = getParamAnnotationsByType(method, Name.class);
if (cacheEvict.key().contains(EL_SYMBOL)) {
cacheKey = parseKey(cacheEvict.key(), paramsList.stream().map(o -> o.value()).collect(Collectors.toList()), Arrays.asList(args));
}
}
if (StringUtils.isNotEmpty(cacheKey)) {
cacheNotifyService.notifyMaster(new CacheExpireCommand(cacheType, cacheKey).convert2Command());
}
}
return result;
}
private CacheType getCacheType(CacheConfig cacheConfig, CacheEvict cacheEvict) {
String cacheName = null;
if (cacheEvict.cacheNames().length > 0) {
cacheName = cacheEvict.cacheNames()[0];
}
if (cacheConfig.cacheNames().length > 0) {
cacheName = cacheConfig.cacheNames()[0];
}
if (cacheName == null) {
return null;
}
for (CacheType cacheType : CacheType.values()) {
if (cacheType.getCacheName().equals(cacheName)) {
return cacheType;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/CacheEvictAspect.java | }
return null;
}
private String parseKey(String key, List<String> paramNameList, List<Object> paramList) {
SpelExpressionParser spelParser = new SpelExpressionParser();
EvaluationContext ctx = new StandardEvaluationContext();
for (int i = 0; i < paramNameList.size(); i++) {
ctx.setVariable("p" + i, paramList.get(i));
}
Object obj = spelParser.parseExpression(key).getValue(ctx);
if (null == obj) {
throw new RuntimeException("parseKey error");
}
return obj.toString();
}
private <T extends Annotation> List<T> getParamAnnotationsByType(Method method, Class<T> annotationClass) {
List<T> annotationsList = new ArrayList<>();
Annotation[][] annotations = method.getParameterAnnotations();
for (int i = 0; i < annotations.length; i++) {
Annotation[] annotationsI = annotations[i];
for (Annotation annotation : annotationsI) {
if (annotation.annotationType().equals(annotationClass)) {
annotationsList.add((T) annotation);
}
}
}
return annotationsList;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* process definition log mapper interface
*/
@CacheConfig(cacheNames = "processDefinition") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.java | public interface ProcessDefinitionLogMapper extends BaseMapper<ProcessDefinitionLog> {
/**
* query process definition log by name
*
* @param projectCode projectCode
* @param name process definition name
* @return process definition log list
*/
List<ProcessDefinitionLog> queryByDefinitionName(@Param("projectCode") long projectCode, @Param("name") String name);
/**
* query process definition log list
*
* @param code process definition code
* @return process definition log list
*/
List<ProcessDefinitionLog> queryByDefinitionCode(@Param("code") long code);
/**
* query max version for definition
*/
Integer queryMaxVersionForDefinition(@Param("code") long code);
/**
* query max version definition log |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.java | */
ProcessDefinitionLog queryMaxVersionDefinitionLog(@Param("code") long code);
/**
* query the certain process definition version info by process definition code and version number
*
* @param code process definition code
* @param version version number
* @return the process definition version info
*/
@Cacheable(sync = true, key = "#processDefinitionCode + '_' + #version")
ProcessDefinitionLog queryByDefinitionCodeAndVersion(@Param("code") long code, @Param("version") int version);
/**
* query the paging process definition version list by pagination info
*
* @param page pagination info
* @param code process definition code
* @param projectCode project code
* @return the paging process definition version list
*/
IPage<ProcessDefinitionLog> queryProcessDefinitionVersionsPaging(Page<ProcessDefinitionLog> page, @Param("code") long code, @Param("projectCode") long projectCode);
/**
* delete the certain process definition version by process definition id and version number
*
* @param code process definition code
* @param version version number
* @return delete result
*/
int deleteByProcessDefinitionCodeAndVersion(@Param("code") long code, @Param("version") int version);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.java | * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.DefinitionGroupByUser;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* process definition mapper interface
*/
@CacheConfig(cacheNames = "processDefinition", keyGenerator = "cacheKeyGenerator")
public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinition> { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.java | /**
* query process definition by code
*
* @param code code
* @return process definition
*/
@Cacheable(sync = true)
ProcessDefinition queryByCode(@Param("code") long code);
/**
* update
*/
@CacheEvict(key = "#p0.code")
int updateById(@Name("processDefinition") @Param("et") ProcessDefinition processDefinition);
/**
* query process definition by code list
*
* @param codes codes
* @return process definition list
*/
List<ProcessDefinition> queryByCodes(@Param("codes") Collection<Long> codes);
/**
* delete process definition by code
*
* @param code code
* @return delete result
*/
@CacheEvict(key = "#code")
int deleteByCode(@Name("code") @Param("code") long code);
/**
* verify process definition by name |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.java | *
* @param projectCode projectCode
* @param name name
* @return process definition
*/
ProcessDefinition verifyByDefineName(@Param("projectCode") long projectCode,
@Param("processDefinitionName") String name);
/**
* query process definition by name
*
* @param projectCode projectCode
* @param name name
* @return process definition
*/
ProcessDefinition queryByDefineName(@Param("projectCode") long projectCode,
@Param("processDefinitionName") String name);
/**
* query process definition by id
*
* @param processDefineId processDefineId
* @return process definition
*/
ProcessDefinition queryByDefineId(@Param("processDefineId") int processDefineId);
/**
* process definition page
*
* @param page page
* @param searchVal searchVal
* @param userId userId
* @param projectCode projectCode |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.java | * @param isAdmin isAdmin
* @return process definition IPage
*/
IPage<ProcessDefinition> queryDefineListPaging(IPage<ProcessDefinition> page,
@Param("searchVal") String searchVal,
@Param("userId") int userId,
@Param("projectCode") long projectCode,
@Param("isAdmin") boolean isAdmin);
/**
* query all process definition list
*
* @param projectCode projectCode
* @return process definition list
*/
List<ProcessDefinition> queryAllDefinitionList(@Param("projectCode") long projectCode);
/**
* query process definition by ids
*
* @param ids ids
* @return process definition list
*/
List<ProcessDefinition> queryDefinitionListByIdList(@Param("ids") Integer[] ids);
/**
* query process definition by tenant
*
* @param tenantId tenantId
* @return process definition list
*/
List<ProcessDefinition> queryDefinitionListByTenant(@Param("tenantId") int tenantId);
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.java | * Statistics process definition group by project codes list
* <p>
* We only need project codes to determine whether the definition belongs to the user or not.
*
* @param projectCodes projectCodes
* @return definition group by user
*/
List<DefinitionGroupByUser> countDefinitionByProjectCodes(@Param("projectCodes") Long[] projectCodes);
/**
* list all resource ids
*
* @return resource ids list
*/
@MapKey("id")
List<Map<String, Object>> listResources();
/**
* list all resource ids by user id
*
* @return resource ids list
*/
@MapKey("id")
List<Map<String, Object>> listResourcesByUser(@Param("userId") Integer userId);
/**
* list all project ids
*
* @return project ids list
*/
List<Integer> listProjectIds();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java | * See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* process task relation mapper interface
*/
@CacheConfig(cacheNames = "processTaskRelation", keyGenerator = "cacheKeyGenerator")
public interface ProcessTaskRelationMapper extends BaseMapper<ProcessTaskRelation> {
/**
* process task relation by projectCode and processCode
*
* @param projectCode projectCode
* @param processCode processCode
* @return ProcessTaskRelation list
*/
@Cacheable(sync = true)
List<ProcessTaskRelation> queryByProcessCode(@Param("projectCode") long projectCode,
@Param("processCode") long processCode);
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java | * update
*/
@CacheEvict(key = "#processTaskRelation.projectCode + '_' + #processTaskRelation.processDefinitionCode")
int updateById(@Name("processTaskRelation") @Param("et") ProcessTaskRelation processTaskRelation);
/**
* process task relation by taskCode
*
* @param taskCodes taskCode list
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryByTaskCodes(@Param("taskCodes") Long[] taskCodes);
/**
* process task relation by taskCode
*
* @param taskCode taskCode
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryByTaskCode(@Param("taskCode") long taskCode);
/**
* delete process task relation by processCode
*
* @param projectCode projectCode
* @param processCode processCode
* @return int
*/
@CacheEvict(key = "#projectCode + '_' + #processCode")
int deleteByCode(@Name("projectCode") @Param("projectCode") long projectCode,
@Name("processCode") @Param("processCode") long processCode);
/**
* batch insert process task relation |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java | *
* @param taskRelationList taskRelationList
* @return int
*/
int batchInsert(@Param("taskRelationList") List<ProcessTaskRelationLog> taskRelationList);
/**
* query downstream process task relation by taskCode
*
* @param taskCode taskCode
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryDownstreamByTaskCode(@Param("taskCode") long taskCode);
/**
* query upstream process task relation by taskCode
*
* @param projectCode projectCode
* @param taskCode taskCode
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryUpstreamByCode(@Param("projectCode") long projectCode, @Param("taskCode") long taskCode);
/**
* query downstream process task relation by taskCode
*
* @param projectCode projectCode
* @param taskCode taskCode
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryDownstreamByCode(@Param("projectCode") long projectCode, @Param("taskCode") long taskCode);
/**
* query task relation by codes |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java | *
* @param projectCode projectCode
* @param taskCode taskCode
* @param preTaskCodes preTaskCode list
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryUpstreamByCodes(@Param("projectCode") long projectCode, @Param("taskCode") long taskCode, @Param("preTaskCodes") Long[] preTaskCodes);
/**
* count upstream by codes
*
* @param projectCode projectCode
* @param taskCode taskCode
* @param processDefinitionCodes processDefinitionCodes
* @return upstream count list group by process definition code
*/
List<Map<String, Long>> countUpstreamByCodeGroupByProcessDefinitionCode(@Param("projectCode") long projectCode,
@Param("processDefinitionCodes") Long[] processDefinitionCodes,
@Param("taskCode") long taskCode);
/**
* batch update process task relation pre task
*
* @param processTaskRelationList process task relation list
* @return update num
*/
int batchUpdateProcessTaskRelationPreTask(@Param("processTaskRelationList") List<ProcessTaskRelation> processTaskRelationList);
/**
* query by code
*
* @param projectCode projectCode
* @param processDefinitionCode processDefinitionCode |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java | * @param preTaskCode preTaskCode
* @param postTaskCode postTaskCode
* @return ProcessTaskRelation
*/
List<ProcessTaskRelation> queryByCode(@Param("projectCode") long projectCode,
@Param("processDefinitionCode") long processDefinitionCode,
@Param("preTaskCode") long preTaskCode,
@Param("postTaskCode") long postTaskCode);
/**
* delete process task relation
*
* @param processTaskRelationLog processTaskRelationLog
* @return int
*/
int deleteRelation(@Param("processTaskRelationLog") ProcessTaskRelationLog processTaskRelationLog);
/**
* count by code
*
* @param projectCode projectCode
* @param processDefinitionCode processDefinitionCode
* @param preTaskCode preTaskCode
* @param postTaskCode postTaskCode
* @return ProcessTaskRelation
*/
int countByCode(@Param("projectCode") long projectCode,
@Param("processDefinitionCode") long processDefinitionCode,
@Param("preTaskCode") long preTaskCode,
@Param("postTaskCode") long postTaskCode);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.Schedule;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* scheduler mapper interface
*/
@CacheConfig(cacheNames = "schedule", keyGenerator = "cacheKeyGenerator") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.java | public interface ScheduleMapper extends BaseMapper<Schedule> {
/**
* scheduler page
* @param page page
* @param processDefinitionCode processDefinitionCode
* @param searchVal searchVal
* @return scheduler IPage
*/
IPage<Schedule> queryByProcessDefineCodePaging(IPage<Schedule> page,
@Param("processDefinitionCode") long processDefinitionCode,
@Param("searchVal") String searchVal);
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.java | * query schedule list by project name
* @param projectName projectName
* @return schedule list
*/
List<Schedule> querySchedulerListByProjectName(@Param("projectName") String projectName);
/**
* query schedule list by process definition codes
* @param processDefineCodes processDefineCodes
* @return schedule list
*/
List<Schedule> selectAllByProcessDefineArray(@Param("processDefineCodes") long[] processDefineCodes);
/**
* query schedule list by process definition code
* @param processDefinitionCode processDefinitionCode
* @return schedule
*/
Schedule queryByProcessDefinitionCode(@Param("processDefinitionCode") long processDefinitionCode);
/**
* query schedule list by process definition code
* @param processDefinitionCode processDefinitionCode
* @return schedule list
*/
@Cacheable(sync = true)
List<Schedule> queryReleaseSchedulerListByProcessDefinitionCode(@Param("processDefinitionCode") long processDefinitionCode);
@CacheEvict(key = "#entity.processDefinitionCode")
int insert(@Name("entity") Schedule entity);
@CacheEvict(key = "#entity.processDefinitionCode")
int updateById(@Name("entity") @Param("et")Schedule entity);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.java | import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* task definition log mapper interface
*/
@CacheConfig(cacheNames = "taskDefinition", keyGenerator = "cacheKeyGenerator")
public interface TaskDefinitionLogMapper extends BaseMapper<TaskDefinitionLog> {
/**
* query max version for definition
*
* @param code taskDefinitionCode
*/
Integer queryMaxVersionForDefinition(@Param("code") long code);
/**
* query task definition log
*
* @param code taskDefinitionCode
* @param version version
* @return task definition log
*/
@Cacheable(sync = true, key = "#code + '_' + #version")
TaskDefinitionLog queryByDefinitionCodeAndVersion(@Param("code") long code,
@Param("version") int version);
/**
* update
*/
@CacheEvict(key = "#taskDefinitionLog.code + '_' + #taskDefinitionLog.version")
int updateById(@Name("taskDefinitionLog") @Param("et") TaskDefinitionLog taskDefinitionLog);
/**
* @param taskDefinitions taskDefinition list |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionLogMapper.java | * @return list
*/
List<TaskDefinitionLog> queryByTaskDefinitions(@Param("taskDefinitions") Collection<TaskDefinition> taskDefinitions);
/**
* batch insert task definition logs
*
* @param taskDefinitionLogs taskDefinitionLogs
* @return int
*/
int batchInsert(@Param("taskDefinitionLogs") List<TaskDefinitionLog> taskDefinitionLogs);
/**
* delete the certain task definition version by task definition code and version
*
* @param code task definition code
* @param version task definition version
* @return delete result
*/
@CacheEvict(key = "#code + '_' #version")
int deleteByCodeAndVersion(@Name("code") @Param("code") long code, @Name("version") @Param("version") int version);
/**
* query the paging task definition version list by pagination info
*
* @param page pagination info
* @param projectCode project code
* @param code process definition code
* @return the paging task definition version list
*/
IPage<TaskDefinitionLog> queryTaskDefinitionVersionsPaging(Page<TaskDefinitionLog> page, @Param("code") long code, @Param("projectCode") long projectCode);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TenantMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.ibatis.annotations.Param;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* tenant mapper interface
*/
@CacheConfig(cacheNames = "tenant", keyGenerator = "cacheKeyGenerator") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TenantMapper.java | public interface TenantMapper extends BaseMapper<Tenant> {
/**
* query tenant by id
*
* @param tenantId tenantId
* @return tenant
*/
@Cacheable(sync = true)
Tenant queryById(@Param("tenantId") int tenantId);
/**
* delete by id
*/
@CacheEvict
int deleteById(int id); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TenantMapper.java | /**
* update
*/
@CacheEvict(key = "#tenant.id")
int updateById(@Name("tenant") @Param("et") Tenant tenant);
/**
* query tenant by code
*
* @param tenantCode tenantCode
* @return tenant
*/
Tenant queryByTenantCode(@Param("tenantCode") String tenantCode);
/**
* tenant page
*
* @param page page
* @param searchVal searchVal
* @return tenant IPage
*/
IPage<Tenant> queryTenantPaging(IPage<Tenant> page,
@Param("searchVal") String searchVal);
/**
* check tenant exist
*
* @param tenantCode tenantCode
* @return true if exist else return null
*/
Boolean existTenant(@Param("tenantCode") String tenantCode);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/UserMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.springframework.boot.context.properties.bind.Name;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* user mapper interface |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/UserMapper.java | */
@CacheConfig(cacheNames = "user", keyGenerator = "cacheKeyGenerator")
public interface UserMapper extends BaseMapper<User> {
/**
* select by user id
*/
@Cacheable(sync = true)
User selectById(int id);
/**
* delete by id
*/
@CacheEvict
int deleteById(int id);
/**
* update
*/
@CacheEvict(key = "#user.id")
int updateById(@Name("user") @Param("et") User user);
/**
* query all general user
*
* @return user list
*/
List<User> queryAllGeneralUser();
/**
* query user by name
*
* @param userName userName
* @return user
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/UserMapper.java | User queryByUserNameAccurately(@Param("userName") String userName);
/**
* query user by userName and password
*
* @param userName userName
* @param password password
* @return user
*/
User queryUserByNamePassword(@Param("userName") String userName, @Param("password") String password);
/**
* user page
*
* @param page page
* @param userName userName
* @return user IPage
*/
IPage<User> queryUserPaging(Page page,
@Param("userName") String userName);
/**
* query user detail by id
*
* @param userId userId
* @return user
*/
User queryDetailsById(@Param("userId") int userId);
/**
* query user list by alertgroupId
*
* @param alertgroupId alertgroupId
* @return user list |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/UserMapper.java | */
List<User> queryUserListByAlertGroupId(@Param("alertgroupId") int alertgroupId);
/**
* query user list by tenantId
*
* @param tenantId tenantId
* @return user list
*/
List<User> queryUserListByTenant(@Param("tenantId") int tenantId);
/**
* query user by userId
*
* @param userId userId
* @return user
*/
User queryTenantCodeByUserId(@Param("userId") int userId);
/**
* query user by token
*
* @param token token
* @return user
*/
User queryUserByToken(@Param("token") String token);
/**
* query user by queue name
*
* @param queueName queue name
* @return user list
*/
List<User> queryUserListByQueue(@Param("queue") String queueName); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,292 | [Bug] [ApiServer] process definition online error when standalone | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
when use standalone mode, process definition online error.

### What you expected to happen
process definition online successfully.
### How to reproduce
run standalone, create a new process definition, online.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7292 | https://github.com/apache/dolphinscheduler/pull/7293 | 939fa0c3bac50b43a519dfd3f4a6b8db1be92e92 | 0f7e38ed3c3acb9603e81479cc887e8e6133588e | "2021-12-09T13:52:45Z" | java | "2021-12-10T10:46:41Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/UserMapper.java | /**
* check the user exist
*
* @param queue queue name
* @return true if exist else return null
*/
Boolean existUser(@Param("queue") String queue);
/**
* update user with old queue
*
* @param oldQueue old queue name
* @param newQueue new queue name
* @return update rows
*/
Integer updateUserQueue(@Param("oldQueue") String oldQueue, @Param("newQueue") String newQueue);
/**
* query user by ids
*
* @param ids id list
* @return user list
*/
List<User> selectByIds(@Param("ids") List<Integer> ids);
/**
* query authed user list by projectId
* @param projectId projectId
* @return user list
*/
List<User> queryAuthedUserListByProjectId(@Param("projectId") int projectId);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.utils;
import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.graph.DAG;
import org.apache.dolphinscheduler.common.model.TaskNode;
import org.apache.dolphinscheduler.common.model.TaskNodeRelation;
import org.apache.dolphinscheduler.common.process.ProcessDag;
import org.apache.dolphinscheduler.common.task.conditions.ConditionsParameters;
import org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters;
import org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* dag tools
*/
public class DagHelper { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | private static final Logger logger = LoggerFactory.getLogger(DagHelper.class);
/**
* generate flow node relation list by task node list;
* Edges that are not in the task Node List will not be added to the result
*
* @param taskNodeList taskNodeList
* @return task node relation list
*/
public static List<TaskNodeRelation> generateRelationListByFlowNodes(List<TaskNode> taskNodeList) {
List<TaskNodeRelation> nodeRelationList = new ArrayList<>();
for (TaskNode taskNode : taskNodeList) {
String preTasks = taskNode.getPreTasks();
List<String> preTaskList = JSONUtils.toList(preTasks, String.class);
if (preTaskList != null) {
for (String depNodeCode : preTaskList) {
if (null != findNodeByCode(taskNodeList, depNodeCode)) {
nodeRelationList.add(new TaskNodeRelation(depNodeCode, Long.toString(taskNode.getCode())));
}
}
}
}
return nodeRelationList;
}
/**
* generate task nodes needed by dag
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | * @param taskNodeList taskNodeList
* @param startNodeNameList startNodeNameList
* @param recoveryNodeCodeList recoveryNodeCodeList
* @param taskDependType taskDependType
* @return task node list
*/
public static List<TaskNode> generateFlowNodeListByStartNode(List<TaskNode> taskNodeList, List<String> startNodeNameList,
List<String> recoveryNodeCodeList, TaskDependType taskDependType) {
List<TaskNode> destFlowNodeList = new ArrayList<>();
List<String> startNodeList = startNodeNameList;
if (taskDependType != TaskDependType.TASK_POST && CollectionUtils.isEmpty(startNodeList)) {
logger.error("start node list is empty! cannot continue run the process ");
return destFlowNodeList;
}
List<TaskNode> destTaskNodeList = new ArrayList<>();
List<TaskNode> tmpTaskNodeList = new ArrayList<>();
if (taskDependType == TaskDependType.TASK_POST
&& CollectionUtils.isNotEmpty(recoveryNodeCodeList)) {
startNodeList = recoveryNodeCodeList;
}
if (CollectionUtils.isEmpty(startNodeList)) {
tmpTaskNodeList = taskNodeList;
} else {
for (String startNodeCode : startNodeList) {
TaskNode startNode = findNodeByCode(taskNodeList, startNodeCode);
List<TaskNode> childNodeList = new ArrayList<>();
if (startNode == null) {
logger.error("start node name [{}] is not in task node list [{}] ", |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | startNodeCode,
taskNodeList
);
continue;
} else if (TaskDependType.TASK_POST == taskDependType) {
List<String> visitedNodeCodeList = new ArrayList<>();
childNodeList = getFlowNodeListPost(startNode, taskNodeList, visitedNodeCodeList);
} else if (TaskDependType.TASK_PRE == taskDependType) {
List<String> visitedNodeCodeList = new ArrayList<>();
childNodeList = getFlowNodeListPre(startNode, recoveryNodeCodeList, taskNodeList, visitedNodeCodeList);
} else {
childNodeList.add(startNode);
}
tmpTaskNodeList.addAll(childNodeList);
}
}
for (TaskNode taskNode : tmpTaskNodeList) {
if (null == findNodeByCode(destTaskNodeList, Long.toString(taskNode.getCode()))) {
destTaskNodeList.add(taskNode);
}
}
return destTaskNodeList;
}
/**
* find all the nodes that depended on the start node
*
* @param startNode startNode
* @param taskNodeList taskNodeList
* @return task node list
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | private static List<TaskNode> getFlowNodeListPost(TaskNode startNode, List<TaskNode> taskNodeList, List<String> visitedNodeCodeList) {
List<TaskNode> resultList = new ArrayList<>();
for (TaskNode taskNode : taskNodeList) {
List<String> depList = taskNode.getDepList();
if (null != depList && null != startNode && depList.contains(Long.toString(startNode.getCode())) && !visitedNodeCodeList.contains(Long.toString(taskNode.getCode()))) {
resultList.addAll(getFlowNodeListPost(taskNode, taskNodeList, visitedNodeCodeList));
}
}
if (null != startNode) {
visitedNodeCodeList.add(Long.toString(startNode.getCode()));
}
resultList.add(startNode);
return resultList;
}
/**
* find all nodes that start nodes depend on.
*
* @param startNode startNode
* @param recoveryNodeCodeList recoveryNodeCodeList
* @param taskNodeList taskNodeList
* @return task node list
*/
private static List<TaskNode> getFlowNodeListPre(TaskNode startNode, List<String> recoveryNodeCodeList, List<TaskNode> taskNodeList, List<String> visitedNodeCodeList) {
List<TaskNode> resultList = new ArrayList<>();
List<String> depList = new ArrayList<>();
if (null != startNode) {
depList = startNode.getDepList();
resultList.add(startNode);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | if (CollectionUtils.isEmpty(depList)) {
return resultList;
}
for (String depNodeCode : depList) {
TaskNode start = findNodeByCode(taskNodeList, depNodeCode);
if (recoveryNodeCodeList.contains(depNodeCode)) {
resultList.add(start);
} else if (!visitedNodeCodeList.contains(depNodeCode)) {
resultList.addAll(getFlowNodeListPre(start, recoveryNodeCodeList, taskNodeList, visitedNodeCodeList));
}
}
if (null != startNode) {
visitedNodeCodeList.add(Long.toString(startNode.getCode()));
}
return resultList;
}
/**
* generate dag by start nodes and recovery nodes
*
* @param totalTaskNodeList totalTaskNodeList
* @param startNodeNameList startNodeNameList
* @param recoveryNodeCodeList recoveryNodeCodeList
* @param depNodeType depNodeType
* @return process dag
* @throws Exception if error throws Exception
*/
public static ProcessDag generateFlowDag(List<TaskNode> totalTaskNodeList,
List<String> startNodeNameList,
List<String> recoveryNodeCodeList, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | TaskDependType depNodeType) throws Exception {
List<TaskNode> destTaskNodeList = generateFlowNodeListByStartNode(totalTaskNodeList, startNodeNameList, recoveryNodeCodeList, depNodeType);
if (destTaskNodeList.isEmpty()) {
return null;
}
List<TaskNodeRelation> taskNodeRelations = generateRelationListByFlowNodes(destTaskNodeList);
ProcessDag processDag = new ProcessDag();
processDag.setEdges(taskNodeRelations);
processDag.setNodes(destTaskNodeList);
return processDag;
}
/**
* find node by node name
*
* @param nodeDetails nodeDetails
* @param nodeName nodeName
* @return task node
*/
public static TaskNode findNodeByName(List<TaskNode> nodeDetails, String nodeName) {
for (TaskNode taskNode : nodeDetails) {
if (taskNode.getName().equals(nodeName)) {
return taskNode;
}
}
return null;
}
/**
* find node by node code
*
* @param nodeDetails nodeDetails |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | * @param nodeCode nodeCode
* @return task node
*/
public static TaskNode findNodeByCode(List<TaskNode> nodeDetails, String nodeCode) {
for (TaskNode taskNode : nodeDetails) {
if (Long.toString(taskNode.getCode()).equals(nodeCode)) {
return taskNode;
}
}
return null;
}
/**
* the task can be submit when all the depends nodes are forbidden or complete
*
* @param taskNode taskNode
* @param dag dag
* @param completeTaskList completeTaskList
* @return can submit
*/
public static boolean allDependsForbiddenOrEnd(TaskNode taskNode,
DAG<String, TaskNode, TaskNodeRelation> dag,
Map<String, TaskNode> skipTaskNodeList,
Map<String, TaskInstance> completeTaskList) {
List<String> dependList = taskNode.getDepList();
if (dependList == null) {
return true;
}
for (String dependNodeCode : dependList) {
TaskNode dependNode = dag.getNode(dependNodeCode);
if (dependNode == null || completeTaskList.containsKey(dependNodeCode) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | || dependNode.isForbidden()
|| skipTaskNodeList.containsKey(dependNodeCode)) {
continue;
} else {
return false;
}
}
return true;
}
/**
* parse the successor nodes of previous node.
* this function parse the condition node to find the right branch.
* also check all the depends nodes forbidden or complete
*
* @return successor nodes
*/
public static Set<String> parsePostNodes(String preNodeCode,
Map<String, TaskNode> skipTaskNodeList,
DAG<String, TaskNode, TaskNodeRelation> dag,
Map<String, TaskInstance> completeTaskList) {
Set<String> postNodeList = new HashSet<>();
Collection<String> startVertexes = new ArrayList<>();
if (preNodeCode == null) {
startVertexes = dag.getBeginNode();
} else if (dag.getNode(preNodeCode).isConditionsTask()) {
List<String> conditionTaskList = parseConditionTask(preNodeCode, skipTaskNodeList, dag, completeTaskList);
startVertexes.addAll(conditionTaskList);
} else if (dag.getNode(preNodeCode).isSwitchTask()) {
List<String> conditionTaskList = parseSwitchTask(preNodeCode, skipTaskNodeList, dag, completeTaskList);
startVertexes.addAll(conditionTaskList); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | } else {
startVertexes = dag.getSubsequentNodes(preNodeCode);
}
for (String subsequent : startVertexes) {
TaskNode taskNode = dag.getNode(subsequent);
if (isTaskNodeNeedSkip(taskNode, skipTaskNodeList)) {
setTaskNodeSkip(subsequent, dag, completeTaskList, skipTaskNodeList);
continue;
}
if (!DagHelper.allDependsForbiddenOrEnd(taskNode, dag, skipTaskNodeList, completeTaskList)) {
continue;
}
if (taskNode.isForbidden() || completeTaskList.containsKey(subsequent)) {
postNodeList.addAll(parsePostNodes(subsequent, skipTaskNodeList, dag, completeTaskList));
continue;
}
postNodeList.add(subsequent);
}
return postNodeList;
}
/**
* if all of the task dependence are skipped, skip it too.
*/
private static boolean isTaskNodeNeedSkip(TaskNode taskNode,
Map<String, TaskNode> skipTaskNodeList
) {
if (CollectionUtils.isEmpty(taskNode.getDepList())) {
return false;
}
for (String depNode : taskNode.getDepList()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | if (!skipTaskNodeList.containsKey(depNode)) {
return false;
}
}
return true;
}
/**
* parse condition task find the branch process
* set skip flag for another one.
*/
public static List<String> parseConditionTask(String nodeCode,
Map<String, TaskNode> skipTaskNodeList,
DAG<String, TaskNode, TaskNodeRelation> dag,
Map<String, TaskInstance> completeTaskList) {
List<String> conditionTaskList = new ArrayList<>();
TaskNode taskNode = dag.getNode(nodeCode);
if (!taskNode.isConditionsTask()) {
return conditionTaskList;
}
if (!completeTaskList.containsKey(nodeCode)) {
return conditionTaskList;
}
TaskInstance taskInstance = completeTaskList.get(nodeCode);
ConditionsParameters conditionsParameters =
JSONUtils.parseObject(taskNode.getConditionResult(), ConditionsParameters.class);
List<String> skipNodeList = new ArrayList<>();
if (taskInstance.getState().typeIsSuccess()) {
conditionTaskList = conditionsParameters.getSuccessNode();
skipNodeList = conditionsParameters.getFailedNode();
} else if (taskInstance.getState().typeIsFailure()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | conditionTaskList = conditionsParameters.getFailedNode();
skipNodeList = conditionsParameters.getSuccessNode();
} else {
conditionTaskList.add(nodeCode);
}
for (String failedNode : skipNodeList) {
setTaskNodeSkip(failedNode, dag, completeTaskList, skipTaskNodeList);
}
return conditionTaskList;
}
/**
* parse condition task find the branch process
* set skip flag for another one.
*
* @param nodeCode
* @return
*/
public static List<String> parseSwitchTask(String nodeCode,
Map<String, TaskNode> skipTaskNodeList,
DAG<String, TaskNode, TaskNodeRelation> dag,
Map<String, TaskInstance> completeTaskList) {
List<String> conditionTaskList = new ArrayList<>();
TaskNode taskNode = dag.getNode(nodeCode);
if (!taskNode.isSwitchTask()) {
return conditionTaskList;
}
if (!completeTaskList.containsKey(nodeCode)) {
return conditionTaskList;
}
conditionTaskList = skipTaskNode4Switch(taskNode, skipTaskNodeList, completeTaskList, dag); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | return conditionTaskList;
}
private static List<String> skipTaskNode4Switch(TaskNode taskNode, Map<String, TaskNode> skipTaskNodeList,
Map<String, TaskInstance> completeTaskList,
DAG<String, TaskNode, TaskNodeRelation> dag) {
SwitchParameters switchParameters = completeTaskList.get(Long.toString(taskNode.getCode())).getSwitchDependency();
int resultConditionLocation = switchParameters.getResultConditionLocation();
List<SwitchResultVo> conditionResultVoList = switchParameters.getDependTaskList();
List<String> switchTaskList = conditionResultVoList.get(resultConditionLocation).getNextNode();
if (CollectionUtils.isEmpty(switchTaskList)) {
switchTaskList = new ArrayList<>();
}
conditionResultVoList.remove(resultConditionLocation);
for (SwitchResultVo info : conditionResultVoList) {
if (CollectionUtils.isEmpty(info.getNextNode())) {
continue;
}
setTaskNodeSkip(info.getNextNode().get(0), dag, completeTaskList, skipTaskNodeList);
}
return switchTaskList;
}
/**
* set task node and the post nodes skip flag
*/
private static void setTaskNodeSkip(String skipNodeCode,
DAG<String, TaskNode, TaskNodeRelation> dag,
Map<String, TaskInstance> completeTaskList,
Map<String, TaskNode> skipTaskNodeList) {
if (!dag.containsNode(skipNodeCode)) {
return; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | }
skipTaskNodeList.putIfAbsent(skipNodeCode, dag.getNode(skipNodeCode));
Collection<String> postNodeList = dag.getSubsequentNodes(skipNodeCode);
for (String post : postNodeList) {
TaskNode postNode = dag.getNode(post);
if (isTaskNodeNeedSkip(postNode, skipTaskNodeList)) {
setTaskNodeSkip(post, dag, completeTaskList, skipTaskNodeList);
}
}
}
/***
* build dag graph
* @param processDag processDag
* @return dag
*/
public static DAG<String, TaskNode, TaskNodeRelation> buildDagGraph(ProcessDag processDag) {
DAG<String, TaskNode, TaskNodeRelation> dag = new DAG<>();
if (CollectionUtils.isNotEmpty(processDag.getNodes())) {
for (TaskNode node : processDag.getNodes()) {
dag.addNode(Long.toString(node.getCode()), node);
}
}
if (CollectionUtils.isNotEmpty(processDag.getEdges())) {
for (TaskNodeRelation edge : processDag.getEdges()) {
dag.addEdge(edge.getStartNode(), edge.getEndNode());
}
}
return dag; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | }
/**
* get process dag
*
* @param taskNodeList task node list
* @return Process dag
*/
public static ProcessDag getProcessDag(List<TaskNode> taskNodeList) {
List<TaskNodeRelation> taskNodeRelations = new ArrayList<>();
for (TaskNode taskNode : taskNodeList) {
String preTasks = taskNode.getPreTasks();
List<String> preTasksList = JSONUtils.toList(preTasks, String.class);
if (preTasksList != null) {
for (String depNode : preTasksList) {
taskNodeRelations.add(new TaskNodeRelation(depNode, Long.toString(taskNode.getCode())));
}
}
}
ProcessDag processDag = new ProcessDag();
processDag.setEdges(taskNodeRelations);
processDag.setNodes(taskNodeList);
return processDag;
}
/**
* get process dag
*
* @param taskNodeList task node list
* @return Process dag |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | */
public static ProcessDag getProcessDag(List<TaskNode> taskNodeList,
List<ProcessTaskRelation> processTaskRelations) {
Map<Long, TaskNode> taskNodeMap = new HashMap<>();
taskNodeList.forEach(taskNode -> {
taskNodeMap.putIfAbsent(taskNode.getCode(), taskNode);
});
List<TaskNodeRelation> taskNodeRelations = new ArrayList<>();
for (ProcessTaskRelation processTaskRelation : processTaskRelations) {
long preTaskCode = processTaskRelation.getPreTaskCode();
long postTaskCode = processTaskRelation.getPostTaskCode();
if (processTaskRelation.getPreTaskCode() != 0
&& taskNodeMap.containsKey(preTaskCode) && taskNodeMap.containsKey(postTaskCode)) {
TaskNode preNode = taskNodeMap.get(preTaskCode);
TaskNode postNode = taskNodeMap.get(postTaskCode);
taskNodeRelations.add(new TaskNodeRelation(Long.toString(preNode.getCode()), Long.toString(postNode.getCode())));
}
}
ProcessDag processDag = new ProcessDag();
processDag.setEdges(taskNodeRelations);
processDag.setNodes(taskNodeList);
return processDag;
}
/**
* is there have conditions after the parent node
*/
public static boolean haveConditionsAfterNode(String parentNodeCode,
DAG<String, TaskNode, TaskNodeRelation> dag
) {
boolean result = false; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | Set<String> subsequentNodes = dag.getSubsequentNodes(parentNodeCode);
if (CollectionUtils.isEmpty(subsequentNodes)) {
return result;
}
for (String nodeCode : subsequentNodes) {
TaskNode taskNode = dag.getNode(nodeCode);
List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class);
if (preTasksList.contains(parentNodeCode) && taskNode.isConditionsTask()) {
return true;
}
}
return result;
}
/**
* is there have conditions after the parent node
*/
public static boolean haveConditionsAfterNode(String parentNodeCode, List<TaskNode> taskNodes) {
if (CollectionUtils.isEmpty(taskNodes)) {
return false;
}
for (TaskNode taskNode : taskNodes) {
List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class);
if (preTasksList.contains(parentNodeCode) && taskNode.isConditionsTask()) {
return true;
}
}
return false;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.server.master.runner.task;
import org.apache.dolphinscheduler.common.enums.DependResult;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.enums.TaskType; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters;
import org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.NetUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.server.master.config.MasterConfig;
import org.apache.dolphinscheduler.server.utils.LogUtils;
import org.apache.dolphinscheduler.server.utils.SwitchTaskUtils;
import org.apache.commons.lang.StringUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SwitchTaskProcessor extends BaseTaskProcessor {
protected final String rgex = "['\"]*\\$\\{(.*?)\\}['\"]*";
private TaskInstance taskInstance;
private ProcessInstance processInstance;
TaskDefinition taskDefinition;
@Autowired
private MasterConfig masterConfig;
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | * switch result
*/
private DependResult conditionResult;
@Override
public boolean submit(TaskInstance taskInstance, ProcessInstance processInstance, int masterTaskCommitRetryTimes, int masterTaskCommitInterval) {
this.processInstance = processInstance;
this.taskInstance = processService.submitTaskWithRetry(processInstance, taskInstance, masterTaskCommitRetryTimes, masterTaskCommitInterval);
if (this.taskInstance == null) {
return false;
}
taskDefinition = processService.findTaskDefinition(
taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion()
);
taskInstance.setLogPath(LogUtils.getTaskLogPath(taskInstance.getFirstSubmitTime(),processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion(),
taskInstance.getProcessInstanceId(),
taskInstance.getId()));
setTaskExecutionLogger();
taskInstance.setHost(NetUtils.getAddr(masterConfig.getListenPort()));
taskInstance.setState(ExecutionStatus.RUNNING_EXECUTION);
taskInstance.setStartTime(new Date());
processService.updateTaskInstance(taskInstance);
return true;
}
@Override
public void run() {
try {
if (!this.taskState().typeIsFinished() && setSwitchResult()) {
endTaskState();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | } catch (Exception e) {
logger.error("update work flow {} switch task {} state error:",
this.processInstance.getId(),
this.taskInstance.getId(),
e);
}
}
@Override
protected boolean pauseTask() {
this.taskInstance.setState(ExecutionStatus.PAUSE);
this.taskInstance.setEndTime(new Date());
processService.saveTaskInstance(taskInstance);
return true;
}
@Override
protected boolean killTask() {
this.taskInstance.setState(ExecutionStatus.KILL);
this.taskInstance.setEndTime(new Date());
processService.saveTaskInstance(taskInstance);
return true;
}
@Override
protected boolean taskTimeout() {
return true;
}
@Override
public String getType() {
return TaskType.SWITCH.getDesc();
}
@Override |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | public ExecutionStatus taskState() {
return this.taskInstance.getState();
}
private boolean setSwitchResult() {
List<TaskInstance> taskInstances = processService.findValidTaskListByProcessId(
taskInstance.getProcessInstanceId()
);
Map<String, ExecutionStatus> completeTaskList = new HashMap<>();
for (TaskInstance task : taskInstances) {
completeTaskList.putIfAbsent(task.getName(), task.getState());
}
SwitchParameters switchParameters = taskInstance.getSwitchDependency();
List<SwitchResultVo> switchResultVos = switchParameters.getDependTaskList();
SwitchResultVo switchResultVo = new SwitchResultVo();
switchResultVo.setNextNode(switchParameters.getNextNode());
switchResultVos.add(switchResultVo);
int finalConditionLocation = switchResultVos.size() - 1;
int i = 0;
conditionResult = DependResult.SUCCESS;
for (SwitchResultVo info : switchResultVos) {
logger.info("the {} execution ", (i + 1));
logger.info("original condition sentence:{}", info.getCondition());
if (StringUtils.isEmpty(info.getCondition())) {
finalConditionLocation = i;
break;
}
String content = setTaskParams(info.getCondition().replaceAll("'", "\""), rgex);
logger.info("format condition sentence::{}", content);
Boolean result = null;
try { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | result = SwitchTaskUtils.evaluate(content);
} catch (Exception e) {
logger.info("error sentence : {}", content);
conditionResult = DependResult.FAILED;
break;
}
logger.info("condition result : {}", result);
if (result) {
finalConditionLocation = i;
break;
}
i++;
}
switchParameters.setDependTaskList(switchResultVos);
switchParameters.setResultConditionLocation(finalConditionLocation);
taskInstance.setSwitchDependency(switchParameters);
logger.info("the switch task depend result : {}", conditionResult);
return true;
}
/**
* update task state
*/
private void endTaskState() {
ExecutionStatus status = (conditionResult == DependResult.SUCCESS) ? ExecutionStatus.SUCCESS : ExecutionStatus.FAILURE;
taskInstance.setEndTime(new Date());
taskInstance.setState(status);
processService.updateTaskInstance(taskInstance);
}
public String setTaskParams(String content, String rgex) {
Pattern pattern = Pattern.compile(rgex); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,319 | [Bug] [MasterServer] NPE when switch else branch is empty | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
```
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.dao.utils.DagHelper.isTaskNodeNeedSkip(DagHelper.java:335) ~[classes/:na]
at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:313) ~[classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:860) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:395) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:350) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:300) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:248) [classes/:na]
at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:229) [classes/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) [guava-24.1-jre.jar:na]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-24.1-jre.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
```
### What you expected to happen
no error happen.
### How to reproduce

### Anything else
_No response_
### Version
2.0.0
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7319 | https://github.com/apache/dolphinscheduler/pull/7320 | 8c3fa4790346204647ad2737239e87c34669b021 | 99b8ec649213270df91b5a2808a26868c675a0d3 | "2021-12-10T07:52:22Z" | java | "2021-12-13T14:46:48Z" | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java | Matcher m = pattern.matcher(content);
Map<String, Property> globalParams = JSONUtils
.toList(processInstance.getGlobalParams(), Property.class)
.stream()
.collect(Collectors.toMap(Property::getProp, Property -> Property));
Map<String, Property> varParams = JSONUtils
.toList(taskInstance.getVarPool(), Property.class)
.stream()
.collect(Collectors.toMap(Property::getProp, Property -> Property));
if (varParams.size() > 0) {
varParams.putAll(globalParams);
globalParams = varParams;
}
while (m.find()) {
String paramName = m.group(1);
Property property = globalParams.get(paramName);
if (property == null) {
return "";
}
String value = property.getValue();
if (!org.apache.commons.lang.math.NumberUtils.isNumber(value)) {
value = "\"" + value + "\"";
}
logger.info("paramName:{},paramValue:{}", paramName, value);
content = content.replace("${" + paramName + "}", value);
}
return content;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.CREATE_ALERT_PLUGIN_INSTANCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.GET_ALERT_PLUGIN_INSTANCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_PLUGIN_INSTANCE_ERROR;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.AlertPluginInstanceService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
/**
* alert plugin instance controller
*/
@Api(tags = "ALERT_PLUGIN_INSTANCE_TAG") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | @RestController
@RequestMapping("alert-plugin-instances")
public class AlertPluginInstanceController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(AlertPluginInstanceController.class);
@Autowired
private AlertPluginInstanceService alertPluginInstanceService;
/**
* create alert plugin instance
*
* @param loginUser login user
* @param pluginDefineId alert plugin define id
* @param instanceName instance name
* @param pluginInstanceParams instance params
* @return result
*/
@ApiOperation(value = "createAlertPluginInstance", notes = "CREATE_ALERT_PLUGIN_INSTANCE_NOTES") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | @ApiImplicitParams({
@ApiImplicitParam(name = "pluginDefineId", value = "ALERT_PLUGIN_DEFINE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataType = "String", example = "DING TALK"),
@ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataType = "String", example = "ALERT_PLUGIN_INSTANCE_PARAMS")
})
@PostMapping()
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_ALERT_PLUGIN_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "pluginDefineId") int pluginDefineId,
@RequestParam(value = "instanceName") String instanceName,
@RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) {
Map<String, Object> result = alertPluginInstanceService.create(loginUser, pluginDefineId, instanceName, pluginInstanceParams);
return returnDataList(result);
}
/**
* updateAlertPluginInstance
*
* @param loginUser login user
* @param id alert plugin instance id
* @param instanceName instance name
* @param pluginInstanceParams instance params
* @return result
*/
@ApiOperation(value = "updateAlertPluginInstance", notes = "UPDATE_ALERT_PLUGIN_INSTANCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "alertPluginInstanceId", value = "ALERT_PLUGIN_INSTANCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataType = "String", example = "DING TALK"),
@ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataType = "String", example = "ALERT_PLUGIN_INSTANCE_PARAMS") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | })
@PutMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(UPDATE_ALERT_PLUGIN_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int id,
@RequestParam(value = "instanceName") String instanceName,
@RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) {
Map<String, Object> result = alertPluginInstanceService.update(loginUser, id, instanceName, pluginInstanceParams);
return returnDataList(result);
}
/**
* deleteAlertPluginInstance
*
* @param loginUser login user
* @param id id
* @return result
*/
@ApiOperation(value = "deleteAlertPluginInstance", notes = "DELETE_ALERT_PLUGIN_INSTANCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "ALERT_PLUGIN_ID", required = true, dataType = "Int", example = "100")
})
@DeleteMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_ALERT_PLUGIN_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int id) {
Map<String, Object> result = alertPluginInstanceService.delete(loginUser, id); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | return returnDataList(result);
}
/**
* getAlertPluginInstance
*
* @param loginUser login user
* @param id alert plugin instance id
* @return result
*/
@ApiOperation(value = "getAlertPluginInstance", notes = "GET_ALERT_PLUGIN_INSTANCE_NOTES")
@GetMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(GET_ALERT_PLUGIN_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int id) {
Map<String, Object> result = alertPluginInstanceService.get(loginUser, id);
return returnDataList(result);
}
/**
* getAlertPluginInstance
*
* @param loginUser login user
* @return result
*/
@ApiOperation(value = "queryAlertPluginInstanceList", notes = "QUERY_ALL_ALERT_PLUGIN_INSTANCE_NOTES")
@GetMapping(value = "/list")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
Map<String, Object> result = alertPluginInstanceService.queryAll();
return returnDataList(result);
}
/**
* check alert group exist
*
* @param loginUser login user
* @param alertInstanceName alert instance name
* @return check result code
*/
@ApiOperation(value = "verifyAlertInstanceName", notes = "VERIFY_ALERT_INSTANCE_NAME_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "alertInstanceName", value = "ALERT_INSTANCE_NAME", required = true, dataType = "String"),
})
@GetMapping(value = "/verify-name")
@ResponseStatus(HttpStatus.OK)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result verifyGroupName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "alertInstanceName") String alertInstanceName) {
boolean exist = alertPluginInstanceService.checkExistPluginInstanceName(alertInstanceName);
Result result = new Result();
if (exist) {
logger.error("alert plugin instance {} has exist, can't create again.", alertInstanceName);
result.setCode(Status.PLUGIN_INSTANCE_ALREADY_EXIT.getCode());
result.setMsg(Status.PLUGIN_INSTANCE_ALREADY_EXIT.getMsg());
} else {
result.setCode(Status.SUCCESS.getCode());
result.setMsg(Status.SUCCESS.getMsg());
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java | return result;
}
/**
* paging query alert plugin instance group list
*
* @param loginUser login user
* @param pageNo page number
* @param pageSize page size
* @return alert plugin instance list page
*/
@ApiOperation(value = "queryAlertPluginInstanceListPaging", notes = "QUERY_ALERT_PLUGIN_INSTANCE_LIST_PAGING_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
})
@GetMapping()
@ResponseStatus(HttpStatus.OK)
@ApiException(LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result listPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
return alertPluginInstanceService.queryPluginPage(pageNo, pageSize);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceService.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
/**
* alert plugin instance service
*/
public interface AlertPluginInstanceService { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceService.java | /**
* creat alert plugin instance
*
* @param loginUser login user
* @param pluginDefineId plugin define id
* @param instanceName instance name
* @param pluginInstanceParams plugin instance params
* @return result
*/
Map<String, Object> create(User loginUser,int pluginDefineId,String instanceName,String pluginInstanceParams);
/**
* update
* @param loginUser login user
* @param alertPluginInstanceId plugin instance id
* @param instanceName instance name
* @param pluginInstanceParams plugin instance params
* @return result
*/
Map<String, Object> update(User loginUser, int alertPluginInstanceId,String instanceName,String pluginInstanceParams);
/**
* delete alert plugin instance
*
* @param loginUser login user
* @param id id
* @return result
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertPluginInstanceService.java | Map<String, Object> delete(User loginUser, int id);
/**
* get alert plugin instance
*
* @param loginUser login user
* @param id get id
* @return alert plugin
*/
Map<String, Object> get(User loginUser, int id);
/**
* queryAll
*
* @return alert plugins
*/
Map<String, Object> queryAll();
/**
* checkExistPluginInstanceName
* @param pluginName plugin name
* @return isExist
*/
boolean checkExistPluginInstanceName(String pluginName);
/**
* queryPluginPage
* @param pageIndex page index
* @param pageSize page size
* @return plugins
*/
Result queryPluginPage(int pageIndex, int pageSize);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service.impl;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.AlertPluginInstanceService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.api.vo.AlertPluginInstanceVO;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | import org.apache.dolphinscheduler.dao.entity.PluginDefine;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper;
import org.apache.dolphinscheduler.dao.mapper.AlertPluginInstanceMapper;
import org.apache.dolphinscheduler.dao.mapper.PluginDefineMapper;
import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* alert plugin instance service impl
*/
@Service
@Lazy
public class AlertPluginInstanceServiceImpl extends BaseServiceImpl implements AlertPluginInstanceService {
@Autowired
private AlertPluginInstanceMapper alertPluginInstanceMapper;
@Autowired |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | private PluginDefineMapper pluginDefineMapper;
@Autowired
private AlertGroupMapper alertGroupMapper;
/**
* creat alert plugin instance
*
* @param loginUser login user
* @param pluginDefineId plugin define id
* @param instanceName instance name
* @param pluginInstanceParams plugin instance params
*/
@Override
public Map<String, Object> create(User loginUser, int pluginDefineId, String instanceName, String pluginInstanceParams) {
AlertPluginInstance alertPluginInstance = new AlertPluginInstance();
String paramsMapJson = parsePluginParamsMap(pluginInstanceParams);
alertPluginInstance.setPluginInstanceParams(paramsMapJson);
alertPluginInstance.setInstanceName(instanceName);
alertPluginInstance.setPluginDefineId(pluginDefineId);
Map<String, Object> result = new HashMap<>();
if (alertPluginInstanceMapper.existInstanceName(alertPluginInstance.getInstanceName()) == Boolean.TRUE) {
putMsg(result, Status.PLUGIN_INSTANCE_ALREADY_EXIT);
return result;
}
int i = alertPluginInstanceMapper.insert(alertPluginInstance);
if (i > 0) {
putMsg(result, Status.SUCCESS);
return result;
}
putMsg(result, Status.SAVE_ERROR);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | }
/**
* update alert plugin instance
*
* @param loginUser login user
* @param pluginInstanceId plugin instance id
* @param instanceName instance name
* @param pluginInstanceParams plugin instance params
*/
@Override
public Map<String, Object> update(User loginUser, int pluginInstanceId, String instanceName, String pluginInstanceParams) {
String paramsMapJson = parsePluginParamsMap(pluginInstanceParams);
AlertPluginInstance alertPluginInstance = new AlertPluginInstance(pluginInstanceId, paramsMapJson, instanceName, new Date());
Map<String, Object> result = new HashMap<>();
int i = alertPluginInstanceMapper.updateById(alertPluginInstance);
if (i > 0) {
putMsg(result, Status.SUCCESS);
return result;
}
putMsg(result, Status.SAVE_ERROR);
return result;
}
/**
* delete alert plugin instance
*
* @param loginUser login user
* @param id id
* @return result
*/
@Override |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | public Map<String, Object> delete(User loginUser, int id) {
Map<String, Object> result = new HashMap<>();
boolean hasAssociatedAlertGroup = checkHasAssociatedAlertGroup(String.valueOf(id));
if (hasAssociatedAlertGroup) {
putMsg(result, Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED);
return result;
}
int i = alertPluginInstanceMapper.deleteById(id);
if (i > 0) {
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* get alert plugin instance
*
* @param loginUser login user
* @param id get id
* @return alert plugin
*/
@Override
public Map<String, Object> get(User loginUser, int id) {
Map<String, Object> result = new HashMap<>();
AlertPluginInstance alertPluginInstance = alertPluginInstanceMapper.selectById(id);
if (null != alertPluginInstance) {
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, alertPluginInstance);
}
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | }
@Override
public Map<String, Object> queryAll() {
Map<String, Object> result = new HashMap<>();
List<AlertPluginInstance> alertPluginInstances = alertPluginInstanceMapper.queryAllAlertPluginInstanceList();
List<AlertPluginInstanceVO> alertPluginInstanceVOS = buildPluginInstanceVOList(alertPluginInstances);
if (null != alertPluginInstances) {
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, alertPluginInstanceVOS);
}
return result;
}
@Override
public boolean checkExistPluginInstanceName(String pluginInstanceName) {
return alertPluginInstanceMapper.existInstanceName(pluginInstanceName) == Boolean.TRUE;
}
@Override
public Result queryPluginPage(int pageIndex, int pageSize) {
IPage<AlertPluginInstance> pluginInstanceIPage = new Page<>(pageIndex, pageSize);
pluginInstanceIPage = alertPluginInstanceMapper.selectPage(pluginInstanceIPage, null);
PageInfo<AlertPluginInstanceVO> pageInfo = new PageInfo<>(pageIndex, pageSize);
pageInfo.setTotal((int) pluginInstanceIPage.getTotal());
pageInfo.setTotalList(buildPluginInstanceVOList(pluginInstanceIPage.getRecords()));
Result result = new Result();
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
private List<AlertPluginInstanceVO> buildPluginInstanceVOList(List<AlertPluginInstance> alertPluginInstances) {
if (CollectionUtils.isEmpty(alertPluginInstances)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | return null;
}
List<PluginDefine> pluginDefineList = pluginDefineMapper.queryAllPluginDefineList();
if (CollectionUtils.isEmpty(pluginDefineList)) {
return null;
}
Map<Integer, PluginDefine> pluginDefineMap = pluginDefineList.stream().collect(Collectors.toMap(PluginDefine::getId, Function.identity()));
List<AlertPluginInstanceVO> alertPluginInstanceVOS = new ArrayList<>();
alertPluginInstances.forEach(alertPluginInstance -> {
AlertPluginInstanceVO alertPluginInstanceVO = new AlertPluginInstanceVO();
alertPluginInstanceVO.setCreateTime(alertPluginInstance.getCreateTime());
alertPluginInstanceVO.setUpdateTime(alertPluginInstance.getUpdateTime());
alertPluginInstanceVO.setPluginDefineId(alertPluginInstance.getPluginDefineId());
alertPluginInstanceVO.setInstanceName(alertPluginInstance.getInstanceName());
alertPluginInstanceVO.setId(alertPluginInstance.getId());
PluginDefine pluginDefine = pluginDefineMap.get(alertPluginInstance.getPluginDefineId());
if (null == pluginDefine) {
return;
}
alertPluginInstanceVO.setAlertPluginName(pluginDefine.getPluginName());
String pluginParamsMapString = alertPluginInstance.getPluginInstanceParams();
String uiPluginParams = parseToPluginUiParams(pluginParamsMapString, pluginDefine.getPluginParams());
alertPluginInstanceVO.setPluginInstanceParams(uiPluginParams);
alertPluginInstanceVOS.add(alertPluginInstanceVO);
});
return alertPluginInstanceVOS;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java | * Get the parameters actually needed by the plugin
*
* @param pluginParams Complete parameters(include ui)
* @return k, v(json string)
*/
private String parsePluginParamsMap(String pluginParams) {
Map<String, String> paramsMap = PluginParamsTransfer.getPluginParamsMap(pluginParams);
return JSONUtils.toJsonString(paramsMap);
}
/**
* parse To Plugin Ui Params
*
* @param pluginParamsMapString k-v data
* @param pluginUiParams Complete parameters(include ui)
* @return Complete parameters list(include ui)
*/
private String parseToPluginUiParams(String pluginParamsMapString, String pluginUiParams) {
List<Map<String, Object>> pluginParamsList = PluginParamsTransfer.generatePluginParams(pluginParamsMapString, pluginUiParams);
return JSONUtils.toJsonString(pluginParamsList);
}
private boolean checkHasAssociatedAlertGroup(String id) {
List<String> idsList = alertGroupMapper.queryInstanceIdsList();
if (CollectionUtils.isEmpty(idsList)) {
return false;
}
Optional<String> first = idsList.stream().filter(k -> null != k && Arrays.asList(k.split(",")).contains(id)).findFirst();
return first.isPresent();
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/AlertPluginInstanceMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AlertPluginInstanceMapper extends BaseMapper<AlertPluginInstance> { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/AlertPluginInstanceMapper.java | /**
* query all alert plugin instance
*
* @return AlertPluginInstance list
*/
List<AlertPluginInstance> queryAllAlertPluginInstanceList();
/**
* query by alert group id
*
* @param ids
* @return AlertPluginInstance list
*/
List<AlertPluginInstance> queryByIds(@Param("ids") List<Integer> ids);
List<AlertPluginInstance> queryByInstanceName(@Param("instanceName")String instanceName);
/**
*
* @param instanceName instanceName
* @return if exist return true else return null
*/
Boolean existInstanceName(@Param("instanceName") String instanceName);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/AlertPluginInstanceMapperTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.dao.BaseDaoTest;
import org.apache.dolphinscheduler.dao.entity.AlertGroup;
import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance;
import org.apache.dolphinscheduler.dao.entity.PluginDefine;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* AlertPluginInstanceMapper mapper test
*/
public class AlertPluginInstanceMapperTest extends BaseDaoTest { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/AlertPluginInstanceMapperTest.java | @Autowired
private AlertPluginInstanceMapper alertPluginInstanceMapper;
@Autowired
private PluginDefineMapper pluginDefineMapper;
@Autowired |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/AlertPluginInstanceMapperTest.java | private AlertGroupMapper alertGroupMapper;
@Test
public void testQueryAllAlertPluginInstanceList() {
createAlertPluginInstance();
List<AlertPluginInstance> alertPluginInstanceList = alertPluginInstanceMapper.queryAllAlertPluginInstanceList();
Assert.assertTrue(alertPluginInstanceList.size() > 0);
}
@Test
public void testQueryByAlertGroupId() {
createAlertPluginInstance();
List<AlertGroup> testAlertGroupList = alertGroupMapper.queryByGroupName("test_group_01");
Assert.assertNotNull(testAlertGroupList);
Assert.assertTrue(testAlertGroupList.size() > 0);
AlertGroup alertGroup = testAlertGroupList.get(0);
}
@Test
public void testExistInstanceName() {
String instanceName = "test_instance";
Assert.assertNull(alertPluginInstanceMapper.existInstanceName(instanceName));
createAlertPluginInstance();
Assert.assertTrue(alertPluginInstanceMapper.existInstanceName(instanceName));
}
/**
* insert
*
* @return AlertPluginInstance
*/
private AlertPluginInstance createAlertPluginInstance() {
PluginDefine pluginDefine = createPluginDefine();
AlertGroup alertGroup = createAlertGroup("test_group_01"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,209 | [Bug] [api-service] Filter Security: warning-instance failed | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When I filter `warning-instance` object, I found the result is not expect, and the result not filter

### What you expected to happen
Filter base on I enter
### How to reproduce
Go to `http://<IP>:<PORT>/dolphinscheduler/ui/#/security/warning-instance` and see whether it could filter or not.
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7209 | https://github.com/apache/dolphinscheduler/pull/7210 | e4955934fd7223caf5ec9b0a7d6173a190ef1958 | 04805818c21c14e2fa147ed5018e7f6045642ff8 | "2021-12-06T07:41:09Z" | java | "2021-12-14T04:08:22Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/AlertPluginInstanceMapperTest.java | AlertPluginInstance alertPluginInstance = new AlertPluginInstance(pluginDefine.getId(), "", "test_instance");
alertPluginInstanceMapper.insert(alertPluginInstance);
return alertPluginInstance;
}
/**
* insert
*
* @return PluginDefine
*/
private PluginDefine createPluginDefine() {
PluginDefine pluginDefine = new PluginDefine("test plugin", "alert", "");
pluginDefineMapper.insert(pluginDefine);
return pluginDefine;
}
/**
* insert
*
* @return AlertGroup
*/
private AlertGroup createAlertGroup(String groupName) {
AlertGroup alertGroup = new AlertGroup();
alertGroup.setGroupName(groupName);
alertGroup.setDescription("alert group 1");
alertGroup.setCreateTime(DateUtils.getCurrentDate());
alertGroup.setUpdateTime(DateUtils.getCurrentDate());
alertGroupMapper.insert(alertGroup);
return alertGroup;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ACCESSTOKEN_BY_USER_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.CREATE_ACCESS_TOKEN_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_ACCESS_TOKEN_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.GENERATE_TOKEN_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ACCESSTOKEN_LIST_PAGING_ERROR; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ACCESS_TOKEN_ERROR;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.AccessTokenService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
/**
* access token controller
*/
@Api(tags = "ACCESS_TOKEN_TAG") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | @RestController
@RequestMapping("/access-tokens")
public class AccessTokenController extends BaseController {
@Autowired
private AccessTokenService accessTokenService;
/**
* create token
*
* @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()
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_ACCESS_TOKEN_ERROR) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "userId") int userId,
@RequestParam(value = "expireTime") String expireTime,
@RequestParam(value = "token") String token) {
Map<String, Object> result = accessTokenService.createToken(loginUser, userId, expireTime, token);
return returnDataList(result);
}
/**
* generate token string
*
* @param loginUser login user
* @param userId token for user
* @param expireTime expire time
* @return token string
*/
@ApiIgnore
@PostMapping(value = "/generate")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(GENERATE_TOKEN_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result generateToken(@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "userId") int userId,
@RequestParam(value = "expireTime") String expireTime) {
Map<String, Object> result = accessTokenService.generateToken(loginUser, userId, expireTime);
return returnDataList(result);
}
/**
* query access token list paging
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | * @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({
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
})
@GetMapping()
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_ACCESSTOKEN_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryAccessTokenList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("pageNo") Integer pageNo,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam("pageSize") Integer pageSize) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
searchVal = ParameterUtils.handleEscapes(searchVal);
result = accessTokenService.queryAccessTokenList(loginUser, searchVal, pageNo, pageSize);
return result;
}
/**
* query access token for specified user |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | *
* @param loginUser login user
* @param userId user id
* @return token list for specified user
*/
@ApiOperation(value = "queryAccessTokenByUser", notes = "QUERY_ACCESS_TOKEN_BY_USER_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", dataType = "Int")
})
@GetMapping(value = "/user/{userId}")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_ACCESSTOKEN_BY_USER_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryAccessTokenByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable("userId") Integer userId) {
Map<String, Object> result = this.accessTokenService.queryAccessTokenByUser(loginUser, userId);
return this.returnDataList(result);
}
/**
* delete access token by id
*
* @param loginUser login user
* @param id token id
* @return delete result code
*/
@ApiIgnore
@DeleteMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_ACCESS_TOKEN_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java | public Result delAccessTokenById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int id) {
Map<String, Object> result = accessTokenService.delAccessTokenById(loginUser, id);
return returnDataList(result);
}
/**
* update token
*
* @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
@PutMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(UPDATE_ACCESS_TOKEN_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int id,
@RequestParam(value = "userId") int userId,
@RequestParam(value = "expireTime") String expireTime,
@RequestParam(value = "token") String token) {
Map<String, Object> result = accessTokenService.updateToken(loginUser, id, userId, expireTime, token);
return returnDataList(result);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
/**
* access token service
*/
public interface AccessTokenService { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java | /**
* query access token list
*
* @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
*/
Result queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize);
/**
* query access token for specified user
*
* @param loginUser login user
* @param userId user id
* @return token list for specified user
*/
Map<String, Object> queryAccessTokenByUser(User loginUser, Integer userId);
/**
* create token
*
* @param userId token for user
* @param expireTime token expire time
* @param token token string
* @return create result code |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,401 | [Feature][dolphinscheduler-api] Built GenerateToken into the CreateToken API | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
If CreateToken does not explicitly specify a Token, then GenerateToken is built into the CreateToken interface, otherwise the current behavior remains unchanged, which is beneficial to reduce the count of network request interactions
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7401 | https://github.com/apache/dolphinscheduler/pull/7404 | 1f1edb2f23d5a93b2d80f5caf521ea43a81bc374 | 14343864bf5b840cc297365463300896dcb1ef96 | "2021-12-14T08:18:27Z" | java | "2021-12-14T09:54:35Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java | */
Map<String, Object> createToken(User loginUser, int userId, String expireTime, String token);
/**
* generate token
*
* @param userId token for user
* @param expireTime token expire time
* @return token string
*/
Map<String, Object> generateToken(User loginUser, int userId, String expireTime);
/**
* delete access token
*
* @param loginUser login user
* @param id token id
* @return delete result code
*/
Map<String, Object> delAccessTokenById(User loginUser, int id);
/**
* update token by id
*
* @param id token id
* @param userId token for user
* @param expireTime token expire time
* @param token token string
* @return update result code
*/
Map<String, Object> updateToken(User loginUser, int id, int userId, String expireTime, String token);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.