Commit 90347d63 by huangfusuper

解决虚节点不支持多实例无法运行的BUG

parent b0d15d2a
package com.byit;
import com.byit.filesystem.FastDfsFileSystem;
import com.github.tobato.fastdfs.service.FastFileStorageClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.ByteArrayInputStream;
import java.util.HashMap;
@SpringBootTest(classes = AdminApplication.class)
@RunWith(SpringRunner.class)
public class FastDfsFileSystemTest {
@Autowired
private FastFileStorageClient fastFileStorageClient;
@Test
public void test(){
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("filename","hahah");
byte[] bytes = "nihao".getBytes();
ByteArrayInputStream byteInput = new ByteArrayInputStream(bytes);
System.out.println(fastFileStorageClient.uploadFile(byteInput,bytes.length, ".txt",null).getFullPath());
}
}
...@@ -86,8 +86,13 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask ...@@ -86,8 +86,13 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
String hasManyInstance = flowExtendedConfiguration.getHasManyInstance(); String hasManyInstance = flowExtendedConfiguration.getHasManyInstance();
//如果虚节点设置为不支持多实例 //如果虚节点设置为不支持多实例
if (FlowPropertyEnum.NOT_MANY_INSTANCE.getCode().equals(hasManyInstance)) { if (FlowPropertyEnum.NOT_MANY_INSTANCE.getCode().equals(hasManyInstance)) {
log.info("不支持多实例{}",virFlow); log.info("不支持多实例{},查询对应的工作流是否处于运行中的状态",virFlow);
return; //查找是否有工作流正在运行中 true有 false没有
boolean runRecordingIsRunning = runRecordingService.findRunRecordingIsRunning(virFlow.getFlowId());
if(runRecordingIsRunning){
return;
}
} }
virFlow.setScanMark("2"); virFlow.setScanMark("2");
......
...@@ -4,6 +4,7 @@ import com.github.tobato.fastdfs.FdfsClientConfig; ...@@ -4,6 +4,7 @@ import com.github.tobato.fastdfs.FdfsClientConfig;
import com.github.tobato.fastdfs.domain.MateData; import com.github.tobato.fastdfs.domain.MateData;
import com.github.tobato.fastdfs.domain.StorePath; import com.github.tobato.fastdfs.domain.StorePath;
import com.github.tobato.fastdfs.proto.storage.DownloadByteArray; import com.github.tobato.fastdfs.proto.storage.DownloadByteArray;
import com.github.tobato.fastdfs.service.DefaultFastFileStorageClient;
import com.github.tobato.fastdfs.service.FastFileStorageClient; import com.github.tobato.fastdfs.service.FastFileStorageClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
...@@ -77,6 +78,8 @@ public class FastDfsFileSystem implements FileSystem { ...@@ -77,6 +78,8 @@ public class FastDfsFileSystem implements FileSystem {
} }
public static void main(String[] args) { public static void main(String[] args) {
FastFileStorageClient fastFileStorageClient = new DefaultFastFileStorageClient();
System.out.println(getPath("ddmp/M00/00/09/CgB4Al6mSVSAHi-rAAAABhCiqmE437.log")); System.out.println(getPath("ddmp/M00/00/09/CgB4Al6mSVSAHi-rAAAABhCiqmE437.log"));
} }
} }
...@@ -439,11 +439,7 @@ public class JobUtils { ...@@ -439,11 +439,7 @@ public class JobUtils {
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
public static void main(String[] args) {
JobUtils.setTOKEN("huangfu");
JobUtils.setRequestUrl("http://10.0.120.208:8998/myth-job-admin");
System.out.println(stopFlow("皇甫", "科星"));
}
/** /**
* 删除工作流 * 删除工作流
...@@ -690,6 +686,12 @@ public class JobUtils { ...@@ -690,6 +686,12 @@ public class JobUtils {
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
public static void main(String[] args) {
JobUtils.setTOKEN("huangfu");
JobUtils.setRequestUrl("http://10.0.120.208:8998/myth-job-admin");
System.out.println(existWorkspace("test_0827_prod0000"));
}
/** /**
* 立即运行节点 * 立即运行节点
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment