Madan Jampani
Committed by Gerrit Code Review

Post DatabaseManager deprecation code cleanup

- Dropping MutexExecutionService as there are now better alternatives
- Dropping New from class names that were added during transition phase

Change-Id: If0cdd3321081c3f8fda81441ef2c84549b616edd
Showing 16 changed files with 44 additions and 206 deletions
...@@ -21,9 +21,7 @@ import org.apache.karaf.shell.commands.Command; ...@@ -21,9 +21,7 @@ import org.apache.karaf.shell.commands.Command;
21 import org.onosproject.cli.AbstractShellCommand; 21 import org.onosproject.cli.AbstractShellCommand;
22 import org.onosproject.store.service.StorageAdminService; 22 import org.onosproject.store.service.StorageAdminService;
23 23
24 -import com.fasterxml.jackson.databind.JsonNode;
25 import com.fasterxml.jackson.databind.ObjectMapper; 24 import com.fasterxml.jackson.databind.ObjectMapper;
26 -import com.fasterxml.jackson.databind.node.ArrayNode;
27 import com.fasterxml.jackson.databind.node.ObjectNode; 25 import com.fasterxml.jackson.databind.node.ObjectNode;
28 26
29 /** 27 /**
...@@ -35,73 +33,17 @@ public class CountersListCommand extends AbstractShellCommand { ...@@ -35,73 +33,17 @@ public class CountersListCommand extends AbstractShellCommand {
35 33
36 private static final String FMT = "name=%s value=%d"; 34 private static final String FMT = "name=%s value=%d";
37 35
38 - /**
39 - * Displays counters as text.
40 - *
41 - * @param counters counter info
42 - */
43 - private void displayCounters(Map<String, Long> counters) {
44 - counters.forEach((name, value) -> print(FMT, name, value));
45 - }
46 -
47 - /**
48 - * Converts info for counters into a JSON object.
49 - *
50 - * @param counters counter info
51 - */
52 - private JsonNode json(Map<String, Long> counters) {
53 - ObjectMapper mapper = new ObjectMapper();
54 - ArrayNode jsonCounters = mapper.createArrayNode();
55 -
56 - // Create a JSON node for each counter
57 - counters.forEach((name, value) -> {
58 - ObjectNode jsonCounter = mapper.createObjectNode();
59 - jsonCounter.put("name", name)
60 - .put("value", value);
61 - jsonCounters.add(jsonCounter);
62 - });
63 -
64 - return jsonCounters;
65 - }
66 -
67 - /**
68 - * Converts info for counters from different databases into a JSON object.
69 - *
70 - * @param partitionedDbCounters counters info
71 - * @param inMemoryDbCounters counters info
72 - */
73 - private JsonNode jsonAllCounters(Map<String, Long> partitionedDbCounters,
74 - Map<String, Long> inMemoryDbCounters) {
75 - ObjectMapper mapper = new ObjectMapper();
76 - ArrayNode jsonCounters = mapper.createArrayNode();
77 -
78 - // Create a JSON node for partitioned database counter
79 - ObjectNode jsonPartitionedDatabaseCounters = mapper.createObjectNode();
80 - jsonPartitionedDatabaseCounters.set("partitionedDatabaseCounters",
81 - json(partitionedDbCounters));
82 - jsonCounters.add(jsonPartitionedDatabaseCounters);
83 - // Create a JSON node for in-memory database counter
84 - ObjectNode jsonInMemoryDatabseCounters = mapper.createObjectNode();
85 - jsonInMemoryDatabseCounters.set("inMemoryDatabaseCounters",
86 - json(inMemoryDbCounters));
87 - jsonCounters.add(jsonInMemoryDatabseCounters);
88 -
89 - return jsonCounters;
90 - }
91 -
92 -
93 @Override 36 @Override
94 protected void execute() { 37 protected void execute() {
95 StorageAdminService storageAdminService = get(StorageAdminService.class); 38 StorageAdminService storageAdminService = get(StorageAdminService.class);
96 - Map<String, Long> partitionedDatabaseCounters = storageAdminService.getPartitionedDatabaseCounters(); 39 + Map<String, Long> counters = storageAdminService.getCounters();
97 - Map<String, Long> inMemoryDatabaseCounters = storageAdminService.getInMemoryDatabaseCounters();
98 if (outputJson()) { 40 if (outputJson()) {
99 - print("%s", jsonAllCounters(partitionedDatabaseCounters, inMemoryDatabaseCounters)); 41 + ObjectMapper mapper = new ObjectMapper();
42 + ObjectNode jsonCounters = mapper.createObjectNode();
43 + counters.forEach((k, v) -> jsonCounters.put(k, v));
44 + print("%s", jsonCounters);
100 } else { 45 } else {
101 - print("Partitioned database counters:"); 46 + counters.keySet().stream().sorted().forEach(name -> print(FMT, name, counters.get(name)));
102 - displayCounters(partitionedDatabaseCounters);
103 - print("In-memory database counters:");
104 - displayCounters(inMemoryDatabaseCounters);
105 } 47 }
106 } 48 }
107 } 49 }
......
...@@ -51,24 +51,6 @@ public interface DistributedQueueBuilder<E> { ...@@ -51,24 +51,6 @@ public interface DistributedQueueBuilder<E> {
51 DistributedQueueBuilder<E> withSerializer(Serializer serializer); 51 DistributedQueueBuilder<E> withSerializer(Serializer serializer);
52 52
53 /** 53 /**
54 - *
55 - *
56 - * @return this DistributedQueueBuilder for method chaining
57 - */
58 - DistributedQueueBuilder<E> withMeteringDisabled();
59 -
60 -
61 - /**
62 - * Disables persistence of queues entries.
63 - * <p>
64 - * When persistence is disabled, a full cluster restart will wipe out all
65 - * queue entries.
66 - * </p>
67 - * @return this DistributedQueueBuilder for method chaining
68 - */
69 - DistributedQueueBuilder<E> withPersistenceDisabled();
70 -
71 - /**
72 * Builds a queue based on the configuration options 54 * Builds a queue based on the configuration options
73 * supplied to this builder. 55 * supplied to this builder.
74 * 56 *
......
1 -/*
2 - * Copyright 2015 Open Networking Laboratory
3 - *
4 - * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at
7 - *
8 - * http://www.apache.org/licenses/LICENSE-2.0
9 - *
10 - * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and
14 - * limitations under the License.
15 - */
16 -package org.onosproject.store.service;
17 -
18 -import java.util.concurrent.CompletableFuture;
19 -import java.util.concurrent.Executor;
20 -
21 -/**
22 - * Service for mutually exclusive job execution.
23 - */
24 -public interface MutexExecutionService {
25 -
26 - /**
27 - * Runs the specified task in a mutually exclusive fashion.
28 - * @param task task to run
29 - * @param exclusionPath path on which different instances synchronize
30 - * @param executor executor to use for running the task
31 - * @return future that is completed when the task execution completes.
32 - */
33 - CompletableFuture<Void> execute(MutexTask task, String exclusionPath, Executor executor);
34 -}
...\ No newline at end of file ...\ No newline at end of file
...@@ -46,34 +46,12 @@ public interface StorageAdminService { ...@@ -46,34 +46,12 @@ public interface StorageAdminService {
46 46
47 /** 47 /**
48 * Returns information about all the atomic counters in the system. 48 * Returns information about all the atomic counters in the system.
49 - * If 2 counters belonging to 2 different databases have the same name,
50 - * then only one counter from one database is returned.
51 * 49 *
52 * @return mapping from counter name to that counter's next value 50 * @return mapping from counter name to that counter's next value
53 - * @deprecated 1.5.0 Falcon Release
54 */ 51 */
55 - @Deprecated
56 Map<String, Long> getCounters(); 52 Map<String, Long> getCounters();
57 53
58 /** 54 /**
59 - * Returns information about all the atomic partitioned database counters in the system.
60 - *
61 - * @return mapping from counter name to that counter's next value
62 - * @deprecated 1.5.0 Falcon Release
63 - */
64 - @Deprecated
65 - Map<String, Long> getPartitionedDatabaseCounters();
66 -
67 - /**
68 - * Returns information about all the atomic in-memory database counters in the system.
69 - *
70 - * @return mapping from counter name to that counter's next value
71 - * @deprecated 1.5.0 Falcon Release
72 - */
73 - @Deprecated
74 - Map<String, Long> getInMemoryDatabaseCounters();
75 -
76 - /**
77 * Returns all pending transactions. 55 * Returns all pending transactions.
78 * 56 *
79 * @return collection of pending transaction identifiers. 57 * @return collection of pending transaction identifiers.
......
...@@ -73,7 +73,6 @@ import org.onosproject.store.cluster.messaging.MessagingService; ...@@ -73,7 +73,6 @@ import org.onosproject.store.cluster.messaging.MessagingService;
73 import org.onosproject.store.primitives.PartitionAdminService; 73 import org.onosproject.store.primitives.PartitionAdminService;
74 import org.onosproject.store.primitives.PartitionService; 74 import org.onosproject.store.primitives.PartitionService;
75 import org.onosproject.store.service.LogicalClockService; 75 import org.onosproject.store.service.LogicalClockService;
76 -import org.onosproject.store.service.MutexExecutionService;
77 import org.onosproject.store.service.StorageAdminService; 76 import org.onosproject.store.service.StorageAdminService;
78 import org.onosproject.store.service.StorageService; 77 import org.onosproject.store.service.StorageService;
79 import org.onosproject.ui.UiExtensionService; 78 import org.onosproject.ui.UiExtensionService;
...@@ -248,7 +247,6 @@ public final class DefaultPolicyBuilder { ...@@ -248,7 +247,6 @@ public final class DefaultPolicyBuilder {
248 permSet.add(new ServicePermission(MessagingService.class.getName(), ServicePermission.GET)); 247 permSet.add(new ServicePermission(MessagingService.class.getName(), ServicePermission.GET));
249 permSet.add(new ServicePermission(PartitionService.class.getName(), ServicePermission.GET)); 248 permSet.add(new ServicePermission(PartitionService.class.getName(), ServicePermission.GET));
250 permSet.add(new ServicePermission(LogicalClockService.class.getName(), ServicePermission.GET)); 249 permSet.add(new ServicePermission(LogicalClockService.class.getName(), ServicePermission.GET));
251 - permSet.add(new ServicePermission(MutexExecutionService.class.getName(), ServicePermission.GET));
252 permSet.add(new ServicePermission(StorageService.class.getName(), ServicePermission.GET)); 250 permSet.add(new ServicePermission(StorageService.class.getName(), ServicePermission.GET));
253 permSet.add(new ServicePermission(UiExtensionService.class.getName(), ServicePermission.GET)); 251 permSet.add(new ServicePermission(UiExtensionService.class.getName(), ServicePermission.GET));
254 252
...@@ -376,8 +374,6 @@ public final class DefaultPolicyBuilder { ...@@ -376,8 +374,6 @@ public final class DefaultPolicyBuilder {
376 PartitionService.class.getName())); 374 PartitionService.class.getName()));
377 serviceDirectory.put(CLOCK_WRITE, ImmutableSet.of( 375 serviceDirectory.put(CLOCK_WRITE, ImmutableSet.of(
378 LogicalClockService.class.getName())); 376 LogicalClockService.class.getName()));
379 - serviceDirectory.put(MUTEX_WRITE, ImmutableSet.of(
380 - MutexExecutionService.class.getName()));
381 377
382 return serviceDirectory; 378 return serviceDirectory;
383 } 379 }
......
...@@ -34,7 +34,11 @@ import com.google.common.base.Throwables; ...@@ -34,7 +34,11 @@ import com.google.common.base.Throwables;
34 import com.google.common.collect.Maps; 34 import com.google.common.collect.Maps;
35 import org.onosproject.utils.MeteringAgent; 35 import org.onosproject.utils.MeteringAgent;
36 36
37 - 37 +/**
38 + * Default implementation of a {@code AsyncAtomicValue}.
39 + *
40 + * @param <V> value type
41 + */
38 public class DefaultAsyncAtomicValue<V> implements AsyncAtomicValue<V> { 42 public class DefaultAsyncAtomicValue<V> implements AsyncAtomicValue<V> {
39 43
40 private final String name; 44 private final String name;
......
...@@ -22,11 +22,11 @@ import org.onosproject.store.service.AtomicCounterBuilder; ...@@ -22,11 +22,11 @@ import org.onosproject.store.service.AtomicCounterBuilder;
22 /** 22 /**
23 * Default implementation of AtomicCounterBuilder. 23 * Default implementation of AtomicCounterBuilder.
24 */ 24 */
25 -public class NewDefaultAtomicCounterBuilder extends AtomicCounterBuilder { 25 +public class DefaultAtomicCounterBuilder extends AtomicCounterBuilder {
26 26
27 private final DistributedPrimitiveCreator primitiveCreator; 27 private final DistributedPrimitiveCreator primitiveCreator;
28 28
29 - public NewDefaultAtomicCounterBuilder(DistributedPrimitiveCreator primitiveCreator) { 29 + public DefaultAtomicCounterBuilder(DistributedPrimitiveCreator primitiveCreator) {
30 this.primitiveCreator = primitiveCreator; 30 this.primitiveCreator = primitiveCreator;
31 } 31 }
32 32
......
...@@ -26,11 +26,11 @@ import org.onosproject.store.service.ConsistentMapBuilder; ...@@ -26,11 +26,11 @@ import org.onosproject.store.service.ConsistentMapBuilder;
26 * @param <K> type for map key 26 * @param <K> type for map key
27 * @param <V> type for map value 27 * @param <V> type for map value
28 */ 28 */
29 -public class NewDefaultConsistentMapBuilder<K, V> extends ConsistentMapBuilder<K, V> { 29 +public class DefaultConsistentMapBuilder<K, V> extends ConsistentMapBuilder<K, V> {
30 30
31 private final DistributedPrimitiveCreator primitiveCreator; 31 private final DistributedPrimitiveCreator primitiveCreator;
32 32
33 - public NewDefaultConsistentMapBuilder(DistributedPrimitiveCreator primitiveCreator) { 33 + public DefaultConsistentMapBuilder(DistributedPrimitiveCreator primitiveCreator) {
34 this.primitiveCreator = primitiveCreator; 34 this.primitiveCreator = primitiveCreator;
35 } 35 }
36 36
......
...@@ -28,15 +28,13 @@ import static com.google.common.base.Preconditions.checkState; ...@@ -28,15 +28,13 @@ import static com.google.common.base.Preconditions.checkState;
28 * 28 *
29 * @param <E> queue entry type 29 * @param <E> queue entry type
30 */ 30 */
31 -public class NewDefaultDistributedQueueBuilder<E> implements DistributedQueueBuilder<E> { 31 +public class DefaultDistributedQueueBuilder<E> implements DistributedQueueBuilder<E> {
32 32
33 private final DistributedPrimitiveCreator primitiveCreator; 33 private final DistributedPrimitiveCreator primitiveCreator;
34 private String name; 34 private String name;
35 - private boolean persistenceEnabled = true;
36 - private boolean metering = true;
37 private Serializer serializer; 35 private Serializer serializer;
38 36
39 - public NewDefaultDistributedQueueBuilder(DistributedPrimitiveCreator primitiveCreator) { 37 + public DefaultDistributedQueueBuilder(DistributedPrimitiveCreator primitiveCreator) {
40 this.primitiveCreator = primitiveCreator; 38 this.primitiveCreator = primitiveCreator;
41 } 39 }
42 40
...@@ -54,18 +52,6 @@ public class NewDefaultDistributedQueueBuilder<E> implements DistributedQueueBui ...@@ -54,18 +52,6 @@ public class NewDefaultDistributedQueueBuilder<E> implements DistributedQueueBui
54 return this; 52 return this;
55 } 53 }
56 54
57 - @Override
58 - public DistributedQueueBuilder<E> withMeteringDisabled() {
59 - metering = false;
60 - return this;
61 - }
62 -
63 - @Override
64 - public DistributedQueueBuilder<E> withPersistenceDisabled() {
65 - persistenceEnabled = false;
66 - return this;
67 - }
68 -
69 private boolean validInputs() { 55 private boolean validInputs() {
70 return name != null && serializer != null; 56 return name != null && serializer != null;
71 } 57 }
......
...@@ -32,7 +32,7 @@ import com.google.common.collect.Sets; ...@@ -32,7 +32,7 @@ import com.google.common.collect.Sets;
32 /** 32 /**
33 * Default implementation of transaction context. 33 * Default implementation of transaction context.
34 */ 34 */
35 -public class NewDefaultTransactionContext implements TransactionContext { 35 +public class DefaultTransactionContext implements TransactionContext {
36 36
37 private final AtomicBoolean isOpen = new AtomicBoolean(false); 37 private final AtomicBoolean isOpen = new AtomicBoolean(false);
38 private final DistributedPrimitiveCreator creator; 38 private final DistributedPrimitiveCreator creator;
...@@ -41,7 +41,7 @@ public class NewDefaultTransactionContext implements TransactionContext { ...@@ -41,7 +41,7 @@ public class NewDefaultTransactionContext implements TransactionContext {
41 private final Set<TransactionParticipant> txParticipants = Sets.newConcurrentHashSet(); 41 private final Set<TransactionParticipant> txParticipants = Sets.newConcurrentHashSet();
42 private final MeteringAgent monitor; 42 private final MeteringAgent monitor;
43 43
44 - public NewDefaultTransactionContext(TransactionId transactionId, 44 + public DefaultTransactionContext(TransactionId transactionId,
45 DistributedPrimitiveCreator creator, 45 DistributedPrimitiveCreator creator,
46 TransactionCoordinator transactionCoordinator) { 46 TransactionCoordinator transactionCoordinator) {
47 this.transactionId = transactionId; 47 this.transactionId = transactionId;
......
...@@ -22,13 +22,13 @@ import org.onosproject.store.service.TransactionContextBuilder; ...@@ -22,13 +22,13 @@ import org.onosproject.store.service.TransactionContextBuilder;
22 /** 22 /**
23 * Default Transaction Context Builder. 23 * Default Transaction Context Builder.
24 */ 24 */
25 -public class NewDefaultTransactionContextBuilder extends TransactionContextBuilder { 25 +public class DefaultTransactionContextBuilder extends TransactionContextBuilder {
26 26
27 private final TransactionId transactionId; 27 private final TransactionId transactionId;
28 private final DistributedPrimitiveCreator primitiveCreator; 28 private final DistributedPrimitiveCreator primitiveCreator;
29 private final TransactionCoordinator transactionCoordinator; 29 private final TransactionCoordinator transactionCoordinator;
30 30
31 - public NewDefaultTransactionContextBuilder(TransactionId transactionId, 31 + public DefaultTransactionContextBuilder(TransactionId transactionId,
32 DistributedPrimitiveCreator primitiveCreator, 32 DistributedPrimitiveCreator primitiveCreator,
33 TransactionCoordinator transactionCoordinator) { 33 TransactionCoordinator transactionCoordinator) {
34 this.transactionId = transactionId; 34 this.transactionId = transactionId;
...@@ -38,7 +38,7 @@ public class NewDefaultTransactionContextBuilder extends TransactionContextBuild ...@@ -38,7 +38,7 @@ public class NewDefaultTransactionContextBuilder extends TransactionContextBuild
38 38
39 @Override 39 @Override
40 public TransactionContext build() { 40 public TransactionContext build() {
41 - return new NewDefaultTransactionContext(transactionId, 41 + return new DefaultTransactionContext(transactionId,
42 primitiveCreator, 42 primitiveCreator,
43 transactionCoordinator); 43 transactionCoordinator);
44 } 44 }
......
...@@ -94,7 +94,7 @@ public class PartitionManager extends AbstractListenerManager<PartitionEvent, Pa ...@@ -94,7 +94,7 @@ public class PartitionManager extends AbstractListenerManager<PartitionEvent, Pa
94 messagingService, 94 messagingService,
95 clusterService, 95 clusterService,
96 CatalystSerializers.getSerializer(), 96 CatalystSerializers.getSerializer(),
97 - new File(System.getProperty("karaf.data") + "/data/" + partition.getId())))); 97 + new File(System.getProperty("karaf.data") + "/partitions/" + partition.getId()))));
98 98
99 CompletableFuture<Void> openFuture = CompletableFuture.allOf(partitions.values() 99 CompletableFuture<Void> openFuture = CompletableFuture.allOf(partitions.values()
100 .stream() 100 .stream()
......
...@@ -57,7 +57,6 @@ import org.onosproject.store.service.StorageService; ...@@ -57,7 +57,6 @@ import org.onosproject.store.service.StorageService;
57 import org.onosproject.store.service.TransactionContextBuilder; 57 import org.onosproject.store.service.TransactionContextBuilder;
58 import org.slf4j.Logger; 58 import org.slf4j.Logger;
59 59
60 -import com.google.common.collect.ImmutableMap;
61 import com.google.common.collect.Maps; 60 import com.google.common.collect.Maps;
62 import com.google.common.util.concurrent.Futures; 61 import com.google.common.util.concurrent.Futures;
63 62
...@@ -129,7 +128,7 @@ public class StorageManager implements StorageService, StorageAdminService { ...@@ -129,7 +128,7 @@ public class StorageManager implements StorageService, StorageAdminService {
129 @Override 128 @Override
130 public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() { 129 public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
131 checkPermission(STORAGE_WRITE); 130 checkPermission(STORAGE_WRITE);
132 - return new NewDefaultConsistentMapBuilder<>(federatedPrimitiveCreator); 131 + return new DefaultConsistentMapBuilder<>(federatedPrimitiveCreator);
133 } 132 }
134 133
135 @Override 134 @Override
...@@ -141,13 +140,13 @@ public class StorageManager implements StorageService, StorageAdminService { ...@@ -141,13 +140,13 @@ public class StorageManager implements StorageService, StorageAdminService {
141 @Override 140 @Override
142 public <E> DistributedQueueBuilder<E> queueBuilder() { 141 public <E> DistributedQueueBuilder<E> queueBuilder() {
143 checkPermission(STORAGE_WRITE); 142 checkPermission(STORAGE_WRITE);
144 - return new NewDefaultDistributedQueueBuilder<>(federatedPrimitiveCreator); 143 + return new DefaultDistributedQueueBuilder<>(federatedPrimitiveCreator);
145 } 144 }
146 145
147 @Override 146 @Override
148 public AtomicCounterBuilder atomicCounterBuilder() { 147 public AtomicCounterBuilder atomicCounterBuilder() {
149 checkPermission(STORAGE_WRITE); 148 checkPermission(STORAGE_WRITE);
150 - return new NewDefaultAtomicCounterBuilder(federatedPrimitiveCreator); 149 + return new DefaultAtomicCounterBuilder(federatedPrimitiveCreator);
151 } 150 }
152 151
153 @Override 152 @Override
...@@ -163,7 +162,7 @@ public class StorageManager implements StorageService, StorageAdminService { ...@@ -163,7 +162,7 @@ public class StorageManager implements StorageService, StorageAdminService {
163 @Override 162 @Override
164 public TransactionContextBuilder transactionContextBuilder() { 163 public TransactionContextBuilder transactionContextBuilder() {
165 checkPermission(STORAGE_WRITE); 164 checkPermission(STORAGE_WRITE);
166 - return new NewDefaultTransactionContextBuilder(transactionIdGenerator.get(), 165 + return new DefaultTransactionContextBuilder(transactionIdGenerator.get(),
167 federatedPrimitiveCreator, 166 federatedPrimitiveCreator,
168 transactionCoordinator); 167 transactionCoordinator);
169 } 168 }
...@@ -181,26 +180,10 @@ public class StorageManager implements StorageService, StorageAdminService { ...@@ -181,26 +180,10 @@ public class StorageManager implements StorageService, StorageAdminService {
181 180
182 @Override 181 @Override
183 public Map<String, Long> getCounters() { 182 public Map<String, Long> getCounters() {
184 - Map<String, Long> result = Maps.newHashMap();
185 - result.putAll(getInMemoryDatabaseCounters());
186 - result.putAll(getPartitionedDatabaseCounters());
187 - return result;
188 - }
189 -
190 - @Override
191 - public Map<String, Long> getInMemoryDatabaseCounters() {
192 - return ImmutableMap.of();
193 - }
194 -
195 - @Override
196 - public Map<String, Long> getPartitionedDatabaseCounters() {
197 - return getCounters(federatedPrimitiveCreator);
198 - }
199 -
200 - public Map<String, Long> getCounters(DistributedPrimitiveCreator creator) {
201 Map<String, Long> counters = Maps.newConcurrentMap(); 183 Map<String, Long> counters = Maps.newConcurrentMap();
202 - creator.getAsyncAtomicCounterNames() 184 + federatedPrimitiveCreator.getAsyncAtomicCounterNames()
203 - .forEach(name -> counters.put(name, creator.newAsyncCounter(name).asAtomicCounter().get())); 185 + .forEach(name -> counters.put(name,
186 + federatedPrimitiveCreator.newAsyncCounter(name).asAtomicCounter().get()));
204 return counters; 187 return counters;
205 } 188 }
206 189
......
...@@ -35,6 +35,8 @@ import org.onosproject.store.service.Versioned; ...@@ -35,6 +35,8 @@ import org.onosproject.store.service.Versioned;
35 */ 35 */
36 public class UnmodifiableAsyncConsistentMap<K, V> extends DelegatingAsyncConsistentMap<K, V> { 36 public class UnmodifiableAsyncConsistentMap<K, V> extends DelegatingAsyncConsistentMap<K, V> {
37 37
38 + private static final String ERROR_MSG = "map updates are not allowed";
39 +
38 public UnmodifiableAsyncConsistentMap(AsyncConsistentMap<K, V> backingMap) { 40 public UnmodifiableAsyncConsistentMap(AsyncConsistentMap<K, V> backingMap) {
39 super(backingMap); 41 super(backingMap);
40 } 42 }
...@@ -43,56 +45,56 @@ public class UnmodifiableAsyncConsistentMap<K, V> extends DelegatingAsyncConsist ...@@ -43,56 +45,56 @@ public class UnmodifiableAsyncConsistentMap<K, V> extends DelegatingAsyncConsist
43 public CompletableFuture<Versioned<V>> computeIf(K key, 45 public CompletableFuture<Versioned<V>> computeIf(K key,
44 Predicate<? super V> condition, 46 Predicate<? super V> condition,
45 BiFunction<? super K, ? super V, ? extends V> remappingFunction) { 47 BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
46 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 48 + return Tools.exceptionalFuture(new UnsupportedOperationException(""));
47 } 49 }
48 50
49 @Override 51 @Override
50 public CompletableFuture<Versioned<V>> put(K key, V value) { 52 public CompletableFuture<Versioned<V>> put(K key, V value) {
51 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 53 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
52 } 54 }
53 55
54 @Override 56 @Override
55 public CompletableFuture<Versioned<V>> putAndGet(K key, V value) { 57 public CompletableFuture<Versioned<V>> putAndGet(K key, V value) {
56 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 58 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
57 } 59 }
58 60
59 @Override 61 @Override
60 public CompletableFuture<Versioned<V>> remove(K key) { 62 public CompletableFuture<Versioned<V>> remove(K key) {
61 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 63 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
62 } 64 }
63 65
64 @Override 66 @Override
65 public CompletableFuture<Void> clear() { 67 public CompletableFuture<Void> clear() {
66 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 68 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
67 } 69 }
68 70
69 @Override 71 @Override
70 public CompletableFuture<Versioned<V>> putIfAbsent(K key, V value) { 72 public CompletableFuture<Versioned<V>> putIfAbsent(K key, V value) {
71 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 73 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
72 } 74 }
73 75
74 @Override 76 @Override
75 public CompletableFuture<Boolean> remove(K key, V value) { 77 public CompletableFuture<Boolean> remove(K key, V value) {
76 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 78 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
77 } 79 }
78 80
79 @Override 81 @Override
80 public CompletableFuture<Boolean> remove(K key, long version) { 82 public CompletableFuture<Boolean> remove(K key, long version) {
81 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 83 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
82 } 84 }
83 85
84 @Override 86 @Override
85 public CompletableFuture<Versioned<V>> replace(K key, V value) { 87 public CompletableFuture<Versioned<V>> replace(K key, V value) {
86 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 88 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
87 } 89 }
88 90
89 @Override 91 @Override
90 public CompletableFuture<Boolean> replace(K key, V oldValue, V newValue) { 92 public CompletableFuture<Boolean> replace(K key, V oldValue, V newValue) {
91 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 93 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
92 } 94 }
93 95
94 @Override 96 @Override
95 public CompletableFuture<Boolean> replace(K key, long oldVersion, V newValue) { 97 public CompletableFuture<Boolean> replace(K key, long oldVersion, V newValue) {
96 - return Tools.exceptionalFuture(new UnsupportedOperationException("map updates are not allowed")); 98 + return Tools.exceptionalFuture(new UnsupportedOperationException(ERROR_MSG));
97 } 99 }
98 } 100 }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
15 */ 15 */
16 16
17 /** 17 /**
18 - * Implementation of partitioned and distributed store facility capable of 18 + * Implementation classes for various Distributed primitives.
19 - * providing consistent update semantics.
20 */ 19 */
21 package org.onosproject.store.primitives.impl; 20 package org.onosproject.store.primitives.impl;
...\ No newline at end of file ...\ No newline at end of file
......