HIGUCHI Yuta
Committed by Thomas Vachuska

Remove duplicate registrations.

- MapEvent.class, MapEvent.Type.class, Versioned.class part of API,
  and all the existing caller was supplying API as base namespace.
- MeterId, MapUpdate part of API
- Default{Device, Port} part of API
- WallClockTimestamp is always added by ECMap

Change-Id: I654c892549e6dddbe5e1f86dbb41d1ca4e84611f
...@@ -86,7 +86,6 @@ public interface Serializer { ...@@ -86,7 +86,6 @@ public interface Serializer {
86 KryoNamespace.Builder builder = new KryoNamespace.Builder(); 86 KryoNamespace.Builder builder = new KryoNamespace.Builder();
87 namespaces.forEach(builder::register); 87 namespaces.forEach(builder::register);
88 Lists.newArrayList(classes).forEach(builder::register); 88 Lists.newArrayList(classes).forEach(builder::register);
89 - builder.register(MapEvent.class, MapEvent.Type.class, Versioned.class);
90 KryoNamespace namespace = builder.build(); 89 KryoNamespace namespace = builder.build();
91 return new Serializer() { 90 return new Serializer() {
92 @Override 91 @Override
......
...@@ -231,8 +231,8 @@ public class GossipDeviceStore ...@@ -231,8 +231,8 @@ public class GossipDeviceStore
231 // Create a distributed map for port stats. 231 // Create a distributed map for port stats.
232 KryoNamespace.Builder deviceDataSerializer = KryoNamespace.newBuilder() 232 KryoNamespace.Builder deviceDataSerializer = KryoNamespace.newBuilder()
233 .register(KryoNamespaces.API) 233 .register(KryoNamespaces.API)
234 - .register(MultiValuedTimestamp.class) 234 + .nextId(KryoNamespaces.BEGIN_USER_CUSTOM_ID)
235 - .register(WallClockTimestamp.class); 235 + .register(MultiValuedTimestamp.class);
236 236
237 devicePortStats = storageService.<DeviceId, Map<PortNumber, PortStatistics>>eventuallyConsistentMapBuilder() 237 devicePortStats = storageService.<DeviceId, Map<PortNumber, PortStatistics>>eventuallyConsistentMapBuilder()
238 .withName("port-stats") 238 .withName("port-stats")
......
...@@ -91,9 +91,9 @@ public class GossipIntentStore ...@@ -91,9 +91,9 @@ public class GossipIntentStore
91 public void activate() { 91 public void activate() {
92 KryoNamespace.Builder intentSerializer = KryoNamespace.newBuilder() 92 KryoNamespace.Builder intentSerializer = KryoNamespace.newBuilder()
93 .register(KryoNamespaces.API) 93 .register(KryoNamespaces.API)
94 + .nextId(KryoNamespaces.BEGIN_USER_CUSTOM_ID)
94 .register(IntentData.class) 95 .register(IntentData.class)
95 - .register(MultiValuedTimestamp.class) 96 + .register(MultiValuedTimestamp.class);
96 - .register(WallClockTimestamp.class);
97 97
98 currentMap = storageService.<Key, IntentData>eventuallyConsistentMapBuilder() 98 currentMap = storageService.<Key, IntentData>eventuallyConsistentMapBuilder()
99 .withName("intent-current") 99 .withName("intent-current")
......
...@@ -35,7 +35,6 @@ import org.onosproject.cluster.PartitionId; ...@@ -35,7 +35,6 @@ import org.onosproject.cluster.PartitionId;
35 import org.onosproject.persistence.PersistenceService; 35 import org.onosproject.persistence.PersistenceService;
36 import org.onosproject.store.cluster.messaging.ClusterCommunicationService; 36 import org.onosproject.store.cluster.messaging.ClusterCommunicationService;
37 import org.onosproject.store.primitives.DistributedPrimitiveCreator; 37 import org.onosproject.store.primitives.DistributedPrimitiveCreator;
38 -import org.onosproject.store.primitives.MapUpdate;
39 import org.onosproject.store.primitives.PartitionAdminService; 38 import org.onosproject.store.primitives.PartitionAdminService;
40 import org.onosproject.store.primitives.PartitionService; 39 import org.onosproject.store.primitives.PartitionService;
41 import org.onosproject.store.primitives.TransactionId; 40 import org.onosproject.store.primitives.TransactionId;
...@@ -103,8 +102,6 @@ public class StorageManager implements StorageService, StorageAdminService { ...@@ -103,8 +102,6 @@ public class StorageManager implements StorageService, StorageAdminService {
103 transactions = this.<TransactionId, Transaction.State>consistentMapBuilder() 102 transactions = this.<TransactionId, Transaction.State>consistentMapBuilder()
104 .withName("onos-transactions") 103 .withName("onos-transactions")
105 .withSerializer(Serializer.using(KryoNamespaces.API, 104 .withSerializer(Serializer.using(KryoNamespaces.API,
106 - MapUpdate.class,
107 - MapUpdate.Type.class,
108 Transaction.class, 105 Transaction.class,
109 Transaction.State.class)) 106 Transaction.State.class))
110 .buildAsyncMap(); 107 .buildAsyncMap();
......
...@@ -32,7 +32,6 @@ import org.onosproject.net.meter.DefaultMeter; ...@@ -32,7 +32,6 @@ import org.onosproject.net.meter.DefaultMeter;
32 import org.onosproject.net.meter.Meter; 32 import org.onosproject.net.meter.Meter;
33 import org.onosproject.net.meter.MeterEvent; 33 import org.onosproject.net.meter.MeterEvent;
34 import org.onosproject.net.meter.MeterFailReason; 34 import org.onosproject.net.meter.MeterFailReason;
35 -import org.onosproject.net.meter.MeterId;
36 import org.onosproject.net.meter.MeterKey; 35 import org.onosproject.net.meter.MeterKey;
37 import org.onosproject.net.meter.MeterOperation; 36 import org.onosproject.net.meter.MeterOperation;
38 import org.onosproject.net.meter.MeterState; 37 import org.onosproject.net.meter.MeterState;
...@@ -103,8 +102,7 @@ public class DistributedMeterStore extends AbstractStore<MeterEvent, MeterStoreD ...@@ -103,8 +102,7 @@ public class DistributedMeterStore extends AbstractStore<MeterEvent, MeterStoreD
103 Band.Type.class, 102 Band.Type.class,
104 MeterState.class, 103 MeterState.class,
105 Meter.Unit.class, 104 Meter.Unit.class,
106 - MeterFailReason.class, 105 + MeterFailReason.class)).build();
107 - MeterId.class)).build();
108 106
109 meters.addListener(mapListener); 107 meters.addListener(mapListener);
110 108
......
...@@ -42,8 +42,6 @@ import org.onosproject.incubator.net.virtual.VirtualNetworkStore; ...@@ -42,8 +42,6 @@ import org.onosproject.incubator.net.virtual.VirtualNetworkStore;
42 import org.onosproject.incubator.net.virtual.VirtualNetworkStoreDelegate; 42 import org.onosproject.incubator.net.virtual.VirtualNetworkStoreDelegate;
43 import org.onosproject.incubator.net.virtual.VirtualPort; 43 import org.onosproject.incubator.net.virtual.VirtualPort;
44 import org.onosproject.net.ConnectPoint; 44 import org.onosproject.net.ConnectPoint;
45 -import org.onosproject.net.DefaultDevice;
46 -import org.onosproject.net.DefaultPort;
47 import org.onosproject.net.Device; 45 import org.onosproject.net.Device;
48 import org.onosproject.net.DeviceId; 46 import org.onosproject.net.DeviceId;
49 import org.onosproject.net.Port; 47 import org.onosproject.net.Port;
...@@ -133,10 +131,9 @@ public class DistributedVirtualNetworkStore ...@@ -133,10 +131,9 @@ public class DistributedVirtualNetworkStore
133 .register(VirtualPort.class) 131 .register(VirtualPort.class)
134 .register(DefaultVirtualPort.class) 132 .register(DefaultVirtualPort.class)
135 .register(Device.class) 133 .register(Device.class)
136 - .register(DefaultDevice.class)
137 - .register(DefaultPort.class)
138 .register(TunnelId.class) 134 .register(TunnelId.class)
139 - .nextId(KryoNamespaces.BEGIN_USER_CUSTOM_ID).build()); 135 + .nextId(KryoNamespaces.BEGIN_USER_CUSTOM_ID)
136 + .build("VirtualNetworkStore"));
140 137
141 /** 138 /**
142 * Distributed network store service activate method. 139 * Distributed network store service activate method.
......