diff options
Diffstat (limited to 'infra/cfg-init/src')
6 files changed, 6 insertions, 38 deletions
diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/AbstractDataTreeConverter.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/AbstractDataTreeConverter.java index 74cdc3058..5476bb423 100644 --- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/AbstractDataTreeConverter.java +++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/AbstractDataTreeConverter.java @@ -55,13 +55,6 @@ public abstract class AbstractDataTreeConverter<O extends DataObject, C extends } @Override - public void close() throws Exception { - LOG.debug("AbstractDataTreeConverter.close()"); - // Not removing initialized data, since this works in cooperation with persistence, it could remove - // data restored by persistence or remove user configured data when shutting down HC - } - - @Override public final void initialize() throws InitializeException { LOG.debug("AbstractDataTreeConverter.initialize() from(oper): {}, to(cfg): {}", idOper, idConfig); final Optional<O> data = readData(); diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/DataTreeInitializer.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/DataTreeInitializer.java index c0ff8c2be..c5ef1e819 100644 --- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/DataTreeInitializer.java +++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/DataTreeInitializer.java @@ -24,7 +24,7 @@ import com.google.common.annotations.Beta; * Initialization does not cause any change in VPP state, unlike ordinary writes to config. */ @Beta -public interface DataTreeInitializer extends AutoCloseable { +public interface DataTreeInitializer { /** * Initializes config data tree for supported root node. @@ -32,12 +32,6 @@ public interface DataTreeInitializer extends AutoCloseable { */ void initialize() throws InitializeException; - /** - * Removes all data managed by the initializer. - */ - @Override - void close() throws Exception; - class InitializeException extends Exception { public InitializeException(final String message, final Throwable cause) { diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistry.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistry.java index b662a4fae..f2e12a36a 100644 --- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistry.java +++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistry.java @@ -25,8 +25,9 @@ import com.google.common.annotations.Beta; public interface InitializerRegistry extends DataTreeInitializer { /** - * Performs initialize on all registered root initializers. - * @throws if initialization failed + * Performs initialize on all registered root intializers. + * + * @throws InitializeException if initialization failed */ @Override void initialize() throws InitializeException; diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistryImpl.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistryImpl.java index b83dd1e04..2433130a9 100644 --- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistryImpl.java +++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/InitializerRegistryImpl.java @@ -34,14 +34,6 @@ public class InitializerRegistryImpl implements InitializerRegistry { } @Override - public void close() throws Exception { - LOG.debug("InitializerRegistryImpl.close()"); - for (DataTreeInitializer initializer : initializers) { - initializer.close(); - } - } - - @Override public void initialize() throws InitializeException { // TODO check if readers are there LOG.debug("InitializerRegistryImpl.initialize()"); diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java index c4033a98c..ed517b4f0 100644 --- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java +++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java @@ -69,7 +69,7 @@ public class RestoringInitializer implements DataTreeInitializer { @Override public void initialize() throws InitializeException { LOG.debug("Starting restoration of {} from {} using {}", dataTree, path, restorationType); - if(!Files.exists(path)) { + if (!Files.exists(path)) { LOG.debug("Persist file {} does not exist. Skipping restoration", path); return; } @@ -106,11 +106,8 @@ public class RestoringInitializer implements DataTreeInitializer { } } - @Override - public void close() {} - /** - * Type of operation to use when writing restored data + * Type of operation to use when writing restored data. */ public static enum RestorationType { Put, Merge diff --git a/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/InitializerRegistryImplTest.java b/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/InitializerRegistryImplTest.java index 009b7c9b4..08d5d66e0 100644 --- a/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/InitializerRegistryImplTest.java +++ b/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/InitializerRegistryImplTest.java @@ -54,13 +54,4 @@ public class InitializerRegistryImplTest { verify(dti2).initialize(); verify(dti3).initialize(); } - - @Test - public void testClose() throws Exception { - initializerRegistry.close(); - - verify(dti1).close(); - verify(dti2).close(); - verify(dti3).close(); - } }
\ No newline at end of file |