Renamed store.serialize.{Serializer => StoreSerializer}1
Change-Id: I702a586a690fa05d4129ff5b81f927defe1ac582
Showing
5 changed files
with
9 additions
and
11 deletions
... | @@ -2,8 +2,7 @@ package org.onlab.onos.store.cluster.messaging; | ... | @@ -2,8 +2,7 @@ package org.onlab.onos.store.cluster.messaging; |
2 | 2 | ||
3 | import org.onlab.onos.cluster.NodeId; | 3 | import org.onlab.onos.cluster.NodeId; |
4 | 4 | ||
5 | -// TODO: ClusterMessage should be aware about how to serialize the payload | 5 | +// TODO: Should payload type be ByteBuffer? |
6 | -// TODO: Should payload type be made generic? | ||
7 | /** | 6 | /** |
8 | * Base message for cluster-wide communications. | 7 | * Base message for cluster-wide communications. |
9 | */ | 8 | */ |
... | @@ -12,7 +11,6 @@ public class ClusterMessage { | ... | @@ -12,7 +11,6 @@ public class ClusterMessage { |
12 | private final NodeId sender; | 11 | private final NodeId sender; |
13 | private final MessageSubject subject; | 12 | private final MessageSubject subject; |
14 | private final byte[] payload; | 13 | private final byte[] payload; |
15 | - // TODO: add field specifying Serializer for payload | ||
16 | 14 | ||
17 | /** | 15 | /** |
18 | * Creates a cluster message. | 16 | * Creates a cluster message. | ... | ... |
... | @@ -16,7 +16,7 @@ import org.onlab.onos.event.Event; | ... | @@ -16,7 +16,7 @@ import org.onlab.onos.event.Event; |
16 | import org.onlab.onos.store.AbstractStore; | 16 | import org.onlab.onos.store.AbstractStore; |
17 | import org.onlab.onos.store.StoreDelegate; | 17 | import org.onlab.onos.store.StoreDelegate; |
18 | import org.onlab.onos.store.serializers.KryoSerializer; | 18 | import org.onlab.onos.store.serializers.KryoSerializer; |
19 | -import org.onlab.onos.store.serializers.Serializer; | 19 | +import org.onlab.onos.store.serializers.StoreSerializer; |
20 | import org.slf4j.Logger; | 20 | import org.slf4j.Logger; |
21 | 21 | ||
22 | import static com.google.common.base.Preconditions.checkNotNull; | 22 | import static com.google.common.base.Preconditions.checkNotNull; |
... | @@ -34,7 +34,7 @@ public abstract class AbstractHazelcastStore<E extends Event, D extends StoreDel | ... | @@ -34,7 +34,7 @@ public abstract class AbstractHazelcastStore<E extends Event, D extends StoreDel |
34 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 34 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
35 | protected StoreService storeService; | 35 | protected StoreService storeService; |
36 | 36 | ||
37 | - protected Serializer serializer; | 37 | + protected StoreSerializer serializer; |
38 | 38 | ||
39 | protected HazelcastInstance theInstance; | 39 | protected HazelcastInstance theInstance; |
40 | 40 | ... | ... |
... | @@ -2,7 +2,7 @@ package org.onlab.onos.store.common; | ... | @@ -2,7 +2,7 @@ package org.onlab.onos.store.common; |
2 | 2 | ||
3 | import static com.google.common.base.Preconditions.checkNotNull; | 3 | import static com.google.common.base.Preconditions.checkNotNull; |
4 | 4 | ||
5 | -import org.onlab.onos.store.serializers.Serializer; | 5 | +import org.onlab.onos.store.serializers.StoreSerializer; |
6 | 6 | ||
7 | import com.google.common.base.Optional; | 7 | import com.google.common.base.Optional; |
8 | import com.google.common.cache.CacheLoader; | 8 | import com.google.common.cache.CacheLoader; |
... | @@ -18,7 +18,7 @@ import com.hazelcast.core.IMap; | ... | @@ -18,7 +18,7 @@ import com.hazelcast.core.IMap; |
18 | public final class OptionalCacheLoader<K, V> extends | 18 | public final class OptionalCacheLoader<K, V> extends |
19 | CacheLoader<K, Optional<V>> { | 19 | CacheLoader<K, Optional<V>> { |
20 | 20 | ||
21 | - private final Serializer serializer; | 21 | + private final StoreSerializer serializer; |
22 | private IMap<byte[], byte[]> rawMap; | 22 | private IMap<byte[], byte[]> rawMap; |
23 | 23 | ||
24 | /** | 24 | /** |
... | @@ -27,7 +27,7 @@ public final class OptionalCacheLoader<K, V> extends | ... | @@ -27,7 +27,7 @@ public final class OptionalCacheLoader<K, V> extends |
27 | * @param serializer to use for serialization | 27 | * @param serializer to use for serialization |
28 | * @param rawMap underlying IMap | 28 | * @param rawMap underlying IMap |
29 | */ | 29 | */ |
30 | - public OptionalCacheLoader(Serializer serializer, IMap<byte[], byte[]> rawMap) { | 30 | + public OptionalCacheLoader(StoreSerializer serializer, IMap<byte[], byte[]> rawMap) { |
31 | this.serializer = checkNotNull(serializer); | 31 | this.serializer = checkNotNull(serializer); |
32 | this.rawMap = checkNotNull(rawMap); | 32 | this.rawMap = checkNotNull(rawMap); |
33 | } | 33 | } | ... | ... |
... | @@ -7,9 +7,9 @@ import org.slf4j.LoggerFactory; | ... | @@ -7,9 +7,9 @@ import org.slf4j.LoggerFactory; |
7 | import java.nio.ByteBuffer; | 7 | import java.nio.ByteBuffer; |
8 | 8 | ||
9 | /** | 9 | /** |
10 | - * Serializer implementation using Kryo. | 10 | + * StoreSerializer implementation using Kryo. |
11 | */ | 11 | */ |
12 | -public class KryoSerializer implements Serializer { | 12 | +public class KryoSerializer implements StoreSerializer { |
13 | 13 | ||
14 | private final Logger log = LoggerFactory.getLogger(getClass()); | 14 | private final Logger log = LoggerFactory.getLogger(getClass()); |
15 | protected KryoPool serializerPool; | 15 | protected KryoPool serializerPool; | ... | ... |
... | @@ -6,7 +6,7 @@ import java.nio.ByteBuffer; | ... | @@ -6,7 +6,7 @@ import java.nio.ByteBuffer; |
6 | /** | 6 | /** |
7 | * Service to serialize Objects into byte array. | 7 | * Service to serialize Objects into byte array. |
8 | */ | 8 | */ |
9 | -public interface Serializer { | 9 | +public interface StoreSerializer { |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * Serializes the specified object into bytes. | 12 | * Serializes the specified object into bytes. | ... | ... |
-
Please register or login to post a comment