Renaming Partition{Service, Manager, Event} to IntentPartition{Service, Manager, Event} to better disambiguate between another PartitionService that is responsible for managing datastore partitions
Change-Id: I74d311ae991fb241563a1475ea74a625d8069142
diff --git a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
index 1e5db99..77dbff1 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
@@ -35,7 +35,7 @@
import org.onosproject.net.intent.IntentStore;
import org.onosproject.net.intent.IntentStoreDelegate;
import org.onosproject.net.intent.Key;
-import org.onosproject.net.intent.PartitionService;
+import org.onosproject.net.intent.IntentPartitionService;
import org.onosproject.store.AbstractStore;
import org.onosproject.store.service.MultiValuedTimestamp;
import org.onosproject.store.service.WallClockTimestamp;
@@ -83,7 +83,7 @@
protected StorageService storageService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected PartitionService partitionService;
+ protected IntentPartitionService partitionService;
private final AtomicLong sequenceNumber = new AtomicLong(0);
diff --git a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/IntentPartitionManager.java
similarity index 89%
rename from core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java
rename to core/store/dist/src/main/java/org/onosproject/store/intent/impl/IntentPartitionManager.java
index 09108d2..565c6cf 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/IntentPartitionManager.java
@@ -33,9 +33,9 @@
import org.onosproject.event.EventDeliveryService;
import org.onosproject.event.ListenerRegistry;
import org.onosproject.net.intent.Key;
-import org.onosproject.net.intent.PartitionEvent;
-import org.onosproject.net.intent.PartitionEventListener;
-import org.onosproject.net.intent.PartitionService;
+import org.onosproject.net.intent.IntentPartitionEvent;
+import org.onosproject.net.intent.IntentPartitionEventListener;
+import org.onosproject.net.intent.IntentPartitionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,9 +52,9 @@
*/
@Component(immediate = true)
@Service
-public class PartitionManager implements PartitionService {
+public class IntentPartitionManager implements IntentPartitionService {
- private static final Logger log = LoggerFactory.getLogger(PartitionManager.class);
+ private static final Logger log = LoggerFactory.getLogger(IntentPartitionManager.class);
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected LeadershipService leadershipService;
@@ -74,7 +74,7 @@
private static final String ELECTION_PREFIX = "intent-partition-";
- private ListenerRegistry<PartitionEvent, PartitionEventListener> listenerRegistry;
+ private ListenerRegistry<IntentPartitionEvent, IntentPartitionEventListener> listenerRegistry;
private LeadershipEventListener leaderListener = new InternalLeadershipListener();
private ClusterEventListener clusterListener = new InternalClusterEventListener();
@@ -87,7 +87,7 @@
clusterService.addListener(clusterListener);
listenerRegistry = new ListenerRegistry<>();
- eventDispatcher.addSink(PartitionEvent.class, listenerRegistry);
+ eventDispatcher.addSink(IntentPartitionEvent.class, listenerRegistry);
for (int i = 0; i < NUM_PARTITIONS; i++) {
leadershipService.runForLeadership(getPartitionPath(i));
@@ -101,7 +101,7 @@
public void deactivate() {
executor.shutdownNow();
- eventDispatcher.removeSink(PartitionEvent.class);
+ eventDispatcher.removeSink(IntentPartitionEvent.class);
leadershipService.removeListener(leaderListener);
clusterService.removeListener(clusterListener);
}
@@ -112,7 +112,7 @@
* @param executor scheduled executor service for background tasks
* @return this PartitionManager
*/
- public PartitionManager withScheduledExecutor(ScheduledExecutorService executor) {
+ public IntentPartitionManager withScheduledExecutor(ScheduledExecutorService executor) {
this.executor = executor;
return this;
}
@@ -146,12 +146,12 @@
}
@Override
- public void addListener(PartitionEventListener listener) {
+ public void addListener(IntentPartitionEventListener listener) {
listenerRegistry.addListener(listener);
}
@Override
- public void removeListener(PartitionEventListener listener) {
+ public void removeListener(IntentPartitionEventListener listener) {
listenerRegistry.removeListener(listener);
}
@@ -226,7 +226,7 @@
// See if we need to let some partitions go
scheduleRebalance(0);
- eventDispatcher.post(new PartitionEvent(PartitionEvent.Type.LEADER_CHANGED,
+ eventDispatcher.post(new IntentPartitionEvent(IntentPartitionEvent.Type.LEADER_CHANGED,
leadership.topic()));
}
}