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 /v3po | |
parent | 85547046fd9da77e4716f8cff49252ced16eafc3 (diff) |
HONEYCOMB-18 Fixing comments from reviews
Change-Id: Ic0565d601d13b5f50ec3c714a43600e32a7e456b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po')
-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 |
4 files changed, 9 insertions, 40 deletions
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); } |