Commit e16ebe33 authored by Elf's avatar Elf

测试发送问题

parent d8be2e7c
...@@ -91,6 +91,9 @@ public class FileService{ ...@@ -91,6 +91,9 @@ public class FileService{
for (int i = 0; i < wxName_list.length; i++){ for (int i = 0; i < wxName_list.length; i++){
ipList = getIpList(clusterId,wxName_list[i]);//通过卫星名字获取卫星ip ipList = getIpList(clusterId,wxName_list[i]);//通过卫星名字获取卫星ip
} }
//查看ip
System.out.println(ipList.length);
System.out.println(Arrays.toString(ipList));
int sliceNum = ipList.length; int sliceNum = ipList.length;
...@@ -103,10 +106,14 @@ public class FileService{ ...@@ -103,10 +106,14 @@ public class FileService{
while(true){ while(true){
try { try {
sendFileSlice(ipList[ipIndex], slice); sendFileSlice(ipList[ipIndex], slice);
//
System.out.println("send "+ipList[ipIndex]+"sucess");
ipIndex = (ipIndex + 1) % ipList.length; ipIndex = (ipIndex + 1) % ipList.length;
break; break;
}catch (Exception e){ }catch (Exception e){
ipIndex = (ipIndex + 1) % ipList.length; ipIndex = (ipIndex + 1) % ipList.length;
//
System.out.println("send "+ipList[ipIndex]+"failed");
} }
} }
} }
......
package top.ninwoo.dbc.server.serviceimpl; package top.ninwoo.dbc.server.serviceimpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import top.ninwoo.dbc.api.po.ComputingResult; import top.ninwoo.dbc.api.po.ComputingResult;
import top.ninwoo.dbc.api.po.FileSlice; import top.ninwoo.dbc.api.po.FileSlice;
...@@ -13,6 +14,9 @@ import java.io.IOException; ...@@ -13,6 +14,9 @@ import java.io.IOException;
@Service @Service
public class FileServiceImpl implements FileService { public class FileServiceImpl implements FileService {
@Value("${dbc.directory.output}")
private String directoryOutput;
//分散计算 //分散计算
@Override @Override
public String fileComputing(FileSlice fileSlice) throws IOException { public String fileComputing(FileSlice fileSlice) throws IOException {
...@@ -55,7 +59,7 @@ public class FileServiceImpl implements FileService { ...@@ -55,7 +59,7 @@ public class FileServiceImpl implements FileService {
} }
} }
//这里需提供新的文件输出 //这里需提供新的文件输出
ImageIO.write(grayImage, "jpg", new File("\\tmp\\statics\\out.jpg")); ImageIO.write(grayImage, "jpg", new File(directoryOutput+"out"));
System.out.println("download sucess"); System.out.println("download sucess");
return true; return true;
} }
......
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