Commit 1601b34d9e09f70c63080c83e779d7bb47a9c519

Authored by 潘钊
1 parent 28711e45

update...

src/main/java/com/bsth/data/gpsdata/GpsRealData.java
@@ -17,6 +17,7 @@ import org.springframework.boot.CommandLineRunner; @@ -17,6 +17,7 @@ import org.springframework.boot.CommandLineRunner;
17 import org.springframework.stereotype.Component; 17 import org.springframework.stereotype.Component;
18 18
19 import java.util.*; 19 import java.util.*;
  20 +import java.util.concurrent.ConcurrentHashMap;
20 import java.util.concurrent.TimeUnit; 21 import java.util.concurrent.TimeUnit;
21 22
22 /** 23 /**
@@ -30,7 +31,7 @@ public class GpsRealData implements CommandLineRunner { @@ -30,7 +31,7 @@ public class GpsRealData implements CommandLineRunner {
30 31
31 static Logger logger = LoggerFactory.getLogger(GpsRealData.class); 32 static Logger logger = LoggerFactory.getLogger(GpsRealData.class);
32 33
33 - private static Map<String, GpsEntity> gpsMap; 34 + private static ConcurrentHashMap<String, GpsEntity> gpsMap;
34 35
35 //按线路分组设备号 36 //按线路分组设备号
36 private static TreeMultimap<String, String> lineCode2Devices; 37 private static TreeMultimap<String, String> lineCode2Devices;
@@ -51,7 +52,7 @@ public class GpsRealData implements CommandLineRunner { @@ -51,7 +52,7 @@ public class GpsRealData implements CommandLineRunner {
51 * 构造函数 52 * 构造函数
52 */ 53 */
53 public GpsRealData() { 54 public GpsRealData() {
54 - gpsMap = new HashMap<>(); 55 + gpsMap = new ConcurrentHashMap<>();
55 lineCode2Devices = TreeMultimap.create(); 56 lineCode2Devices = TreeMultimap.create();
56 } 57 }
57 58