BUG-5280: optimize identifier serialization format 88/39288/17
authorRobert Varga <rovarga@cisco.com>
Tue, 24 May 2016 13:17:58 +0000 (15:17 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 1 Jun 2016 18:09:38 +0000 (18:09 +0000)
commita06a30a33507689464c736cb37c26445f232280e
treeafa647f2a85bfd1b0f9a1bb17cfed7af46595c7f
parent5e3f2ec4601913dd39aa1b044090ecbd1609b760
BUG-5280: optimize identifier serialization format

Using ObjectOutput.writeObject() results in large overhead, resulting
in transaction identifiers weighing in at 549 bytes when used in an object.

Introduce WritableObject concept, which has a WriteTo(ObjectOutput) method
and a static factory method readForm(ObjectInput). This effectively means
we do not get Java Serialization headers.

Also make FrontendType a final class, adopting the WritableObject serialization,
which brings down the overhead to below 100 bytes.

Change-Id: I20294d4fdf309f250d507dfc675d8405c1fcf505
Signed-off-by: Robert Varga <rovarga@cisco.com>
13 files changed:
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/ClientIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FrontendIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FrontendType.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/MemberName.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/TransactionIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/WritableObject.java [new file with mode: 0644]
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/WritableObjects.java [new file with mode: 0644]
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/ClientIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/FrontendIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifierTest.java [new file with mode: 0644]
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/TransactionIdentifierTest.java [new file with mode: 0644]
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/WritableObjectsTest.java [new file with mode: 0644]

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.