protected NextGroup getGroupForNextObjective(Integer nextId) { NextGroup next = flowObjectiveStore.getNextGroup(nextId); if (next != null) { List<Deque<GroupKey>> gkeys = appKryo.deserialize(next.data()); if (gkeys != null && !gkeys.isEmpty()) { return next; } else { log.warn("Empty next group found in FlowObjective store for " + "next-id:{} in dev:{}", nextId, deviceId); } } else { log.warn("next-id {} not found in Flow objective store for dev:{}", nextId, deviceId); } return null; }
private GroupKey getGroupForNextObjective(Integer nextId) { NextGroup next = flowObjectiveStore.getNextGroup(nextId); return appKryo.deserialize(next.data()); }
private boolean queueObjective(DeviceId deviceId, ForwardingObjective fwd) { if (fwd.nextId() != null && flowObjectiveStore.getNextGroup(fwd.nextId()) == null) { log.trace("Queuing forwarding objective for nextId {}", fwd.nextId()); if (pendingForwards.putIfAbsent(fwd.nextId(), Sets.newHashSet(new PendingNext(deviceId, fwd))) != null) { Set<PendingNext> pending = pendingForwards.get(fwd.nextId()); pending.add(new PendingNext(deviceId, fwd)); } return true; } return false; }
boolean queueNextObjective(DeviceId deviceId, NextObjective next) { // we need to hold off on other operations till we get notified that the // initial group creation has succeeded boolean queued = false; synchronized (pendingNexts) { // double check the flow objective store, because this block could run // after a notification arrives if (flowObjectiveStore.getNextGroup(next.id()) == null) { pendingNexts.compute(next.id(), (id, pending) -> { PendingFlowObjective pendfo = new PendingFlowObjective(deviceId, next); if (pending == null) { return Lists.newArrayList(pendfo); } else { pending.add(pendfo); return pending; } }); queued = true; } } if (queued) { log.debug("Queued next objective {} with operation {} meant for device {}", next.id(), next.op(), deviceId); } return queued; }
boolean queueFwdObjective(DeviceId deviceId, ForwardingObjective fwd) { boolean queued = false; synchronized (pendingForwards) { // double check the flow objective store, because this block could run // after a notification arrives if (flowObjectiveStore.getNextGroup(fwd.nextId()) == null) { pendingForwards.compute(fwd.nextId(), (id, pending) -> { PendingFlowObjective pendfo = new PendingFlowObjective(deviceId, fwd); if (pending == null) { return Sets.newLinkedHashSet(ImmutableSet.of(pendfo)); } else { pending.add(pendfo); return pending; } }); queued = true; } } if (queued) { log.debug("Queued forwarding objective {} for nextId {} meant for device {}", fwd.id(), fwd.nextId(), deviceId); } return queued; }
@Override public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) { checkPermission(FLOWRULE_WRITE); if (forwardingObjective.nextId() == null || flowObjectiveStore.getNextGroup(forwardingObjective.nextId()) != null || !queueFwdObjective(deviceId, forwardingObjective)) { // fast path executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective)); } }
@Override public void next(DeviceId deviceId, NextObjective nextObjective) { checkPermission(FLOWRULE_WRITE); if (nextObjective.op() == Operation.ADD || nextObjective.op() == Operation.VERIFY || flowObjectiveStore.getNextGroup(nextObjective.id()) != null || !queueNextObjective(deviceId, nextObjective)) { // either group exists or we are trying to create it - let it through executorService.execute(new ObjectiveInstaller(deviceId, nextObjective)); } }
@Override public void next(NextObjective nextObjective) { NextGroup nextGroup = flowObjectiveStore.getNextGroup(nextObjective.id()); switch (nextObjective.op()) { case ADD:
@Override public void next(NextObjective nextObjective) { NextGroup nextGroup = flowObjectiveStore.getNextGroup(nextObjective.id()); switch (nextObjective.op()) { case ADD:
private void removeBucketFromGroup(NextObjective nextObjective) { log.debug("removeBucketFromGroup in {}: for next objective id {}", deviceId, nextObjective.id()); NextGroup nextGroup = flowObjectiveStore.getNextGroup(nextObjective.id()); if (nextGroup != null) { Collection<TrafficTreatment> treatments = nextObjective.next();
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); if (next == null) { log.error("next-id {} does not exist in store", fwd.nextId());
TrafficTreatment tt = null; if (fwd.nextId() != null) { NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); if (next == null) { log.error("next-id {} does not exist in store", fwd.nextId());
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); if (next == null) { log.error("next-id {} does not exist in store", fwd.nextId());
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); if (next != null) { SpringOpenGroup soGroup = appKryo.deserialize(next.data());
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId());
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); GroupKey key = appKryo.deserialize(next.data()); Group group = groupService.getGroup(deviceId, key);
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); if (next != null) { SpringOpenGroup soGrp = appKryo.deserialize(next.data());
NextGroup next = flowObjectiveStore.getNextGroup(fwd.nextId()); if (next != null) { SpringOpenGroup soGroup = appKryo.deserialize(next.data());