Remove legacy NormalizedNode serialization classes Removed the pre-Lithium protobuff-based NormalizedNode classes and related classes as they are no longer used. Change-Id: I6ae34c9f3778f31bfa26cb4b6d30f3f3eb1f6fc8 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Fix CS warnings in sal-clustering-commons and enable enforcement Fixed checkstyle warnings and enabled enforcement. Most of the warnings/changes were for: - white space before if/for/while/catch - white space before beginning brace - line too long - illegal catching of Exception (suppressed) - variable name too short - indentation - local vars/params hiding a field - putting overloaded methods close to one another - remove unused vars - convert functional interfaces to lambdas (eclipse save action) - empty catch block - added comment or Throwables.propagate as appropriate - missing period after first sentence in javadoc - missing first sentence in javadoc - adding final for locals declared too far from first usage Change-Id: I0a6690f97820e8fb670f209221d8e4e2f1cf5d8b Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Fix raw type warnings Fixes NodeWithValue and similar raw type warnings. Also imports YangInstanceIdentifier inner interfaces for more readable code. Change-Id: Iaff9e250fff26b0da70dd9f24d7ccc72121630e4 Signed-off-by: Robert Varga <rovarga@cisco.com>
Fix license header violations in sal-clustering-commons Change-Id: I1b76464cd875fdaaedeebc22cf35cae11714990d Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Optimize PathUtils.toString() - check for empty iterator and return empty string - check iterator.hasNext() only once per iteration - concatenate a single char instead of a string Change-Id: If0769462d74a7df23373d12db5843fd2a217d5a9 Signed-off-by: Robert Varga <rovarga@cisco.com>
Optimize PathUtils.toYangInstanceIdentifier() Instead of using String-bases split, use a guava splitter. Change-Id: I6eb184d5e3a3ece93588267ba231a42b90d6bb9d Signed-off-by: Robert Varga <rovarga@cisco.com>
Bug 2003: CDS serialization improvements In NormalizedNodeToNodeCodec#encode, significant time was spent serializing the YangInstanceIdentifier path via PathUtils even though it wasn't actually needed - the decode method didn't decode it. This might have been used by WriteModification and MergeModification originally however they currently serialized/deserialize their YangInstanceIdentifier path separately from the NormalizedNode via InstanceIdentifierUtils. It turns out this takes significant time as well as it's implemented similarly as PathUtils. So I ended up using NormalizedNodeToNodeCodec to encode/decode the YangInstanceIdentifier along with the NormalizedNode but changed InstanceIdentifierUtils to utilize the new PathArgumentSerializer and the NormalizedNodeSerializer's special QName encoding. With serializing a 5K batch of WriteModifications with flow data, the time went down from ~350 ms to ~150 ms. Deserialization was also improved. Other smaller optimizations in NormalizedNodeSerializer, NormalizedNodeType, PathArgumentSerializer and PathArgumentType chopped another 20-30 ms off the time. I also changed InstanceIdentifierUtils to serialize/deserialize via the new PathArgumentSerializer and the NormalizedNodeSerializer's special QName encoding by default, even when the ID isn't encoded as part of a NormalizeNode. This seems reasonable to me as a standalone IID will likely have repeated namespaces and revisions plus we get savings by not serializing each path arg class name. Removed the deprecated InstanceIdentifierUtils class in sal-distributed-datastore bundle. Change-Id: Iaa29daeaececf4b93065f4d46d0c2796c4d8188f Signed-off-by: tpantelis <tpanteli@brocade.com>
BUG 1597 - Do not use toString as serialized version of YangInstanceIdentifier/PathArgument The code has been modified to stop interpreting YangInstanceIdentifier.toString and PathArgument.toString as a serialized versions of those objects. The toString implementations of those objects has now been moved into PathUtils. - NormalizedNodeGetter and NormalizedNodeToNodeCodecTest have been modified to use PathUtils.toString instead of YangInstanceIdentifier.toString or PathArgument.toString - Added tests to cover all the utilities in PathUtils Change-Id: I1ed2c452e15a45229c36532d59db7fa1a77d283d Signed-off-by: Moiz Raja <moraja@cisco.com>
Fix usage of StringBuilder when getting parent path in PathUtils Making constants final timing encode/decode in a test case Change-Id: Ia552163dfe35dcd268bd8a0620c6b34c910f47b2 Signed-off-by: Basheeruddin Ahmed <syedbahm@cisco.com>
Created sal-clustering-commons and moved sal-protobuff-encoding files to sal-clustering-commons updated sal-distributed-datastore pom with the above change removed sal-clustering-commons as part of distribution as it is embedded currently as part of distributed-datastore Note - after this is merged we need to move out the .proto from akka-raft to sal-clustering-commons and add dependency of sal-akka-raft on sal-clustering-commons and embed the same rebased Change-Id: I7d4ac51628cef96ffb16acfcfd596dfd3129e0fa Signed-off-by: Basheeruddin Ahmed <syedbahm@cisco.com>