First shot at Broadcom OFDPA 1.0 pipeline
Requires changes to the group description to accept groupId from callers.
Change-Id: Ic21dfe8ae7c246b7d3a6b00e8e5c986e1dc21fa0
diff --git a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
index 5c92ef6..8a31de1 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
@@ -430,8 +430,13 @@
return;
}
- // Get a new group identifier
- GroupId id = new DefaultGroupId(getFreeGroupIdValue(groupDesc.deviceId()));
+ 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 key and id maps
@@ -513,6 +518,7 @@
oldGroup.type(),
updatedBuckets,
newCookie,
+ oldGroup.givenGroupId(),
oldGroup.appId());
StoredGroupEntry newGroup = new DefaultGroup(oldGroup.id(),
updatedGroupDesc);
@@ -718,6 +724,7 @@
group.type(),
group.buckets(),
group.appCookie(),
+ group.givenGroupId(),
group.appId());
storeGroupDescriptionInternal(tmp);
getPendingGroupKeyTable().
diff --git a/core/store/trivial/src/main/java/org/onosproject/store/trivial/impl/SimpleGroupStore.java b/core/store/trivial/src/main/java/org/onosproject/store/trivial/impl/SimpleGroupStore.java
index f25a707..5e6c084 100644
--- a/core/store/trivial/src/main/java/org/onosproject/store/trivial/impl/SimpleGroupStore.java
+++ b/core/store/trivial/src/main/java/org/onosproject/store/trivial/impl/SimpleGroupStore.java
@@ -275,8 +275,13 @@
return;
}
- // Get a new group identifier
- GroupId id = new DefaultGroupId(getFreeGroupIdValue(groupDesc.deviceId()));
+ 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
@@ -324,6 +329,7 @@
oldGroup.type(),
updatedBuckets,
newCookie,
+ oldGroup.givenGroupId(),
oldGroup.appId());
StoredGroupEntry newGroup = new DefaultGroup(oldGroup.id(),
updatedGroupDesc);
@@ -494,6 +500,7 @@
group.type(),
group.buckets(),
group.appCookie(),
+ group.givenGroupId(),
group.appId());
storeGroupDescriptionInternal(tmp);
}
diff --git a/core/store/trivial/src/test/java/org/onosproject/store/trivial/impl/SimpleGroupStoreTest.java b/core/store/trivial/src/test/java/org/onosproject/store/trivial/impl/SimpleGroupStoreTest.java
index 9223996..3cf2af3 100644
--- a/core/store/trivial/src/test/java/org/onosproject/store/trivial/impl/SimpleGroupStoreTest.java
+++ b/core/store/trivial/src/test/java/org/onosproject/store/trivial/impl/SimpleGroupStoreTest.java
@@ -224,6 +224,7 @@
Group.Type.SELECT,
groupBuckets,
key,
+ null,
appId);
InternalGroupStoreDelegate checkStoreGroupDelegate =
new InternalGroupStoreDelegate(key,
@@ -424,6 +425,7 @@
Group.Type.SELECT,
groupBuckets,
key,
+ null,
appId);
InternalGroupStoreDelegate checkStoreGroupDelegate =
new InternalGroupStoreDelegate(key,