浏览代码

修复缓存清空引起bug的修复。

Jay Lee 6 年之前
父节点
当前提交
2a562f16c1

+ 1 - 1
collect/src/main/java/com/saga/thread/common/CheckThread.java

@@ -440,7 +440,7 @@ public class CheckThread extends Thread {
 				String status = "";
 
 				if (pointUp.getValue() != null) {
-					if (this.realCheck - pointUp.getValue() < Constant.Millisecond.MINUTE_10) {
+					if (this.realCheck - pointUp.getValue() < Constant.Millisecond.MINUTE_15) {
 						status = "conn";
 					} else {
 						status = "disconn";

+ 20 - 0
collect/src/main/java/com/saga/thread/common/LoadConfigThread.java

@@ -2,6 +2,8 @@ package com.saga.thread.common;
 
 import java.io.FileReader;
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map.Entry;
 
 import org.zillion.util.log.LogUtil;
@@ -54,6 +56,24 @@ public class LoadConfigThread extends Thread {
 
 	private void loadPointList2() {
 		// TODO Auto-generated method stub
+		LogUtil.info("Clear Project Point List"  + " Begin...");
+		synchronized (Constant.ps_PhysicalList) {
+			Constant.ps_PhysicalList = null;
+			Constant.ps_PhysicalList = new HashMap<String, List<String>>();
+			// Constant.ps_PhysicalList.clear();
+		}
+		synchronized (Constant.ps_ProjectList) {
+			Constant.ps_ProjectList = null;
+			Constant.ps_ProjectList = new HashMap<String, List<String>>();
+			// Constant.ps_ProjectList.clear();
+		}
+		synchronized (Constant.ps_MeterList) {
+			Constant.ps_MeterList = null;
+			Constant.ps_MeterList = new HashMap<String, List<String>>();
+			// Constant.ps_MeterList.clear();
+		}
+		LogUtil.info("Clear Project Point List"  + " End...");
+
 		for (Entry<String, String> bd : Constant.BuildingDB.entrySet()) {
 			try {
 				String project = bd.getKey();

+ 1 - 11
collect/src/main/java/com/saga/util/HBaseUtil.java

@@ -40,17 +40,7 @@ public class HBaseUtil {
 		wrapperObject.put("Database", db);
 		wrapperObject.put("Datatable", tb);
 		wrapperObject.put("Criteria", Criteria);
-		LogUtil.info("Clear Project Point List:" + project + " Begin...");
-		synchronized (Constant.ps_PhysicalList) {
-			Constant.ps_PhysicalList = new HashMap<String, List<String>>();
-		}
-		synchronized (Constant.ps_ProjectList) {
-			Constant.ps_ProjectList = new HashMap<String, List<String>>();
-		}
-		synchronized (Constant.ps_MeterList) {
-			Constant.ps_MeterList = new HashMap<String, List<String>>();
-		}
-		LogUtil.info("Clear Project Point List:" + project + " End...");
+
 		LogUtil.info("Reload Project Point List:" + project + "  dy_pointlist Begin...");
 		JSONObject queryResult = agent.Query(wrapperObject);
 		JSONArray resultContent = (JSONArray) queryResult.get("Content");