}
}
- private void initializeHwvtepTopology(LogicalDatastoreType type) {
+ private void initializeHwvtepTopology(final LogicalDatastoreType type) {
InstanceIdentifier<Topology> path = InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID));
}
}
- public void handleOwnershipChange(EntityOwnershipChange ownershipChange) {
+ public void handleOwnershipChange(final EntityOwnershipChange ownershipChange) {
if (ownershipChange.getState().isOwner()) {
LOG.info("*This* instance of HWVTEP southbound provider is set as a MASTER instance");
LOG.info("Initialize HWVTEP topology {} in operational and config data store if not already present",
@Override
- public void onDataTreeChanged(Collection<DataTreeModification<Topology>> collection) {
+ public void onDataTreeChanged(final Collection<DataTreeModification<Topology>> collection) {
if (!registered.getAndSet(true)) {
LOG.info("Starting the ovsdb port");
ovsdbConnection.registerConnectionListener(cm);
ovsdbConnection.startOvsdbManager();
}
- //mdsal registration/deregistration in mdsal update callback should be avoided
- new Thread(() -> {
- if (operTopologyRegistration != null) {
- operTopologyRegistration.close();
- operTopologyRegistration = null;
- }
- }).start();
+
+ if (operTopologyRegistration != null) {
+ operTopologyRegistration.close();
+ operTopologyRegistration = null;
+ }
}
private static class HwvtepsbPluginInstanceEntityOwnershipListener implements EntityOwnershipListener {
private final HwvtepSouthboundProvider hsp;
private final EntityOwnershipListenerRegistration listenerRegistration;
- HwvtepsbPluginInstanceEntityOwnershipListener(HwvtepSouthboundProvider hsp,
- EntityOwnershipService entityOwnershipService) {
+ HwvtepsbPluginInstanceEntityOwnershipListener(final HwvtepSouthboundProvider hsp,
+ final EntityOwnershipService entityOwnershipService) {
this.hsp = hsp;
listenerRegistration = entityOwnershipService.registerListener(ENTITY_TYPE, this);
}
}
@Override
- public void ownershipChanged(EntityOwnershipChange ownershipChange) {
+ public void ownershipChanged(final EntityOwnershipChange ownershipChange) {
hsp.handleOwnershipChange(ownershipChange);
}
}