From bf7d7598b77af52ce3c4b5106b167f2fd6b5653a Mon Sep 17 00:00:00 2001 From: chenlw <874313221@qq.com> Date: Thu, 29 Sep 2016 09:37:59 +0800 Subject: [PATCH] =?UTF-8?q?volume=E5=81=9C=E7=94=A8=E5=90=8E=E5=AF=BC?= =?UTF-8?q?=E8=87=B4df=E5=91=BD=E4=BB=A4=E5=87=BA=E9=94=99=EF=BC=8C?= =?UTF-8?q?=E5=81=9C=E7=94=A8=E7=9A=84volume=E6=9F=A5=E8=AF=A2=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=EF=BC=8Cvolume=E8=B7=AF=E5=BE=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=87=BA=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/platform/entities/DataInfoEntity.java | 2 +- src/com/platform/glusterfs/VolumeInfo.java | 14 ++++++++++++-- src/com/platform/utils/ThreadVolume.java | 11 ++++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/com/platform/entities/DataInfoEntity.java b/src/com/platform/entities/DataInfoEntity.java index 45a64a36..2c227aa6 100644 --- a/src/com/platform/entities/DataInfoEntity.java +++ b/src/com/platform/entities/DataInfoEntity.java @@ -23,7 +23,7 @@ public class DataInfoEntity { private String collectorName; // 采集人姓名 private String year; // 数据年度 - /** 是否抽取 */ + /** 是否抽取 ,0标示为未汇总,1标示汇总中,2标示汇总完成 */ private int extractStatus; /** 数据年度起始 */ private String startYear; diff --git a/src/com/platform/glusterfs/VolumeInfo.java b/src/com/platform/glusterfs/VolumeInfo.java index 34d2e2c8..f30d5d53 100644 --- a/src/com/platform/glusterfs/VolumeInfo.java +++ b/src/com/platform/glusterfs/VolumeInfo.java @@ -177,7 +177,12 @@ public class VolumeInfo { log.error("1801 " + volumeName + " is not exists!"); return -1L; } - allSize = Long.parseLong(reStrings.get(0)); + 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; } - usedSize = Long.parseLong(reStrings.get(0)); + Pattern pattern2 = Pattern.compile("^\\d+$"); + Matcher matcher2 = pattern2.matcher(reStrings.get(0)); + // 如果是数字 + if (matcher2.find()) { + usedSize = Long.parseLong(reStrings.get(0)); + } return usedSize; } diff --git a/src/com/platform/utils/ThreadVolume.java b/src/com/platform/utils/ThreadVolume.java index 38c33770..9023ad79 100644 --- a/src/com/platform/utils/ThreadVolume.java +++ b/src/com/platform/utils/ThreadVolume.java @@ -84,8 +84,13 @@ public class ThreadVolume extends Thread { List 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); }