@Override public String toString() { return (Integer.toHexString(groupDescription.givenGroupId()) + " groupKey: " + groupDescription.appCookie() + " waiting-on-groups: " + waitOnGroups.get() + " addBucketToGroup: " + addBucketToGroup + " device: " + deviceId); } }
/** * Stores a new group entry using the information from group description. * * @param groupDesc group description to be used to create group entry */ @Override public void storeGroupDescription(GroupDescription groupDesc) { // Check if a group is existing with the same key if (getGroup(groupDesc.deviceId(), groupDesc.appCookie()) != null) { return; } if (deviceAuditStatus.get(groupDesc.deviceId()) == null) { // Device group audit has not completed yet // Add this group description to pending group key table // Create a group entry object with Dummy Group ID StoredGroupEntry group = new DefaultGroup(dummyGroupId, groupDesc); group.setState(GroupState.WAITING_AUDIT_COMPLETE); ConcurrentMap<GroupKey, StoredGroupEntry> pendingKeyTable = getPendingGroupKeyTable(groupDesc.deviceId()); pendingKeyTable.put(groupDesc.appCookie(), group); return; } storeGroupDescriptionInternal(groupDesc); }
private void storeGroupDescriptionInternal(GroupDescription groupDesc) { // Check if a group is existing with the same key if (getGroup(groupDesc.deviceId(), groupDesc.appCookie()) != null) { return; } GroupId id = null; if (groupDesc.givenGroupId() == null) { // Get a new group identifier id = new DefaultGroupId(getFreeGroupIdValue(groupDesc.deviceId())); } else { id = new DefaultGroupId(groupDesc.givenGroupId()); } // Create a group entry object StoredGroupEntry group = new DefaultGroup(id, groupDesc); // Insert the newly created group entry into concurrent key and id maps ConcurrentMap<GroupKey, StoredGroupEntry> keyTable = getGroupKeyTable(groupDesc.deviceId()); keyTable.put(groupDesc.appCookie(), group); ConcurrentMap<GroupId, StoredGroupEntry> idTable = getGroupIdTable(groupDesc.deviceId()); idTable.put(id, group); notifyDelegate(new GroupEvent(GroupEvent.Type.GROUP_ADD_REQUESTED, group)); }
/** * Creates a simple L2 Interface Group. * * @param nextObj the next Objective */ private void createL2InterfaceGroup(NextObjective nextObj) { VlanId assignedVlan = Ofdpa2Pipeline.readVlanFromSelector(nextObj.meta()); if (assignedVlan == null) { log.warn("VLAN ID required by simple next obj is missing. Abort."); Ofdpa2Pipeline.fail(nextObj, ObjectiveError.BADPARAMS); return; } List<GroupInfo> groupInfos = prepareL2InterfaceGroup(nextObj, assignedVlan); // There is only one L2 interface group in this case GroupDescription l2InterfaceGroupDesc = groupInfos.get(0).innerMostGroupDesc; // Put all dependency information into allGroupKeys List<Deque<GroupKey>> allGroupKeys = Lists.newArrayList(); Deque<GroupKey> gkeyChain = new ArrayDeque<>(); gkeyChain.addFirst(l2InterfaceGroupDesc.appCookie()); allGroupKeys.add(gkeyChain); // Point the next objective to this group OfdpaNextGroup ofdpaGrp = new OfdpaNextGroup(allGroupKeys, nextObj); updatePendingNextObjective(l2InterfaceGroupDesc.appCookie(), ofdpaGrp); // Start installing the inner-most group groupService.addGroup(l2InterfaceGroupDesc); }
(added) ? "ADDED" : "processed", key, deviceId, Integer.toHexString(gce.groupDescription.givenGroupId())); processGroupChain(gce);
groupInfo.nextGroupDesc : groupInfo.innerMostGroupDesc; TrafficTreatment.Builder ttb = DefaultTrafficTreatment.builder(); ttb.group(new DefaultGroupId(nextGroupDesc.givenGroupId())); GroupBucket abucket = DefaultGroupBucket.createAllGroupBucket(ttb.build()); l3McastBuckets.add(abucket); groupInfos.forEach(groupInfo -> { Deque<GroupKey> gkeyChain = new ArrayDeque<>(); gkeyChain.addFirst(groupInfo.innerMostGroupDesc.appCookie()); gkeyChain.addFirst(groupInfo.nextGroupDesc.appCookie()); groupInfos.forEach(groupInfo -> { updatePendingGroups(groupInfo.nextGroupDesc.appCookie(), outerGce); GroupChainElem innerGce = new GroupChainElem(groupInfo.nextGroupDesc, 1, false); updatePendingGroups(groupInfo.innerMostGroupDesc.appCookie(), innerGce);
GroupDescription l2intGrpDesc = groupInfo.nextGroupDesc; TrafficTreatment.Builder ttb = DefaultTrafficTreatment.builder(); ttb.group(new DefaultGroupId(l2intGrpDesc.givenGroupId())); GroupBucket abucket = DefaultGroupBucket.createAllGroupBucket(ttb.build()); l2floodBuckets.add(abucket); Deque<GroupKey> gkeyChain = new ArrayDeque<>(); gkeyChain.addFirst(groupInfo.nextGroupDesc.appCookie()); gkeyChain.addFirst(l2floodgroupkey); allGroupKeys.add(gkeyChain); groupInfos.forEach(groupInfo -> { updatePendingGroups(groupInfo.nextGroupDesc.appCookie(), gce);
ttb.group(new DefaultGroupId(gi.nextGroupDesc.givenGroupId())); GroupBucket sbucket = DefaultGroupBucket .createSelectGroupBucket(ttb.build()); Integer.toHexString(gi.innerMostGroupDesc.givenGroupId()), deviceId); updatePendingGroups(gi.nextGroupDesc.appCookie(), l3ecmpGce); groupService.addGroup(gi.innerMostGroupDesc);
ttb.group(new DefaultGroupId(gi.nextGroupDesc.givenGroupId())); GroupBucket sbucket = DefaultGroupBucket.createSelectGroupBucket(ttb.build()); Integer.toHexString(gi.innerMostGroupDesc.givenGroupId()), deviceId); updatePendingGroups(gi.nextGroupDesc.appCookie(), l3ecmpGce); groupService.addGroup(gi.innerMostGroupDesc);
return; gkeyChain.addFirst(nolabelGroupInfo.innerMostGroupDesc.appCookie()); gkeyChain.addFirst(nolabelGroupInfo.nextGroupDesc.appCookie()); .copyTtlOut() .group(new DefaultGroupId( onelabelGroupInfo.nextGroupDesc.givenGroupId())); GroupBucket l3vpnGrpBkt = DefaultGroupBucket.createIndirectGroupBucket(l3vpnTtb.build()); nextObj.appId()); GroupChainElem l3vpnGce = new GroupChainElem(l3vpnGroupDesc, 1, false); updatePendingGroups(onelabelGroupInfo.nextGroupDesc.appCookie(), l3vpnGce); gkeyChain.addFirst(onelabelGroupInfo.innerMostGroupDesc.appCookie()); gkeyChain.addFirst(onelabelGroupInfo.nextGroupDesc.appCookie()); gkeyChain.addFirst(l3vpngroupkey);