From 39171057dda5da9cc45d17617dd9949632e8212b Mon Sep 17 00:00:00 2001 From: chenlw <874313221@qq.com> Date: Tue, 13 Dec 2016 17:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/platform/http/gfs/RemoveData.java | 29 ++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/com/platform/http/gfs/RemoveData.java b/src/com/platform/http/gfs/RemoveData.java index 0633a544..64217929 100644 --- a/src/com/platform/http/gfs/RemoveData.java +++ b/src/com/platform/http/gfs/RemoveData.java @@ -62,18 +62,25 @@ public class RemoveData { Map map = new HashMap(); map.put("sourcePath", sourceFolderName); map.put("destPath", destFolderName); - //请求web - String rest = ht.sendPost("data/abortCopyData", map); - if (null == rest || "".equals(rest)) { - log.error(" --- gluster is disconnect ! \n"); - return 0; + String rest =""; + try { + //请求web + rest = ht.sendPost("data/abortCopyData", map); + if (null == rest || "".equals(rest)) { + log.error(" --- gluster is disconnect ! \n"); + return 0; + } + Gson gs = new Gson(); + PostData data = gs.fromJson(rest, PostData.class); + // 1 : 成功 + double copyResult = (double) data.getData(); + reslut = (int) copyResult; + getExcept(data); + } catch (Exception e) { + log.error(rest); + log.error(e); + throw new CustomException("请求gfs服务异常 -- data/removeData ", e, rest); } - Gson gs = new Gson(); - PostData data = gs.fromJson(rest, PostData.class); - // 1 : 成功 - double copyResult = (double) data.getData(); - reslut = (int) copyResult; - getExcept(data); return reslut; }