diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-08-19 12:20:33 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-08-19 12:50:00 +0200 |
commit | 3f93e39fbb780f19ce34ea407e0534eea7c1af30 (patch) | |
tree | a3fdebc4cb9f144cd142ccf1f2847a1069323afc | |
parent | 85547046fd9da77e4716f8cff49252ced16eafc3 (diff) |
HONEYCOMB-18 Fixing comments from reviews
Change-Id: Ic0565d601d13b5f50ec3c714a43600e32a7e456b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
-rw-r--r-- | samples/interfaces/mapping/pom.xml | 9 | ||||
-rw-r--r-- | samples/minimal-distribution/pom.xml | 6 | ||||
-rw-r--r-- | v3po/v3po2vpp/pom.xml | 18 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java | 19 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java | 8 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClassifierInitializer.java (renamed from v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java) | 4 | ||||
-rw-r--r-- | vpp-common/minimal-distribution/pom.xml | 8 | ||||
-rw-r--r-- | vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy | 3 | ||||
-rw-r--r-- | vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy | 7 | ||||
-rw-r--r-- | vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy | 2 | ||||
-rw-r--r-- | vpp-integration/minimal-distribution/pom.xml | 6 |
11 files changed, 32 insertions, 58 deletions
diff --git a/samples/interfaces/mapping/pom.xml b/samples/interfaces/mapping/pom.xml index 5cd903acd..d5f6b07ad 100644 --- a/samples/interfaces/mapping/pom.xml +++ b/samples/interfaces/mapping/pom.xml @@ -30,6 +30,7 @@ <properties> <guice.version>4.1.0</guice.version> <guice.config.version>1.2.0</guice.config.version> + <honeycomb.infra.version>1.0.0-SNAPSHOT</honeycomb.infra.version> </properties> <dependencies> @@ -58,22 +59,22 @@ <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>translate-impl</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${honeycomb.infra.version}</version> </dependency> <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>translate-api</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${honeycomb.infra.version}</version> </dependency> <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>notification-api</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${honeycomb.infra.version}</version> </dependency> <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>cfg-init</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${honeycomb.infra.version}</version> </dependency> </dependencies> </project> diff --git a/samples/minimal-distribution/pom.xml b/samples/minimal-distribution/pom.xml index 900d66ae9..5592b981c 100644 --- a/samples/minimal-distribution/pom.xml +++ b/samples/minimal-distribution/pom.xml @@ -30,6 +30,8 @@ <properties> <exec.parameters>-Xms128m -Xmx128m</exec.parameters> <main.class>io.fd.honeycomb.samples.distro.Main</main.class> + <interfaces.mapping.version>1.0.0-SNAPSHOT</interfaces.mapping.version> + <honeycomb.min.distro.version>1.0.0-SNAPSHOT</honeycomb.min.distro.version> </properties> <build> @@ -59,12 +61,12 @@ <dependency> <groupId>io.fd.honeycomb.samples.interfaces</groupId> <artifactId>interfaces-mapping</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${interfaces.mapping.version}</version> </dependency> <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>minimal-distribution</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${honeycomb.min.distro.version}</version> </dependency> </dependencies> diff --git a/v3po/v3po2vpp/pom.xml b/v3po/v3po2vpp/pom.xml index 4848ae949..62fced58d 100644 --- a/v3po/v3po2vpp/pom.xml +++ b/v3po/v3po2vpp/pom.xml @@ -55,30 +55,12 @@ <version>${project.version}</version> </dependency> - <!-- Keepalives --> - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>config-util</artifactId> - <version>0.4.2-Beryllium-SR2</version> - </dependency> - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>threadpool-config-api</artifactId> - <version>0.4.2-Beryllium-SR2</version> - </dependency> - <!----> - <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>translate-impl</artifactId> <version>${project.version}</version> </dependency> <dependency> - <groupId>io.fd.honeycomb.vpp</groupId> - <artifactId>vpp-jvpp-cfg</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>cfg-init</artifactId> <version>${project.version}</version> diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java index aafd0154a..4effb70e3 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/V3poModule.java @@ -24,7 +24,7 @@ import io.fd.honeycomb.notification.ManagedNotificationProducer; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.v3po.cfgattrs.V3poConfiguration; import io.fd.honeycomb.translate.v3po.initializers.InterfacesInitializer; -import io.fd.honeycomb.translate.v3po.initializers.VppClasifierInitializer; +import io.fd.honeycomb.translate.v3po.initializers.VppClassifierInitializer; import io.fd.honeycomb.translate.v3po.initializers.VppInitializer; import io.fd.honeycomb.translate.v3po.notification.InterfaceChangeNotificationProducer; import io.fd.honeycomb.translate.v3po.util.NamingContext; @@ -32,7 +32,6 @@ import io.fd.honeycomb.translate.write.WriterFactory; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import net.jmob.guice.conf.core.ConfigurationModule; -import org.opendaylight.controller.config.threadpool.ScheduledThreadPool; public class V3poModule extends AbstractModule { @@ -53,19 +52,7 @@ public class V3poModule extends AbstractModule { .toInstance(new NamingContext("classify-table-", "classify-table-context")); // Executor needed for keepalives - // TODO-minimal remove the funny wrapper. it is only here because of config subsystem - final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); - bind(ScheduledThreadPool.class).toInstance(new ScheduledThreadPool() { - @Override - public ScheduledExecutorService getExecutor() { - return executor; - } - - @Override - public int getMaxThreadCount() { - return 1; - } - }); + bind(ScheduledExecutorService.class).toInstance(Executors.newScheduledThreadPool(1)); // Readers final Multibinder<ReaderFactory> readerFactoryBinder = Multibinder.newSetBinder(binder(), ReaderFactory.class); @@ -83,7 +70,7 @@ public class V3poModule extends AbstractModule { final Multibinder<DataTreeInitializer> initializerBinder = Multibinder.newSetBinder(binder(), DataTreeInitializer.class); initializerBinder.addBinding().to(InterfacesInitializer.class); - initializerBinder.addBinding().to(VppClasifierInitializer.class); + initializerBinder.addBinding().to(VppClassifierInitializer.class); initializerBinder.addBinding().to(VppInitializer.class); // Notifications 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 f39502c09..d8e4f29b5 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 @@ -28,7 +28,7 @@ import io.fd.honeycomb.translate.v3po.util.ReadTimeoutException; import io.fd.honeycomb.translate.v3po.vppstate.BridgeDomainCustomizer; import io.fd.honeycomb.translate.v3po.vppstate.L2FibEntryCustomizer; import io.fd.honeycomb.translate.v3po.vppstate.VersionCustomizer; -import org.opendaylight.controller.config.threadpool.ScheduledThreadPool; +import java.util.concurrent.ScheduledExecutorService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTable; @@ -50,13 +50,13 @@ public final class VppStateHoneycombReaderFactory implements ReaderFactory, Auto private final FutureJVpp jVpp; private final NamingContext ifcCtx; private final NamingContext bdCtx; - private final ScheduledThreadPool keepaliveExecutor; + private final ScheduledExecutorService keepaliveExecutor; @Inject public VppStateHoneycombReaderFactory(final FutureJVpp jVpp, @Named("interface-context") final NamingContext ifcCtx, @Named("bridge-domain-context") final NamingContext bdCtx, - final ScheduledThreadPool keepaliveExecutorDependency) { + final ScheduledExecutorService keepaliveExecutorDependency) { this.jVpp = jVpp; this.ifcCtx = ifcCtx; this.bdCtx = bdCtx; @@ -75,7 +75,7 @@ public final class VppStateHoneycombReaderFactory implements ReaderFactory, Auto // is truly generic registry.add(new KeepaliveReaderWrapper<>( new GenericReader<>(vppStateId.child(Version.class), new VersionCustomizer(jVpp)), - keepaliveExecutor.getExecutor(), ReadTimeoutException.class, 30, + keepaliveExecutor, ReadTimeoutException.class, 30, // FIXME-minimal trigger jvpp reinitialization here () -> LOG.error("Keepalive failed. VPP is probably DOWN!"))); // BridgeDomains(Structural) diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClassifierInitializer.java index b97586830..038b6caa3 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClasifierInitializer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/initializers/VppClassifierInitializer.java @@ -31,13 +31,13 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** * Initializes vpp-classfier node in config data tree based on operational state. */ -public final class VppClasifierInitializer extends AbstractDataTreeConverter<VppClassifierState, VppClassifier> { +public final class VppClassifierInitializer extends AbstractDataTreeConverter<VppClassifierState, VppClassifier> { private static final InstanceIdentifier<VppClassifierState> OPER_ID = InstanceIdentifier.create(VppClassifierState.class); private static final InstanceIdentifier<VppClassifier> CFG_ID = InstanceIdentifier.create(VppClassifier.class); @Inject - public VppClasifierInitializer(@Named("honeycomb-initializer") @Nonnull final DataBroker bindingDataBroker) { + public VppClassifierInitializer(@Named("honeycomb-initializer") @Nonnull final DataBroker bindingDataBroker) { super(bindingDataBroker, OPER_ID, CFG_ID); } diff --git a/vpp-common/minimal-distribution/pom.xml b/vpp-common/minimal-distribution/pom.xml index 4500a633d..4efe12b54 100644 --- a/vpp-common/minimal-distribution/pom.xml +++ b/vpp-common/minimal-distribution/pom.xml @@ -29,6 +29,7 @@ <properties> <main.class>io.fd.honeycomb.vpp.distro.Main</main.class> + <honeycomb.min.distro.version>1.0.0-SNAPSHOT</honeycomb.min.distro.version> </properties> <build> @@ -75,7 +76,7 @@ <dependency> <groupId>io.fd.honeycomb</groupId> <artifactId>minimal-distribution</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${honeycomb.min.distro.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> @@ -88,11 +89,6 @@ <version>${project.version}</version> </dependency> <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>vpp-jvpp-cfg</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> <groupId>io.fd.vpp</groupId> <artifactId>jvpp</artifactId> <version>16.09-SNAPSHOT</version> diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy index 5016d4e19..e056f38f8 100644 --- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/ContextsReaderFactoryProvider.groovy @@ -21,6 +21,7 @@ import com.google.inject.name.Named import groovy.transform.ToString import groovy.util.logging.Slf4j import io.fd.honeycomb.infra.distro.ProviderTrait +import io.fd.honeycomb.infra.distro.data.context.ContextPipelineModule import io.fd.honeycomb.translate.read.ReaderFactory import org.opendaylight.controller.md.sal.binding.api.DataBroker import io.fd.honeycomb.vpp.context.ContextsReaderFactory @@ -33,7 +34,7 @@ import io.fd.honeycomb.vpp.context.ContextsReaderFactory class ContextsReaderFactoryProvider extends ProviderTrait<ReaderFactory> { @Inject - @Named("honeycomb-context") + @Named(ContextPipelineModule.HONEYCOMB_CONTEXT) DataBroker contextDataBroker def create() { new ContextsReaderFactory(contextDataBroker) } diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy index dfd0c44ae..51bf5be9e 100644 --- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppProvider.groovy @@ -25,6 +25,9 @@ import org.openvpp.jvpp.VppJNIConnection import org.openvpp.jvpp.future.FutureJVpp import org.openvpp.jvpp.future.FutureJVppFacade +/** + * This must be a singleton due to shutdown hook usage. + */ @Slf4j @ToString class JVppProvider extends ProviderTrait<FutureJVpp> { @@ -38,8 +41,8 @@ class JVppProvider extends ProviderTrait<FutureJVpp> { def jVpp = new JVppImpl(connection) // Closing JVpp connection with shutdown hook to erase the connection from VPP so HC will be able - // to connect next time - // TODO is there a safer way than a shutdown hook ? + // to connect next time. If JVM is force closed, this will not be executed and VPP connection + // with name from config will stay open and prevent next startup of HC to success Runtime.addShutdownHook { log.info("Disconnecting from VPP") jVpp.close() diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy index 4c2573ca1..68261c34d 100644 --- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/VppCommonModule.groovy @@ -34,7 +34,7 @@ public final class VppCommonModule extends AbstractModule { bind(FutureJVpp).toProvider(JVppProvider).in(Singleton) - // Naming contexts reader exposing context storage over REST/NETCONF + // Naming contexts reader exposing context storage over REST/HONEYCOMB_NETCONF Multibinder.newSetBinder(binder(), ReaderFactory.class).with { addBinding().toProvider(ContextsReaderFactoryProvider).in(Singleton) } diff --git a/vpp-integration/minimal-distribution/pom.xml b/vpp-integration/minimal-distribution/pom.xml index 80f03f845..6985b3bbb 100644 --- a/vpp-integration/minimal-distribution/pom.xml +++ b/vpp-integration/minimal-distribution/pom.xml @@ -29,6 +29,8 @@ <properties> <main.class>io.fd.honeycomb.vpp.integration.distro.Main</main.class> + <v3po.version>1.0.0-SNAPSHOT</v3po.version> + <vpp.common.min.distro.version>1.0.0-SNAPSHOT</vpp.common.min.distro.version> </properties> <build> @@ -58,12 +60,12 @@ <dependency> <groupId>io.fd.honeycomb.vpp</groupId> <artifactId>minimal-distribution</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${vpp.common.min.distro.version}</version> </dependency> <dependency> <groupId>io.fd.honeycomb.v3po</groupId> <artifactId>v3po2vpp</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>${v3po.version}</version> </dependency> </dependencies> |