Commit 85a23ac0bee0998505fba66587b7185d19449bc3
1 parent
be0beb26
1.GpsCacheData.java中缓存GPS数200->20,到达终点站后清除前面的到站数据缓存
Showing
1 changed file
with
3 additions
and
2 deletions
src/main/java/com/bsth/data/gpsdata_v2/cache/GpsCacheData.java
| ... | ... | @@ -20,9 +20,9 @@ import java.util.concurrent.CopyOnWriteArrayList; |
| 20 | 20 | public class GpsCacheData { |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * 每辆车缓存最后200条gps | |
| 23 | + * 每辆车缓存最后20条gps | |
| 24 | 24 | */ |
| 25 | - private static final int CACHE_SIZE = 200; | |
| 25 | + private static final int CACHE_SIZE = 20; | |
| 26 | 26 | private static ConcurrentMap<String, CircleQueue<GpsEntity>> gpsCacheMap = new ConcurrentHashMap<>(); |
| 27 | 27 | |
| 28 | 28 | /** |
| ... | ... | @@ -56,6 +56,7 @@ public class GpsCacheData { |
| 56 | 56 | trailListMultimap.put(nbbm, list); |
| 57 | 57 | } |
| 58 | 58 | trail = new GpsExecTrail(); |
| 59 | + list.clear(); | |
| 59 | 60 | list.add(trail); |
| 60 | 61 | } else{ |
| 61 | 62 | trail = list.get(list.size() - 1); | ... | ... |