use of com.creditease.uav.feature.runtimenotify.task.JudgeNotifyTask in project uavstack by uavorg.
the class RuntimeNotifyCatcher method pushToSliceQueue.
private void pushToSliceQueue(MonitorDataFrame mdf, boolean needConcurrent) {
long now = System.currentTimeMillis();
if (now - mdf.getTimeFlag() > DROP_TIMEOUT) {
if (log.isDebugEnable()) {
log.debug(this, "MDF too late, drop it: " + mdf.toJSONString());
}
return;
}
// step 1: store slices
List<Slice> slices = extractSlice(mdf);
RuntimeNotifySliceMgr rnsm = (RuntimeNotifySliceMgr) ConfigurationManager.getInstance().getComponent(this.feature, "RuntimeNotifySliceMgr");
rnsm.storeSlices(slices, mdf.getTag());
if (log.isDebugEnable()) {
log.debug(this, "Prepare Slices for Judge: count= " + slices.size());
}
// step 2: notification judge
if (needConcurrent == false) {
// one thread judge
for (Slice slice : slices) {
new JudgeNotifyTask(JudgeNotifyTask.class.getSimpleName(), "runtimenotify", slice).run();
}
} else {
// 1+N Queue Judge
I1NQueueWorker n1nqw = get1NQueueWorkerMgr().getQueueWorker(this.feature, RuntimeNotifyCatcher.QWORKER_NAME);
for (Slice slice : slices) {
n1nqw.put(new JudgeNotifyTask(JudgeNotifyTask.class.getSimpleName(), feature, slice));
}
}
}
Aggregations