Commit 1601b34d9e09f70c63080c83e779d7bb47a9c519
1 parent
28711e45
update...
Showing
1 changed file
with
3 additions
and
2 deletions
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -17,6 +17,7 @@ import org.springframework.boot.CommandLineRunner; |
| 17 | 17 | import org.springframework.stereotype.Component; |
| 18 | 18 | |
| 19 | 19 | import java.util.*; |
| 20 | +import java.util.concurrent.ConcurrentHashMap; | |
| 20 | 21 | import java.util.concurrent.TimeUnit; |
| 21 | 22 | |
| 22 | 23 | /** |
| ... | ... | @@ -30,7 +31,7 @@ public class GpsRealData implements CommandLineRunner { |
| 30 | 31 | |
| 31 | 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 | 37 | private static TreeMultimap<String, String> lineCode2Devices; |
| ... | ... | @@ -51,7 +52,7 @@ public class GpsRealData implements CommandLineRunner { |
| 51 | 52 | * 构造函数 |
| 52 | 53 | */ |
| 53 | 54 | public GpsRealData() { |
| 54 | - gpsMap = new HashMap<>(); | |
| 55 | + gpsMap = new ConcurrentHashMap<>(); | |
| 55 | 56 | lineCode2Devices = TreeMultimap.create(); |
| 56 | 57 | } |
| 57 | 58 | ... | ... |