|
|
@ -38,6 +38,8 @@ public class ThreadMoveData{
|
|
|
|
|
|
|
|
|
|
|
|
public final static Logger log = Logger.getLogger(ThreadMoveData.class);
|
|
|
|
public final static Logger log = Logger.getLogger(ThreadMoveData.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean iscontinue = false;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name = "dataInfoDao")
|
|
|
|
@Resource(name = "dataInfoDao")
|
|
|
|
private DataInfoDao dataInfoDao;
|
|
|
|
private DataInfoDao dataInfoDao;
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +73,10 @@ public class ThreadMoveData{
|
|
|
|
//迁移数据 -- 2016-11-30后 使用
|
|
|
|
//迁移数据 -- 2016-11-30后 使用
|
|
|
|
@Scheduled(fixedDelay = 4000)
|
|
|
|
@Scheduled(fixedDelay = 4000)
|
|
|
|
public void moveDataByWebGfs(){
|
|
|
|
public void moveDataByWebGfs(){
|
|
|
|
|
|
|
|
if (iscontinue) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
iscontinue = true;
|
|
|
|
List<DataInfoEntityMoveTmp> result = new ArrayList<DataInfoEntityMoveTmp>();
|
|
|
|
List<DataInfoEntityMoveTmp> result = new ArrayList<DataInfoEntityMoveTmp>();
|
|
|
|
Map<String, String> volumeMap = new HashMap<String, String>();
|
|
|
|
Map<String, String> volumeMap = new HashMap<String, String>();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -96,6 +102,7 @@ public class ThreadMoveData{
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.error(e);
|
|
|
|
log.error(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
iscontinue = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//5秒 //2016-11-30后 不使用
|
|
|
|
//5秒 //2016-11-30后 不使用
|
|
|
@ -370,8 +377,11 @@ public class ThreadMoveData{
|
|
|
|
//请求迁移
|
|
|
|
//请求迁移
|
|
|
|
curMoveNum++;
|
|
|
|
curMoveNum++;
|
|
|
|
//TODO 判断 moveE.getDataPath()的空间大小 和 makeDstPath(moveE.getDstPath())的大小
|
|
|
|
//TODO 判断 moveE.getDataPath()的空间大小 和 makeDstPath(moveE.getDstPath())的大小
|
|
|
|
|
|
|
|
//迁移
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if(1==copy.copyFolder(moveE.getDataPath(), makeDstPath(moveE.getDstPath()))){
|
|
|
|
int copyResult = copy.copyFolder(moveE.getDataPath(), makeDstPath(moveE.getDstPath()));
|
|
|
|
|
|
|
|
log.info("httpclient copyFolder result: "+copyResult);
|
|
|
|
|
|
|
|
if(1== copyResult){
|
|
|
|
moveE.setCompleteStatus("1");
|
|
|
|
moveE.setCompleteStatus("1");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|