From 95788cee33afad5266bbac9233c553945f72d24d Mon Sep 17 00:00:00 2001 From: Pindikura Ravindra Date: Wed, 23 Jan 2019 13:07:22 -0800 Subject: [PATCH] ARROW-4180: [Java] Make CI tests use logback.xml - Add a logback.xml for each project with the default log level set to info. - Set the "verbose" property for git-commit-plugin to false - quieten output from qos.logback by attaching the NopStatusListener - Fix a bunch of doc errors in ArrowBuf.java Author: Pindikura Ravindra Closes #3449 from pravindra/javalog and squashes the following commits: d70649d ARROW-4180: Remove info level for maven (it's the default) 076fbd7 ARROW-4180: update README and add an appender ea3674b ARROW-4180: restore travis.yaml, set info loglevel c3fec21 ARROW-4180: Fix a typo in ci script b567651 ARROW-4180: quieten output from logback fc63176 ARROW-4180: add explicit logback.xml for each project cc3d496 ARROW-4180: Make CI tests use logback.xml --- ci/travis_script_gandiva_java.sh | 2 -- ci/travis_script_java.sh | 3 +- java/README.md | 14 ++++------ .../jdbc/src/test/resources}/logback.xml | 13 ++++----- java/flight/src/test/resources/logback.xml | 3 +- java/gandiva/src/test/resources/logback.xml | 11 +++++++- .../main/java/io/netty/buffer/ArrowBuf.java | 18 ++++++------ java/memory/src/test/resources/logback.xml | 28 +++++++++++++++++++ java/plasma/src/test/resources/logback.xml | 28 +++++++++++++++++++ java/pom.xml | 2 +- java/tools/src/test/resources/logback.xml | 27 ++++++++++++++++++ .../org/apache/arrow/util/AutoCloseables.java | 6 ++-- java/vector/src/test/resources/logback.xml | 28 +++++++++++++++++++ 13 files changed, 148 insertions(+), 35 deletions(-) rename java/{dev => adapter/jdbc/src/test/resources}/logback.xml (84%) create mode 100644 java/memory/src/test/resources/logback.xml create mode 100644 java/plasma/src/test/resources/logback.xml create mode 100644 java/tools/src/test/resources/logback.xml create mode 100644 java/vector/src/test/resources/logback.xml diff --git a/ci/travis_script_gandiva_java.sh b/ci/travis_script_gandiva_java.sh index c187184a34c5c..387be9a092b98 100755 --- a/ci/travis_script_gandiva_java.sh +++ b/ci/travis_script_gandiva_java.sh @@ -24,8 +24,6 @@ JAVA_DIR=${TRAVIS_BUILD_DIR}/java pushd $JAVA_DIR -export MAVEN_OPTS="$MAVEN_OPTS -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" - # build with gandiva profile $TRAVIS_MVN -P gandiva -B install -DskipTests -Dgandiva.cpp.build.dir=$CPP_BUILD_DIR/debug diff --git a/ci/travis_script_java.sh b/ci/travis_script_java.sh index dd5a6b48d5e55..201c336268792 100755 --- a/ci/travis_script_java.sh +++ b/ci/travis_script_java.sh @@ -24,8 +24,7 @@ source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh JAVA_DIR=${TRAVIS_BUILD_DIR}/java pushd $JAVA_DIR -export MAVEN_OPTS="$MAVEN_OPTS -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" -if [ $ARROW_TRAVIS_JAVA_BUILD_ONLY == "1" ]; then +if [ "$ARROW_TRAVIS_JAVA_BUILD_ONLY" == "1" ]; then # Save time and make build less verbose by skipping tests and style checks $TRAVIS_MVN -DskipTests=true -Dcheckstyle.skip=true -B install else diff --git a/java/README.md b/java/README.md index 5a5f4d2c4211a..c69ff88ffa260 100644 --- a/java/README.md +++ b/java/README.md @@ -64,17 +64,13 @@ Refer to `java/dev/checkstyle/checkstyle.xml for rule specifics. ## Test Logging Configuration When running tests, Arrow Java uses the Logback logger with SLF4J. By default, -Logback has a log level set to DEBUG. Besides setting this level -programmatically, it can also be configured with a file named either -"logback.xml" or "logback-test.xml" residing in the classpath. The file -location can also be specified in the Maven command line with the following -option `-Dlogback.configurationFile=file:`. A sample -logback.xml file is available in `java/dev` with a log level of ERROR. Arrow -Java can be built with this file using the following command run in the project -root directory: +it uses the logback.xml present in the corresponding module's src/test/resources +directory, which has the default log level set to INFO. +Arrow Java can be built with an alternate logback configuration file using the +following command run in the project root directory: ```bash -mvn -Dlogback.configurationFile=file:`pwd`/dev/logback.xml +mvn -Dlogback.configurationFile=file: ``` See [Logback Configuration][1] for more details. diff --git a/java/dev/logback.xml b/java/adapter/jdbc/src/test/resources/logback.xml similarity index 84% rename from java/dev/logback.xml rename to java/adapter/jdbc/src/test/resources/logback.xml index 10d54806b184a..4c54d18a210ff 100644 --- a/java/dev/logback.xml +++ b/java/adapter/jdbc/src/test/resources/logback.xml @@ -1,3 +1,4 @@ + - - - + @@ -23,7 +20,9 @@ $ mvn -Dlogback.configurationFile=file:${ARROW_HOME}/java/dev/logback.xml test - + + - + + diff --git a/java/flight/src/test/resources/logback.xml b/java/flight/src/test/resources/logback.xml index e409e92b6fae1..444b2ed6d8392 100644 --- a/java/flight/src/test/resources/logback.xml +++ b/java/flight/src/test/resources/logback.xml @@ -11,6 +11,7 @@ language governing permissions and limitations under the License. --> + true @@ -24,4 +25,4 @@ - \ No newline at end of file + diff --git a/java/gandiva/src/test/resources/logback.xml b/java/gandiva/src/test/resources/logback.xml index 9e23b555feec3..f9e449fa67b2e 100644 --- a/java/gandiva/src/test/resources/logback.xml +++ b/java/gandiva/src/test/resources/logback.xml @@ -11,9 +11,18 @@ language governing permissions and limitations under the License. --> + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + - + diff --git a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java index bfe97015f1218..5d37df59acfb1 100644 --- a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java +++ b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java @@ -791,7 +791,7 @@ protected short _getShort(int index) { } /** - * @see {@link #getShortLE(int)}. + * @see ArrowBuf#getShortLE(int). */ @Override protected short _getShortLE(int index) { @@ -804,7 +804,7 @@ protected int _getInt(int index) { } /** - * @see {@link #getIntLE(int)}. + * @see ArrowBuf#getIntLE(int). */ @Override protected int _getIntLE(int index) { @@ -812,7 +812,7 @@ protected int _getIntLE(int index) { } /** - * @see {@link #getUnsignedMedium(int)}. + * @see ArrowBuf#getUnsignedMedium(int). */ @Override protected int _getUnsignedMedium(int index) { @@ -820,7 +820,7 @@ protected int _getUnsignedMedium(int index) { } /** - * @see {@link #getUnsignedMediumLE(int)}. + * @see ArrowBuf#getUnsignedMediumLE(int). */ @Override protected int _getUnsignedMediumLE(int index) { @@ -833,7 +833,7 @@ protected long _getLong(int index) { } /** - * @see {@link #getLongLE(int)}. + * @see ArrowBuf#getLongLE(int). */ @Override protected long _getLongLE(int index) { @@ -851,7 +851,7 @@ protected void _setShort(int index, int value) { } /** - * @see {@link #setShortLE(int, int)}. + * @see ArrowBuf#setShortLE(int, int). */ @Override protected void _setShortLE(int index, int value) { @@ -864,7 +864,7 @@ protected void _setMedium(int index, int value) { } /** - * @see {@link #setMediumLE(int, int)}. + * @see ArrowBuf#setMediumLE(int, int). */ @Override protected void _setMediumLE(int index, int value) { @@ -877,7 +877,7 @@ protected void _setInt(int index, int value) { } /** - * @see {@link #setIntLE(int, int)}. + * @see ArrowBuf#setIntLE(int, int). */ @Override protected void _setIntLE(int index, int value) { @@ -890,7 +890,7 @@ protected void _setLong(int index, long value) { } /** - * @see {@link #setLongLE(int, long)}. + * @see ArrowBuf#setLongLE(int, long). */ @Override public void _setLongLE(int index, long value) { diff --git a/java/memory/src/test/resources/logback.xml b/java/memory/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/memory/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/plasma/src/test/resources/logback.xml b/java/plasma/src/test/resources/logback.xml new file mode 100644 index 0000000000000..4c54d18a210ff --- /dev/null +++ b/java/plasma/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + diff --git a/java/pom.xml b/java/pom.xml index 28519b6ce8283..96385c0521733 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -261,7 +261,7 @@ dd.MM.yyyy '@' HH:mm:ss z - true + false false true false diff --git a/java/tools/src/test/resources/logback.xml b/java/tools/src/test/resources/logback.xml new file mode 100644 index 0000000000000..ff848da2a8be1 --- /dev/null +++ b/java/tools/src/test/resources/logback.xml @@ -0,0 +1,27 @@ + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + diff --git a/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java b/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java index d89478ecc709c..2f6ee9fb52ea6 100644 --- a/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java +++ b/java/vector/src/main/java/org/apache/arrow/util/AutoCloseables.java @@ -172,10 +172,10 @@ public static RollbackCloseable rollbackable(AutoCloseable... closeables) { } /** - * close() an {@see java.lang.AutoCloseable} without throwing a (checked) - * {@see java.lang.Exception}. This wraps the close() call with a + * close() an {@link java.lang.AutoCloseable} without throwing a (checked) + * {@link java.lang.Exception}. This wraps the close() call with a * try-catch that will rethrow an Exception wrapped with a - * {@see java.lang.RuntimeException}, providing a way to call close() + * {@link java.lang.RuntimeException}, providing a way to call close() * without having to do the try-catch everywhere or propagate the Exception. * * @param autoCloseable the AutoCloseable to close; may be null diff --git a/java/vector/src/test/resources/logback.xml b/java/vector/src/test/resources/logback.xml new file mode 100644 index 0000000000000..f9e449fa67b2e --- /dev/null +++ b/java/vector/src/test/resources/logback.xml @@ -0,0 +1,28 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + +