Commit 7c74f45f89d700f87c68f0d2a4539bf5c1ad72a0
1 parent
b6e8dcfc
update...
Showing
1 changed file
with
5 additions
and
3 deletions
src/main/java/com/bsth/data/gpsdata_v2/cache/GpsCacheData.java
| @@ -9,6 +9,8 @@ import org.slf4j.Logger; | @@ -9,6 +9,8 @@ import org.slf4j.Logger; | ||
| 9 | import org.slf4j.LoggerFactory; | 9 | import org.slf4j.LoggerFactory; |
| 10 | 10 | ||
| 11 | import java.util.*; | 11 | import java.util.*; |
| 12 | +import java.util.concurrent.ConcurrentHashMap; | ||
| 13 | +import java.util.concurrent.ConcurrentMap; | ||
| 12 | 14 | ||
| 13 | /** | 15 | /** |
| 14 | * gps 数据缓存 | 16 | * gps 数据缓存 |
| @@ -17,10 +19,10 @@ import java.util.*; | @@ -17,10 +19,10 @@ import java.util.*; | ||
| 17 | public class GpsCacheData { | 19 | public class GpsCacheData { |
| 18 | 20 | ||
| 19 | /** | 21 | /** |
| 20 | - * 每辆车缓存最后300条gps | 22 | + * 每辆车缓存最后200条gps |
| 21 | */ | 23 | */ |
| 22 | - private static final int CACHE_SIZE = 300; | ||
| 23 | - private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>(); | 24 | + private static final int CACHE_SIZE = 200; |
| 25 | + private static ConcurrentMap<String, CircleQueue<GpsEntity>> gpsCacheMap = new ConcurrentHashMap<>(); | ||
| 24 | 26 | ||
| 25 | /** | 27 | /** |
| 26 | * 车辆执行班次的详细 进出站数据 | 28 | * 车辆执行班次的详细 进出站数据 |