Michael Blow has submitted this change and it was merged. Change subject: [NO ISSUE][OTH] IApplication interface change to allow configuring loggers ......................................................................
[NO ISSUE][OTH] IApplication interface change to allow configuring loggers - user model changes: no - storage format changes: no - interface changes: yes Added configureLoggingLevel() as part of the IApplication to allow configuring the application loggers. Change-Id: Ib9724d9f12650f8e2c1f9d25c098028c75da7606 Reviewed-on: https://asterix-gerrit.ics.uci.edu/3281 Reviewed-by: Till Westmann <[email protected]> Tested-by: Till Westmann <[email protected]> --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java M asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/IApplication.java M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java M hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/pom.xml M hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/TestNCApplication.java 7 files changed, 24 insertions(+), 4 deletions(-) Approvals: Anon. E. Moose #1000171: Till Westmann: Looks good to me, approved; Verified diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java index a5fd063..1529ff5 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java @@ -196,7 +196,7 @@ } @Override - protected void configureLoggingLevel(Level level) { + public void configureLoggingLevel(Level level) { super.configureLoggingLevel(level); LoggingConfigUtil.defaultIfMissing(GlobalConfig.ASTERIX_LOGGER_NAME, level); } diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java index fbafc2e..80f7f10 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java @@ -157,7 +157,7 @@ } @Override - protected void configureLoggingLevel(Level level) { + public void configureLoggingLevel(Level level) { super.configureLoggingLevel(level); LoggingConfigUtil.defaultIfMissing(GlobalConfig.ASTERIX_LOGGER_NAME, level); } diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/IApplication.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/IApplication.java index 1d22f85..bbc7163 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/IApplication.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/IApplication.java @@ -19,10 +19,12 @@ package org.apache.hyracks.api.application; import org.apache.hyracks.api.config.IConfigManager; +import org.apache.logging.log4j.Level; import org.kohsuke.args4j.OptionHandlerFilter; @SuppressWarnings("squid:S00112") // define and throw specific class of Exception public interface IApplication { + void init(IServiceContext serviceCtx) throws Exception; void start(String[] args) throws Exception; @@ -38,4 +40,11 @@ default OptionHandlerFilter getUsageFilter() { return OptionHandlerFilter.PUBLIC; } + + /** + * Configures the application loggers with the given level. + * + * @param level the logging level desired. + */ + void configureLoggingLevel(Level level); } diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java index 46adda3..fbce29d 100644 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java @@ -83,7 +83,8 @@ return null; } - protected void configureLoggingLevel(Level level) { + @Override + public void configureLoggingLevel(Level level) { LoggingConfigUtil.defaultIfMissing(HyracksConstants.HYRACKS_LOGGER_NAME, level); } diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java index 800721c..60bca54e 100644 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java @@ -98,7 +98,8 @@ return new DefaultDeviceResolver(); } - protected void configureLoggingLevel(Level level) { + @Override + public void configureLoggingLevel(Level level) { LoggingConfigUtil.defaultIfMissing(HyracksConstants.HYRACKS_LOGGER_NAME, level); } diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/pom.xml b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/pom.xml index 88ca7b7..7dd3995 100644 --- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/pom.xml +++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/pom.xml @@ -58,6 +58,10 @@ <artifactId>hyracks-storage-common</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + </dependency> </dependencies> <build> diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/TestNCApplication.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/TestNCApplication.java index b13feda..daeaba3 100644 --- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/TestNCApplication.java +++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreehelper/src/main/java/org/apache/hyracks/examples/btree/helper/TestNCApplication.java @@ -25,6 +25,7 @@ import org.apache.hyracks.api.control.CcId; import org.apache.hyracks.api.io.IFileDeviceResolver; import org.apache.hyracks.api.job.resource.NodeCapacity; +import org.apache.logging.log4j.Level; public class TestNCApplication implements INCApplication { @@ -80,4 +81,8 @@ return null; } + @Override + public void configureLoggingLevel(Level level) { + // No-op + } } -- To view, visit https://asterix-gerrit.ics.uci.edu/3281 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9724d9f12650f8e2c1f9d25c098028c75da7606 Gerrit-PatchSet: 4 Gerrit-Project: asterixdb Gerrit-Branch: stabilization-f69489 Gerrit-Owner: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]>
