Remove DataChangeListener and friends AsyncDataChangeEvent is being kept for now as ovsdb still independently uses it internally. JIRA: TSC-112 Change-Id: Ia68ac1cdf31dec3645f675442db14b7697d63b64 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Fix checkstyle reported by odlparent-3.0.0 Change-Id: I08c548fbbbef8527ad7b037b0def33d3c1c09bf6 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Fix sonar warnings in sal-distributed-datastore These come from squid: - String literals should not be duplicated - Modifiers should be declared in the correct order - Lambdas and anonymous classes should not have too many lines - Nested blocks of code should not be left empty - Local variables should not shadow class fields - Exception handlers should preserve the original exception - Utility classes should not have public constructors - Overriding methods should do more than simply call the same method in the super class - Unused private fields should be removed I fixed quite a few of them. Others we'd have to suppress or modify the sonar config to be more lenient. Change-Id: I7ce7b2a05feac9844fd9c37927de82b7b8b68ee5 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Remove DataChangeListener protobuff messages The DataChangeListener protobuff messages are used to serialize the corresponding CDS messages but we don't actually send these messages over the wire so they don't need serialization. So the protobuff messages were removed. If we do need to serialize these messages in the future we won't use protobuff. Change-Id: Ia72f3da2edbc6c1eeebfb022916894e2b1713840 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Bug 2265: Use new NormalizedNode streaming in messages Utilized the new NormalizedNode streaming classes for the WriteData, MergeData, ReadDataReply and DataChanged messages. One solution was to add a bytes field to the protobuff messages and make the previous fields optional. For backwards compatibility, in the wrapper message's fromSerializable method, check whether or not the protobuff message has the bytes field and act accordingly. While this works, it results in an undesirable inefficiency. Protobuff translates the bytes field to a ByteString type. So when streaming, we need to create a ByteArrayOutputStream and pass that to the NormalizedNode stream writer. Then call ByteString.copyFrom(bos.toByteArray) to get the resulting ByteString. However this results in 2 copies of the serialized byte[]. The byte[] cannot be passed to ByteString as is as it always copies it to maintain immutability. I looked into subclassing ByteString and lazily streaming the data on demand but the ByteString ctor is package scoped so they don’t allow subclassing. So I went with an approach to make each message Externalizable instead of using protobuff. The classes writes the version number to enable us to handle compatibility in the future. So in this manner, we can get the efficient direct streaming we want and easily handle backwards and forwards compatibility. I added a VersionedSerializableMessage interface whose toSerializable method takes a version number. The version # is passed from the remote version # obtained from the CreateTransactionReply. This allows the message classes to handle backwards compatibility. So if the version is Helium-1 or less, send the protobuff message otherwise send the Externalizable instance. In the fromSerializable method, it checks if the passed Object is an instance of the Externalizable class or the protbuff message type. Change-Id: I5ebb968e70ac8ff92c29183c52e6c3fe5362ae34 Signed-off-by: tpantelis <tpanteli@brocade.com>
Fix raw Class in sal-distributed-datastore messages Fixes the use of Class in the messages. Also makes sure exported constants are really constant. Change-Id: Ibc0f688e95e8a2c26d30407897aaf7c51323032e Signed-off-by: Robert Varga <rovarga@cisco.com>
Serialization/Deserialization and a host of other fixes - Hande Cluster MemberUp and MemberRemoved events in ShardManager - Cohort messages and close listener messages switched to use protobuff - Distributed Datastore switch messages to use protobuff CreateTransaction CreateTransactionReply CreateTransactionChain CreateTransactionChainReply distributed datastore messages switched to protobuff - ShardManager messages switch to protobuff - DataChanged and other messages switch to protobuf in distributed datastore - Fixed few things found during testing 1. ShardStrategy - setting of configuration 2. NodeToNormalizedNodeBuilder - leaf node/leafsetentry node checks 3. DataChanged event - passing of scope instanceidentifier used during deserialization - Introducing JMX MBeans for distributed datastore -Fixed issues which were preventing remote Shards from talking to each other - Fixed a number of issues related to deserialization - Add distributed datastore to the build - Switch from InstanceIdentifier to YangInstanceIdentifier Change-Id: I0d15dc482cb2b0fb2170b1344bad9fa3b421e8e0 Signed-off-by: Moiz Raja <moraja@cisco.com>
Implement DataChangeListener - Add a DataChangeReply to confirm receipt of a DataChange - Created an AbstractUntypedActor class from which all actors extend. Currently the only thing this base class does is uniformly log incoming messages. Going forward will automatically register actors for DeathWatch and such. Change-Id: Ibcc4179597023aa37b95641c0b666b3c650dc370 Signed-off-by: Moiz Raja <moraja@cisco.com>