volume停用后导致df命令出错,停用的volume查询不出,volume路径查询出错问题

web_backend_develope
chenlw 9 years ago
parent 94a18d8258
commit bf7d7598b7

@ -23,7 +23,7 @@ public class DataInfoEntity {
private String collectorName; // 采集人姓名
private String year; // 数据年度
/** 是否抽取 */
/** 是否抽取 0标示为未汇总1标示汇总中2标示汇总完成 */
private int extractStatus;
/** 数据年度起始 */
private String startYear;

@ -177,7 +177,12 @@ public class VolumeInfo {
log.error("1801 " + volumeName + " is not exists!");
return -1L;
}
Pattern pattern2 = Pattern.compile("^\\d+$");
Matcher matcher2 = pattern2.matcher(reStrings.get(0));
// 如果是数字
if (matcher2.find()) {
allSize = Long.parseLong(reStrings.get(0));
}
return allSize;
}
@ -208,7 +213,12 @@ public class VolumeInfo {
log.error("1902 " + volumeName + " is not exists!");
return -1L;
}
Pattern pattern2 = Pattern.compile("^\\d+$");
Matcher matcher2 = pattern2.matcher(reStrings.get(0));
// 如果是数字
if (matcher2.find()) {
usedSize = Long.parseLong(reStrings.get(0));
}
return usedSize;
}

@ -84,8 +84,13 @@ public class ThreadVolume extends Thread {
List<String> path = volumeInfo
.getVolumeMountPoint(volumeName);
// 默认加载第一个路径
if (null != path && path.size() > 0) {
volume.setPath(path.get(0));
for (String one : path) {
if (!one.contains("df")) {
volume.setPath(one);
}
}
if (null == volume.getPath()) {
volume.setPath("");
}
volume.setAllSize(volumeInfo
.getVolumeAvailableSize(volumeName)
@ -146,7 +151,7 @@ public class ThreadVolume extends Thread {
}
}
}
// TODO 更新folder 目录
// 更新folder 目录
CacheTreeData.setFolders(folderlist);
CacheTreeData.setVolumeList(volumeList);
}

Loading…
Cancel
Save