Commit 48d55e8da7b964722427028cfd2e56541cd8c376
1 parent
4a05a1ac
update...
Showing
2 changed files
with
12 additions
and
8 deletions
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
| @@ -41,7 +41,7 @@ public class GpsRealAnalyse { | @@ -41,7 +41,7 @@ public class GpsRealAnalyse { | ||
| 41 | @Autowired | 41 | @Autowired |
| 42 | GpsRealData gpsRealData; | 42 | GpsRealData gpsRealData; |
| 43 | 43 | ||
| 44 | - final static int POOL_SIZE = 15; | 44 | + final static int POOL_SIZE = 25; |
| 45 | static ExecutorService threadPool = Executors.newFixedThreadPool(POOL_SIZE + 1); | 45 | static ExecutorService threadPool = Executors.newFixedThreadPool(POOL_SIZE + 1); |
| 46 | 46 | ||
| 47 | public static long st; | 47 | public static long st; |
| @@ -68,7 +68,7 @@ public class GpsRealAnalyse { | @@ -68,7 +68,7 @@ public class GpsRealAnalyse { | ||
| 68 | } | 68 | } |
| 69 | List<String> deviceList = new ArrayList<>(multimap.keySet()); | 69 | List<String> deviceList = new ArrayList<>(multimap.keySet()); |
| 70 | 70 | ||
| 71 | - //数据均分给20个线程 | 71 | + //数据均分给线程 |
| 72 | ArrayListMultimap dataListMap = ArrayListMultimap.create(); | 72 | ArrayListMultimap dataListMap = ArrayListMultimap.create(); |
| 73 | int size = deviceList.size(), threadIndex=0, threadSize = size / POOL_SIZE; | 73 | int size = deviceList.size(), threadIndex=0, threadSize = size / POOL_SIZE; |
| 74 | for(int i = 0; i < size; i++){ | 74 | for(int i = 0; i < size; i++){ |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -70,14 +70,18 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -70,14 +70,18 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 70 | return false; | 70 | return false; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | - if(isNotEmpty(prevs)){ | ||
| 74 | - GpsEntity prev = prevs.getTail(); | ||
| 75 | - if(isOutStation(gps, prev)) | ||
| 76 | - outStation(gps, prev); | 73 | + try{ |
| 74 | + if(isNotEmpty(prevs)){ | ||
| 75 | + GpsEntity prev = prevs.getTail(); | ||
| 76 | + if(isOutStation(gps, prev)) | ||
| 77 | + outStation(gps, prev); | ||
| 77 | 78 | ||
| 78 | 79 | ||
| 79 | - if(isInStation(gps, prev)) | ||
| 80 | - inStation(gps, prev); | 80 | + if(isInStation(gps, prev)) |
| 81 | + inStation(gps, prev); | ||
| 82 | + } | ||
| 83 | + }catch (Exception e){ | ||
| 84 | + logger.error("in out error info ..", e); | ||
| 81 | } | 85 | } |
| 82 | 86 | ||
| 83 | return true; | 87 | return true; |