summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-09-06 12:03:32 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-08 07:47:06 +0200
commit064155d371e7408ec6c7580a1408402d720c6b15 (patch)
treee1e0cd07885b27e78c318e9c724eb53daf69adfb /v3po/v3po2vpp
parentb589b5bb6fc4b88f74710010782b155c80433740 (diff)
HONEYCOMB-78: enable HC restart
Includes: - restart script for honeycomb - HONEYCOMBC-78 fix: jVPPRegistry.close() is not invoked in case of VPP restart. That prevents subsequent attempts to establish connection from failing (we cannot invoke vl_client_disconnect_from_vlib before connect_to_vpe on fresh vpp instance). Change-Id: Icf4d6a6a40605ed34d307a0f1405b8804ba5df53 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java
index 75779d949..1c28fbf4a 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java
@@ -25,6 +25,7 @@ import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.util.read.KeepaliveReaderWrapper;
import io.fd.honeycomb.translate.v3po.util.NamingContext;
import io.fd.honeycomb.translate.v3po.util.ReadTimeoutException;
+import io.fd.honeycomb.translate.v3po.util.VppStatusListener;
import io.fd.honeycomb.translate.v3po.vppstate.BridgeDomainCustomizer;
import io.fd.honeycomb.translate.v3po.vppstate.L2FibEntryCustomizer;
import io.fd.honeycomb.translate.v3po.vppstate.VersionCustomizer;
@@ -40,27 +41,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.openvpp.jvpp.core.future.FutureJVppCore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public final class VppStateHoneycombReaderFactory implements ReaderFactory {
- private static final Logger LOG = LoggerFactory.getLogger(VppStateHoneycombReaderFactory.class);
-
private final FutureJVppCore jVpp;
private final NamingContext ifcCtx;
private final NamingContext bdCtx;
private final ScheduledExecutorService keepaliveExecutor;
+ private final VppStatusListener vppStatusListener;
@Inject
public VppStateHoneycombReaderFactory(final FutureJVppCore jVpp,
@Named("interface-context") final NamingContext ifcCtx,
@Named("bridge-domain-context") final NamingContext bdCtx,
- final ScheduledExecutorService keepaliveExecutorDependency) {
+ final ScheduledExecutorService keepaliveExecutorDependency,
+ final VppStatusListener vppStatusListener) {
this.jVpp = jVpp;
this.ifcCtx = ifcCtx;
this.bdCtx = bdCtx;
this.keepaliveExecutor = keepaliveExecutorDependency;
+ this.vppStatusListener = vppStatusListener;
}
@Override
@@ -73,9 +73,7 @@ public final class VppStateHoneycombReaderFactory implements ReaderFactory {
// Relying on VersionCustomizer to provide a "timing out read"
registry.add(new KeepaliveReaderWrapper<>(
new GenericReader<>(vppStateId.child(Version.class), new VersionCustomizer(jVpp)),
- keepaliveExecutor, ReadTimeoutException.class, 30,
- // FIXME HONEYCOMB-78 trigger jvpp reinitialization here
- () -> LOG.error("Keepalive failed. VPP is probably DOWN!")));
+ keepaliveExecutor, ReadTimeoutException.class, 30, vppStatusListener));
// BridgeDomains(Structural)
final InstanceIdentifier<BridgeDomains> bridgeDomainsId = vppStateId.child(BridgeDomains.class);
registry.addStructuralReader(bridgeDomainsId, BridgeDomainsBuilder.class);