<reuseForks>false</reuseForks>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/classes/initial/hwvtepsouthbound.cfg</file>
- <type>cfg</type>
- <classifier>config</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
import org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionInvokerImpl;
import org.opendaylight.ovsdb.lib.OvsdbConnection;
import org.opendaylight.ovsdb.utils.mdsal.utils.Scheduler;
-import org.opendaylight.ovsdb.utils.mdsal.utils.ShardStatusMonitor;
import org.opendaylight.serviceutils.upgrade.UpgradeState;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
private HwvtepReconciliationManager hwvtepReconciliationManager;
private final AtomicBoolean registered = new AtomicBoolean(false);
private ListenerRegistration<HwvtepSouthboundProvider> operTopologyRegistration;
- private int shardStatusCheckRetryCount = 1000;
- private UpgradeState upgradeState;
+ private final UpgradeState upgradeState;
@Inject
public HwvtepSouthboundProvider(@Reference final DataBroker dataBroker,
*/
@PostConstruct
public void init() {
- boolean isDatastoreAvailable = false;
- int retryCount = 0;
- try {
- while (retryCount < shardStatusCheckRetryCount) {
- isDatastoreAvailable = ShardStatusMonitor.getShardStatus(ShardStatusMonitor.TOPOLOGY_SHARDS);
- if (isDatastoreAvailable) {
- break;
- }
- LOG.warn("Hwvtep: retrying shard status check for the {} time", ++retryCount);
- Thread.sleep(2000);
- }
- if (isDatastoreAvailable) {
- LOG.info("Hwvtep is UP");
- init2();
- }
- } catch (InterruptedException e) {
- LOG.error("Error in intializing the Hwvtep Southbound ", e);
- }
- }
-
- private void init2() {
LOG.info("HwvtepSouthboundProvider Session Initiated");
txInvoker = new TransactionInvokerImpl(dataBroker);
cm = new HwvtepConnectionManager(dataBroker, txInvoker, entityOwnershipService, ovsdbConnection);
private void registerConfigListenerPostUpgrade() {
if (upgradeState.isUpgradeInProgress()) {
LOG.error("Upgrade is in progress delay config data change listener registration");
- Scheduler.getScheduledExecutorService().schedule(() -> registerConfigListenerPostUpgrade(),
+ Scheduler.getScheduledExecutorService().schedule(this::registerConfigListenerPostUpgrade,
60, TimeUnit.SECONDS);
return;
}
}
}
- public void setShardStatusCheckRetryCount(int retryCount) {
- this.shardStatusCheckRetryCount = retryCount;
- }
-
private static class HwvtepsbPluginInstanceEntityOwnershipListener implements EntityOwnershipListener {
private final HwvtepSouthboundProvider hsp;
private final EntityOwnershipListenerRegistration listenerRegistration;
+++ /dev/null
-/*
- * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.ovsdb.hwvtepsouthbound;
-
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Helper to let Blueprint XML configure {@link HwvtepSouthboundProvider}.
- *
- * @author Chandra Shekar S
- */
-public class HwvtepSouthboundProviderConfigurator {
-
- private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundProviderConfigurator.class);
-
- private static final String SHARD_STATUS_CHECK_RETRY_COUNT = "shard-status-check-retry-count";
-
- private final HwvtepSouthboundProvider hwvtepSouthboundProvider;
-
- public HwvtepSouthboundProviderConfigurator(HwvtepSouthboundProvider hwvtepSouthboundProvider) {
- this.hwvtepSouthboundProvider = hwvtepSouthboundProvider;
- }
-
- public void setShardStatusCheckRetryCount(int retryCount) {
- hwvtepSouthboundProvider.setShardStatusCheckRetryCount(retryCount);
- }
-
-
-
- public void updateConfigParameter(Map<String, Object> configParameters) {
- if (configParameters != null && !configParameters.isEmpty()) {
- LOG.debug("Config parameters received : {}", configParameters.entrySet());
- for (Map.Entry<String, Object> paramEntry : configParameters.entrySet()) {
- if (paramEntry.getKey().equalsIgnoreCase(SHARD_STATUS_CHECK_RETRY_COUNT)) {
- hwvtepSouthboundProvider
- .setShardStatusCheckRetryCount(Integer.parseInt((String) paramEntry.getValue()));
- }
- }
- }
- }
-}
<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
- odl:use-default-for-reference-types="true">
-
- <!-- Read default values at startup and inject to HwvtepSouthboundProvider-->
- <cm:property-placeholder persistent-id="org.opendaylight.ovsdb.hwvtepsouthbound" update-strategy="none">
- <!-- Setting default values, in case hwvtepsouthbound.cfg file is not present
- or config property is commented out. This will be overridden if user
- specify the property in hwvtepsouthbound.cfg file-->
- <cm:default-properties>
- <cm:property name="shard-status-check-retry-count" value="1000"/>
- </cm:default-properties>
- </cm:property-placeholder>
-
- <bean id="hwvtepSouthboundProviderConfigurator"
- class="org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundProviderConfigurator">
- <cm:managed-properties persistent-id="org.opendaylight.ovsdb.hwvtepsouthbound"
- update-strategy="component-managed"
- update-method="updateConfigParameter"/>
- <argument ref="hwvtepSouthboundProvider" />
- <property name="shardStatusCheckRetryCount" value="${shard-status-check-retry-count}"/>
- </bean>
-
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <!-- FIXME: convert these to proper Karaf commands -->
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
<command>
<action class="org.opendaylight.ovsdb.hwvtepsouthbound.TransactionHistoryCmd">
+++ /dev/null
-#********************************************************************************************
-# Boot Time Configuration *
-# Config knob changes will require controller restart *
-#********************************************************************************************
-#HwvtepSouthboundPlugin will check the topology SHARDS for their status to be up.
-#This the retry count to check the topoloy SHARDS status by the HwvtepSouthboundPlugin.
-shard-status-check-retry-count = 1000