Rename class by replacing Store with SubStore
Change-Id: I3775d930f593eab983a8da8a4823bae8d45645cb
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentContinuousResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentContinuousResourceSubStore.java
similarity index 95%
rename from core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentContinuousResourceStore.java
rename to core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentContinuousResourceSubStore.java
index 9afc7a2..e733293 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentContinuousResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentContinuousResourceSubStore.java
@@ -41,11 +41,11 @@
import static org.onosproject.store.resource.impl.ConsistentResourceStore.SERIALIZER;
import static org.onosproject.store.resource.impl.ContinuousResourceAllocation.hasEnoughResource;
-class ConsistentContinuousResourceStore {
+class ConsistentContinuousResourceSubStore {
private ConsistentMap<ContinuousResourceId, ContinuousResourceAllocation> consumers;
private ConsistentMap<DiscreteResourceId, Set<ContinuousResource>> childMap;
- ConsistentContinuousResourceStore(StorageService service) {
+ ConsistentContinuousResourceSubStore(StorageService service) {
this.consumers = service.<ContinuousResourceId, ContinuousResourceAllocation>consistentMapBuilder()
.withName(MapNames.CONTINUOUS_CONSUMER_MAP)
.withSerializer(SERIALIZER)
@@ -59,8 +59,8 @@
ConsistentMapException.class, MAX_RETRIES, RETRY_DELAY);
}
- TransactionalContinuousResourceStore transactional(TransactionContext tx) {
- return new TransactionalContinuousResourceStore(tx);
+ TransactionalContinuousResourceSubStore transactional(TransactionContext tx) {
+ return new TransactionalContinuousResourceSubStore(tx);
}
// computational complexity: O(n) where n is the number of the existing allocations for the resource
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDiscreteResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDiscreteResourceSubStore.java
similarity index 93%
rename from core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDiscreteResourceStore.java
rename to core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDiscreteResourceSubStore.java
index 06b458e..a67ebb2 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDiscreteResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDiscreteResourceSubStore.java
@@ -40,11 +40,11 @@
import static org.onosproject.store.resource.impl.ConsistentResourceStore.RETRY_DELAY;
import static org.onosproject.store.resource.impl.ConsistentResourceStore.SERIALIZER;
-class ConsistentDiscreteResourceStore {
+class ConsistentDiscreteResourceSubStore {
private ConsistentMap<DiscreteResourceId, ResourceConsumerId> consumers;
private ConsistentMap<DiscreteResourceId, Set<DiscreteResource>> childMap;
- ConsistentDiscreteResourceStore(StorageService service) {
+ ConsistentDiscreteResourceSubStore(StorageService service) {
this.consumers = service.<DiscreteResourceId, ResourceConsumerId>consistentMapBuilder()
.withName(MapNames.DISCRETE_CONSUMER_MAP)
.withSerializer(SERIALIZER)
@@ -58,8 +58,8 @@
ConsistentMapException.class, MAX_RETRIES, RETRY_DELAY);
}
- TransactionalDiscreteResourceStore transactional(TransactionContext tx) {
- return new TransactionalDiscreteResourceStore(tx);
+ TransactionalDiscreteResourceSubStore transactional(TransactionContext tx) {
+ return new TransactionalDiscreteResourceSubStore(tx);
}
// computational complexity: O(1)
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentResourceStore.java
index a11aabc..664374c 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentResourceStore.java
@@ -80,13 +80,13 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected StorageService service;
- private ConsistentDiscreteResourceStore discreteStore;
- private ConsistentContinuousResourceStore continuousStore;
+ private ConsistentDiscreteResourceSubStore discreteStore;
+ private ConsistentContinuousResourceSubStore continuousStore;
@Activate
public void activate() {
- discreteStore = new ConsistentDiscreteResourceStore(service);
- continuousStore = new ConsistentContinuousResourceStore(service);
+ discreteStore = new ConsistentDiscreteResourceSubStore(service);
+ continuousStore = new ConsistentContinuousResourceSubStore(service);
log.info("Started");
}
@@ -120,8 +120,8 @@
.filter(x -> x.parent().isPresent())
.collect(Collectors.groupingBy(x -> x.parent().get(), LinkedHashMap::new, Collectors.toList()));
- TransactionalDiscreteResourceStore discreteTxStore = discreteStore.transactional(tx);
- TransactionalContinuousResourceStore continuousTxStore = continuousStore.transactional(tx);
+ TransactionalDiscreteResourceSubStore discreteTxStore = discreteStore.transactional(tx);
+ TransactionalContinuousResourceSubStore continuousTxStore = continuousStore.transactional(tx);
for (Map.Entry<DiscreteResource, List<Resource>> entry : resourceMap.entrySet()) {
DiscreteResourceId parentId = entry.getKey().id();
if (!discreteTxStore.lookup(parentId).isPresent()) {
@@ -154,8 +154,8 @@
TransactionContext tx = service.transactionContextBuilder().build();
tx.begin();
- TransactionalDiscreteResourceStore discreteTxStore = discreteStore.transactional(tx);
- TransactionalContinuousResourceStore continuousTxStore = continuousStore.transactional(tx);
+ TransactionalDiscreteResourceSubStore discreteTxStore = discreteStore.transactional(tx);
+ TransactionalContinuousResourceSubStore continuousTxStore = continuousStore.transactional(tx);
// Look up resources by resource IDs
List<Resource> resources = ids.stream()
.filter(x -> x.parent().isPresent())
@@ -205,8 +205,8 @@
TransactionContext tx = service.transactionContextBuilder().build();
tx.begin();
- TransactionalDiscreteResourceStore discreteTxStore = discreteStore.transactional(tx);
- TransactionalContinuousResourceStore continuousTxStore = continuousStore.transactional(tx);
+ TransactionalDiscreteResourceSubStore discreteTxStore = discreteStore.transactional(tx);
+ TransactionalContinuousResourceSubStore continuousTxStore = continuousStore.transactional(tx);
for (Resource resource : resources) {
if (resource instanceof DiscreteResource) {
if (!discreteTxStore.allocate(consumer.consumerId(), (DiscreteResource) resource)) {
@@ -229,8 +229,8 @@
TransactionContext tx = service.transactionContextBuilder().build();
tx.begin();
- TransactionalDiscreteResourceStore discreteTxStore = discreteStore.transactional(tx);
- TransactionalContinuousResourceStore continuousTxStore = continuousStore.transactional(tx);
+ TransactionalDiscreteResourceSubStore discreteTxStore = discreteStore.transactional(tx);
+ TransactionalContinuousResourceSubStore continuousTxStore = continuousStore.transactional(tx);
for (ResourceAllocation allocation : allocations) {
Resource resource = allocation.resource();
ResourceConsumerId consumerId = allocation.consumerId();
@@ -323,8 +323,8 @@
* @return true if the operation succeeds, false otherwise.
*/
// computational complexity: O(n) where n is the number of the specified value
- private boolean register(TransactionalDiscreteResourceStore discreteTxStore,
- TransactionalContinuousResourceStore continuousTxStore,
+ private boolean register(TransactionalDiscreteResourceSubStore discreteTxStore,
+ TransactionalContinuousResourceSubStore continuousTxStore,
DiscreteResourceId key, List<Resource> values) {
// it's assumed that the passed "values" is non-empty
@@ -352,8 +352,8 @@
* @param values values to be removed
* @return true if the operation succeeds, false otherwise
*/
- private boolean unregister(TransactionalDiscreteResourceStore discreteTxStore,
- TransactionalContinuousResourceStore continuousTxStore,
+ private boolean unregister(TransactionalDiscreteResourceSubStore discreteTxStore,
+ TransactionalContinuousResourceSubStore continuousTxStore,
DiscreteResourceId key, List<Resource> values) {
// it's assumed that the passed "values" is non-empty
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceSubStore.java
similarity index 97%
rename from core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceStore.java
rename to core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceSubStore.java
index 9279e99..c595585 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceSubStore.java
@@ -37,12 +37,12 @@
import static org.onosproject.store.resource.impl.ConsistentResourceStore.SERIALIZER;
import static org.onosproject.store.resource.impl.ContinuousResourceAllocation.hasEnoughResource;
-class TransactionalContinuousResourceStore {
+class TransactionalContinuousResourceSubStore {
private final Logger log = LoggerFactory.getLogger(getClass());
private final TransactionalMap<DiscreteResourceId, Set<ContinuousResource>> childMap;
private final TransactionalMap<ContinuousResourceId, ContinuousResourceAllocation> consumers;
- TransactionalContinuousResourceStore(TransactionContext tx) {
+ TransactionalContinuousResourceSubStore(TransactionContext tx) {
this.childMap = tx.getTransactionalMap(MapNames.CONTINUOUS_CHILD_MAP, SERIALIZER);
this.consumers = tx.getTransactionalMap(MapNames.CONTINUOUS_CONSUMER_MAP, SERIALIZER);
}
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalDiscreteResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalDiscreteResourceSubStore.java
similarity index 97%
rename from core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalDiscreteResourceStore.java
rename to core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalDiscreteResourceSubStore.java
index 83589dc..e8a32eb 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalDiscreteResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalDiscreteResourceSubStore.java
@@ -33,12 +33,12 @@
import static org.onosproject.store.resource.impl.ConsistentResourceStore.SERIALIZER;
-class TransactionalDiscreteResourceStore {
+class TransactionalDiscreteResourceSubStore {
private final Logger log = LoggerFactory.getLogger(getClass());
private final TransactionalMap<DiscreteResourceId, Set<DiscreteResource>> childMap;
private final TransactionalMap<DiscreteResourceId, ResourceConsumerId> consumers;
- TransactionalDiscreteResourceStore(TransactionContext tx) {
+ TransactionalDiscreteResourceSubStore(TransactionContext tx) {
this.childMap = tx.getTransactionalMap(MapNames.DISCRETE_CHILD_MAP, SERIALIZER);
this.consumers = tx.getTransactionalMap(MapNames.DISCRETE_CONSUMER_MAP, SERIALIZER);
}