| | |
| | | public static void printPriorityQueue() { |
| | | for (String cameraId : GuidePriorityQueue.cameraQueueMap.keySet()) { |
| | | PriorityBlockingQueue<GuideTask> priorityQueue = GuidePriorityQueue.cameraQueueMap.get(cameraId); |
| | | // for (GuideTask task : priorityQueue) { |
| | | // |
| | | // log.info("【alarmId】" + task.getAlarmId() + "【receiveTime】" + task.getReceiveTime() |
| | | // + "【priority】" + task.getPriority() + "【num】" + task.getNum() |
| | | // + "【chan】" + task.getChanNum() + "【recordSn】" + task.getRecordSn() + "【cameraId】" + task.getCameraId()); |
| | | // } |
| | | while (priorityQueue.size() > 0) { |
| | | GuideTask task = priorityQueue.poll(); |
| | | PriorityQueue<GuideTask> queue= new PriorityQueue<>(priorityQueue); |
| | | while (queue.size() > 0) { |
| | | GuideTask task = queue.poll(); |
| | | log.info("【alarmId】" + task.getAlarmId() + "【receiveTime】" + task.getReceiveTime() |
| | | + "【priority】" + task.getPriority() + "【num】" + task.getNum() |
| | | + "【chan】" + task.getChanNum() + "【recordSn】" + task.getRecordSn() + "【cameraId】" + task.getCameraId());; |
| | | + "【chan】" + task.getChanNum() + "【recordSn】" + task.getRecordSn() + "【cameraId】" + task.getCameraId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | priorityQueue.add(new obj(1, 4, 33)); |
| | | priorityQueue.add(new obj(1, 4, 44)); |
| | | priorityQueue.add(new obj(1, 4, 51)); |
| | | |
| | | while (priorityQueue.size() > 0) { |
| | | obj task = priorityQueue.poll(); |
| | | PriorityQueue<obj> queue= new PriorityQueue<>(priorityQueue); |
| | | while (queue.size() > 0) { |
| | | obj task = queue.poll(); |
| | | log.info("【num1】" + task.getNUM1() + "【num2】" + task.getNUM2() + "【num3】" + task.getNUM3()); |
| | | } |
| | | log.info("======================================================================="); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Data |