Commit 0a03b17f authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component:

- Removed endpoints when running SetDevice method in ConfigureDevice for performance enhancement.
parent 41b7ac7b
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -160,6 +160,12 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
                for error in errors: LOGGER.error(error)
                for error in errors: LOGGER.error(error)
                raise OperationFailedException('ConfigureDevice', extra_details=errors)
                raise OperationFailedException('ConfigureDevice', extra_details=errors)


            # Context Performance+Scalability enhancement:
            # This method, besides P4 logic, does not add/update/delete endpoints.
            # Remove endpoints to reduce number of inserts done by Context.
            # TODO: Add logic to inspect endpoints and keep only those ones modified with respect to Context.
            del device.device_endpoints[:]

            # Note: Rules are updated by configure_rules() and deconfigure_rules() methods.
            # Note: Rules are updated by configure_rules() and deconfigure_rules() methods.
            device_id = context_client.SetDevice(device)
            device_id = context_client.SetDevice(device)
            return device_id
            return device_id