Committed by
Gerrit Code Review
Removes deprecated withPartitionsDisabled method
Change-Id: I9a39c0584d0e5d62d5719639598c5cc25bcb8e2f
Showing
7 changed files
with
3 additions
and
42 deletions
| ... | @@ -17,7 +17,6 @@ package org.onosproject.distributedprimitives.cli; | ... | @@ -17,7 +17,6 @@ package org.onosproject.distributedprimitives.cli; |
| 17 | 17 | ||
| 18 | import org.apache.karaf.shell.commands.Argument; | 18 | import org.apache.karaf.shell.commands.Argument; |
| 19 | import org.apache.karaf.shell.commands.Command; | 19 | import org.apache.karaf.shell.commands.Command; |
| 20 | -import org.apache.karaf.shell.commands.Option; | ||
| 21 | import org.onosproject.cli.AbstractShellCommand; | 20 | import org.onosproject.cli.AbstractShellCommand; |
| 22 | import org.onosproject.store.serializers.KryoNamespaces; | 21 | import org.onosproject.store.serializers.KryoNamespaces; |
| 23 | import org.onosproject.store.service.Serializer; | 22 | import org.onosproject.store.service.Serializer; |
| ... | @@ -32,10 +31,6 @@ import org.onosproject.store.service.TransactionalMap; | ... | @@ -32,10 +31,6 @@ import org.onosproject.store.service.TransactionalMap; |
| 32 | description = "Get a value associated with a specific key in a transactional map") | 31 | description = "Get a value associated with a specific key in a transactional map") |
| 33 | public class TransactionalMapTestGetCommand extends AbstractShellCommand { | 32 | public class TransactionalMapTestGetCommand extends AbstractShellCommand { |
| 34 | 33 | ||
| 35 | - @Option(name = "-i", aliases = "--inMemory", description = "use in memory map?", | ||
| 36 | - required = false, multiValued = false) | ||
| 37 | - private boolean inMemory = false; | ||
| 38 | - | ||
| 39 | @Argument(index = 0, name = "key", | 34 | @Argument(index = 0, name = "key", |
| 40 | description = "Key to get the value of", | 35 | description = "Key to get the value of", |
| 41 | required = true, multiValued = false) | 36 | required = true, multiValued = false) |
| ... | @@ -49,11 +44,7 @@ public class TransactionalMapTestGetCommand extends AbstractShellCommand { | ... | @@ -49,11 +44,7 @@ public class TransactionalMapTestGetCommand extends AbstractShellCommand { |
| 49 | protected void execute() { | 44 | protected void execute() { |
| 50 | StorageService storageService = get(StorageService.class); | 45 | StorageService storageService = get(StorageService.class); |
| 51 | TransactionContext context; | 46 | TransactionContext context; |
| 52 | - if (inMemory) { | 47 | + context = storageService.transactionContextBuilder().build(); |
| 53 | - context = storageService.transactionContextBuilder().withPartitionsDisabled().build(); | ||
| 54 | - } else { | ||
| 55 | - context = storageService.transactionContextBuilder().build(); | ||
| 56 | - } | ||
| 57 | context.begin(); | 48 | context.begin(); |
| 58 | try { | 49 | try { |
| 59 | map = context.getTransactionalMap(mapName, serializer); | 50 | map = context.getTransactionalMap(mapName, serializer); | ... | ... |
| ... | @@ -17,7 +17,6 @@ package org.onosproject.distributedprimitives.cli; | ... | @@ -17,7 +17,6 @@ package org.onosproject.distributedprimitives.cli; |
| 17 | 17 | ||
| 18 | import org.apache.karaf.shell.commands.Argument; | 18 | import org.apache.karaf.shell.commands.Argument; |
| 19 | import org.apache.karaf.shell.commands.Command; | 19 | import org.apache.karaf.shell.commands.Command; |
| 20 | -import org.apache.karaf.shell.commands.Option; | ||
| 21 | import org.onosproject.cli.AbstractShellCommand; | 20 | import org.onosproject.cli.AbstractShellCommand; |
| 22 | import org.onosproject.store.serializers.KryoNamespaces; | 21 | import org.onosproject.store.serializers.KryoNamespaces; |
| 23 | import org.onosproject.store.service.Serializer; | 22 | import org.onosproject.store.service.Serializer; |
| ... | @@ -32,10 +31,6 @@ import org.onosproject.store.service.TransactionalMap; | ... | @@ -32,10 +31,6 @@ import org.onosproject.store.service.TransactionalMap; |
| 32 | description = "Put a value into a transactional map") | 31 | description = "Put a value into a transactional map") |
| 33 | public class TransactionalMapTestPutCommand extends AbstractShellCommand { | 32 | public class TransactionalMapTestPutCommand extends AbstractShellCommand { |
| 34 | 33 | ||
| 35 | - @Option(name = "-i", aliases = "--inMemory", description = "use in memory map?", | ||
| 36 | - required = false, multiValued = false) | ||
| 37 | - private boolean inMemory = false; | ||
| 38 | - | ||
| 39 | @Argument(index = 0, name = "numKeys", | 34 | @Argument(index = 0, name = "numKeys", |
| 40 | description = "Number of keys to put the value into", | 35 | description = "Number of keys to put the value into", |
| 41 | required = true, multiValued = false) | 36 | required = true, multiValued = false) |
| ... | @@ -55,11 +50,7 @@ public class TransactionalMapTestPutCommand extends AbstractShellCommand { | ... | @@ -55,11 +50,7 @@ public class TransactionalMapTestPutCommand extends AbstractShellCommand { |
| 55 | protected void execute() { | 50 | protected void execute() { |
| 56 | StorageService storageService = get(StorageService.class); | 51 | StorageService storageService = get(StorageService.class); |
| 57 | TransactionContext context; | 52 | TransactionContext context; |
| 58 | - if (inMemory) { | 53 | + context = storageService.transactionContextBuilder().build(); |
| 59 | - context = storageService.transactionContextBuilder().withPartitionsDisabled().build(); | ||
| 60 | - } else { | ||
| 61 | - context = storageService.transactionContextBuilder().build(); | ||
| 62 | - } | ||
| 63 | context.begin(); | 54 | context.begin(); |
| 64 | try { | 55 | try { |
| 65 | map = context.getTransactionalMap(mapName, serializer); | 56 | map = context.getTransactionalMap(mapName, serializer); | ... | ... |
| ... | @@ -74,18 +74,6 @@ public abstract class DistributedPrimitiveBuilder<B extends DistributedPrimitive | ... | @@ -74,18 +74,6 @@ public abstract class DistributedPrimitiveBuilder<B extends DistributedPrimitive |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | /** | 76 | /** |
| 77 | - * Creates this primitive on a special partition that comprises of all members in the cluster. | ||
| 78 | - * @deprecated usage of this method is discouraged for most common scenarios. Eventually it will be replaced | ||
| 79 | - * with a better alternative that does not exposes low level details. Until then avoid using this method. | ||
| 80 | - * @return this builder | ||
| 81 | - */ | ||
| 82 | - @Deprecated | ||
| 83 | - public B withPartitionsDisabled() { | ||
| 84 | - this.partitionsDisabled = true; | ||
| 85 | - return (B) this; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | * Disables recording usage stats for this primitive. | 77 | * Disables recording usage stats for this primitive. |
| 90 | * @deprecated usage of this method is discouraged for most common scenarios. | 78 | * @deprecated usage of this method is discouraged for most common scenarios. |
| 91 | * @return this builder | 79 | * @return this builder | ... | ... |
| ... | @@ -232,7 +232,6 @@ public class ECDeviceStore | ... | @@ -232,7 +232,6 @@ public class ECDeviceStore |
| 232 | availableDevices = storageService.<DeviceId>setBuilder() | 232 | availableDevices = storageService.<DeviceId>setBuilder() |
| 233 | .withName("onos-online-devices") | 233 | .withName("onos-online-devices") |
| 234 | .withSerializer(Serializer.using(KryoNamespaces.API)) | 234 | .withSerializer(Serializer.using(KryoNamespaces.API)) |
| 235 | - .withPartitionsDisabled() | ||
| 236 | .withRelaxedReadConsistency() | 235 | .withRelaxedReadConsistency() |
| 237 | .build() | 236 | .build() |
| 238 | .asDistributedSet(); | 237 | .asDistributedSet(); | ... | ... |
| ... | @@ -198,7 +198,6 @@ public class DistributedPacketStore | ... | @@ -198,7 +198,6 @@ public class DistributedPacketStore |
| 198 | private PacketRequestTracker() { | 198 | private PacketRequestTracker() { |
| 199 | requests = storageService.<TrafficSelector, Set<PacketRequest>>consistentMapBuilder() | 199 | requests = storageService.<TrafficSelector, Set<PacketRequest>>consistentMapBuilder() |
| 200 | .withName("onos-packet-requests") | 200 | .withName("onos-packet-requests") |
| 201 | - .withPartitionsDisabled() | ||
| 202 | .withSerializer(Serializer.using(KryoNamespaces.API)) | 201 | .withSerializer(Serializer.using(KryoNamespaces.API)) |
| 203 | .build(); | 202 | .build(); |
| 204 | } | 203 | } | ... | ... |
| ... | @@ -77,12 +77,6 @@ public class DefaultDistributedSetBuilder<E> extends DistributedSetBuilder<E> { | ... | @@ -77,12 +77,6 @@ public class DefaultDistributedSetBuilder<E> extends DistributedSetBuilder<E> { |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | @Override | 79 | @Override |
| 80 | - public DistributedSetBuilder<E> withPartitionsDisabled() { | ||
| 81 | - mapBuilder.withPartitionsDisabled(); | ||
| 82 | - return this; | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | - @Override | ||
| 86 | public DistributedSetBuilder<E> withMeteringDisabled() { | 80 | public DistributedSetBuilder<E> withMeteringDisabled() { |
| 87 | metering = false; | 81 | metering = false; |
| 88 | return this; | 82 | return this; | ... | ... |
| ... | @@ -116,8 +116,7 @@ public class DistributedLabelResourceStore | ... | @@ -116,8 +116,7 @@ public class DistributedLabelResourceStore |
| 116 | 116 | ||
| 117 | resourcePool = storageService | 117 | resourcePool = storageService |
| 118 | .<DeviceId, LabelResourcePool>consistentMapBuilder() | 118 | .<DeviceId, LabelResourcePool>consistentMapBuilder() |
| 119 | - .withName(POOL_MAP_NAME).withSerializer(SERIALIZER) | 119 | + .withName(POOL_MAP_NAME).withSerializer(SERIALIZER).build(); |
| 120 | - .withPartitionsDisabled().build(); | ||
| 121 | messageHandlingExecutor = Executors | 120 | messageHandlingExecutor = Executors |
| 122 | .newFixedThreadPool(MESSAGE_HANDLER_THREAD_POOL_SIZE, | 121 | .newFixedThreadPool(MESSAGE_HANDLER_THREAD_POOL_SIZE, |
| 123 | groupedThreads("onos/store/flow", | 122 | groupedThreads("onos/store/flow", | ... | ... |
-
Please register or login to post a comment