[VOL-1588] Improve Flow Add performance
This update consists of the following:
1) Update the performance when adding a flow to a logical device,
decomposing the flow into parent and child device and sending the
flow to the adapters.
2) Format a number of files as per GO fmt.
3) Ensure the device graph cache gets updated when a new port is
added to the graph that belongs to an existing device in cache.
The flow update/deletion performance will be addressed in a separate
commit.
Change-Id: I2eb663cc73eef9fc6172203ed88a35726f5fe008
diff --git a/rw_core/core/adapter_request_handler.go b/rw_core/core/adapter_request_handler.go
index d933466..eeebd0d 100644
--- a/rw_core/core/adapter_request_handler.go
+++ b/rw_core/core/adapter_request_handler.go
@@ -88,7 +88,7 @@
return nil, errors.New("fail-to-create-transaction")
}
- if rhp.core.deviceOwnership.OwnedByMe(&utils.DeviceID{Id:devId}) {
+ if rhp.core.deviceOwnership.OwnedByMe(&utils.DeviceID{Id: devId}) {
log.Debugw("owned-by-me", log.Fields{"Id": devId})
if txn.Acquired(timeout) {
log.Debugw("processing-request", log.Fields{"Id": devId})
@@ -789,9 +789,6 @@
return nil, nil
}
go rhp.deviceMgr.addPort(deviceId.Id, port)
- //if err := rhp.deviceMgr.addPort(deviceId.Id, port); err != nil {
- // return nil, err
- //}
return new(empty.Empty), nil
}