@Override public void run() { Set<GroupKey> keys = pendingGroups.asMap().keySet().stream() .filter(key -> groupService.getGroup(deviceId, key) != null) .collect(Collectors.toSet()); keys.stream().forEach(key -> { NextObjective obj = pendingGroups.getIfPresent(key); if (obj == null) { return; } pass(obj); pendingGroups.invalidate(key); log.info("Heard back from group service for group {}. " + "Applying pending forwarding objectives", obj.id()); flowObjectiveStore.putNextGroup(obj.id(), new CentecV350Group(key)); }); } }
@Override public void run() { Set<GroupKey> keys = pendingGroups .asMap() .keySet() .stream() .filter(key -> groupService.getGroup(deviceId, key) != null) .collect(Collectors.toSet()); keys.stream() .forEach(key -> { NextObjective obj = pendingGroups .getIfPresent(key); if (obj == null) { return; } log.debug("Group verified: dev:{} gid:{} <<->> nextId:{}", deviceId, groupService.getGroup(deviceId, key).id(), obj.id()); pass(obj); pendingGroups.invalidate(key); flowObjectiveStore.putNextGroup( obj.id(), new SpringOpenGroup(key, null)); }); } }
@Override public void event(GroupEvent event) { if (event.type() == GroupEvent.Type.GROUP_ADDED) { GroupKey key = event.subject().appCookie(); NextObjective obj = pendingGroups.getIfPresent(key); if (obj != null) { flowObjectiveStore.putNextGroup(obj.id(), new OLTPipelineGroup(key)); pass(obj); pendingGroups.invalidate(key); } } } }
@Override public void event(GroupEvent event) { if (event.type() == GroupEvent.Type.GROUP_ADDED) { GroupKey key = event.subject().appCookie(); NextObjective obj = pendingGroups.getIfPresent(key); if (obj != null) { flowObjectiveStore.putNextGroup(obj.id(), new CentecV350Group(key)); pass(obj); pendingGroups.invalidate(key); } } } }
/** * Next Objectives are stored as dummy groups for retrieval later * when Forwarding Objectives reference the next objective id. At that point * the dummy group is fetched from the distributed store and the enclosed * treatment is applied as a flow rule action. * * @param nextObj the next objective of type simple */ private void processSimpleNextObjective(NextObjective nextObj) { // Simple next objective has a single treatment (not a collection) log.debug("Received nextObj {}", nextObj.id()); // delay processing to emulate group creation delay(50); TrafficTreatment treatment = nextObj.next().iterator().next(); flowObjectiveStore.putNextGroup(nextObj.id(), new DummyGroup(treatment)); }
@Override public void event(GroupEvent event) { if (event.type() == GroupEvent.Type.GROUP_ADDED) { log.trace("InnerGroupListener: Group ADDED " + "event received in device {}", deviceId); GroupKey key = event.subject().appCookie(); NextObjective obj = pendingGroups.getIfPresent(key); if (obj != null) { log.debug("Group verified: dev:{} gid:{} <<->> nextId:{}", deviceId, event.subject().id(), obj.id()); flowObjectiveStore .putNextGroup(obj.id(), new SpringOpenGroup(key, null)); pass(obj); pendingGroups.invalidate(key); } } else if (event.type() == GroupEvent.Type.GROUP_ADD_FAILED) { log.warn("InnerGroupListener: Group ADD " + "failed event received in device {}", deviceId); } } }
@Override public void next(NextObjective nextObjective) { pendingNext.put(nextObjective.id(), nextObjective); flowObjectiveStore.putNextGroup(nextObjective.id(), new SingleGroup(new DefaultGroupKey(appKryo.serialize(nextObjective.id())))); nextObjective.context().ifPresent(context -> context.onSuccess(nextObjective)); }
.givenGroupId())); Ofdpa2Pipeline.pass(nextGrp.nextObjective()); flowObjectiveStore.putNextGroup(nextGrp.nextObjective().id(), nextGrp);
List<Deque<GroupKey>> allOriginalKeys = Ofdpa2Pipeline.appKryo.deserialize(next.data()); allOriginalKeys.add(newBucketChain); flowObjectiveStore.putNextGroup(nextObjective.id(), new OfdpaNextGroup(allOriginalKeys, nextObjective));
"to {} flow-actions in device:{}", nextObjective.id(), treatment.allInstructions().size(), deviceId); flowObjectiveStore.putNextGroup(nextObjective.id(), new SpringOpenGroup(null, treatment)); deviceId); TrafficTreatment treatment = nextObjective.next().iterator().next(); flowObjectiveStore.putNextGroup(nextObjective.id(), new SpringOpenGroup(null, treatment)); } else {
flowObjectiveStore.putNextGroup(nextObjective.id(), new OfdpaNextGroup(allgkeys, nextObjective)); } else {
flowObjectiveStore.putNextGroup(nextObjective.id(), new PicaGroup(filteredTreatment.build())); break;