You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/01/18 01:00:52 UTC

[kudu] branch master updated (4bf7e45 -> e6ac218)

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git.


    from 4bf7e45  [client] support resolve one master address to multiple addresses
     new 9106a3c  webserver: use faster gzip compression
     new e6ac218  [build] Fix Java build on JDK 13

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/gradle/dependencies.gradle |  2 +-
 java/gradle/quality.gradle      | 41 +++++++++++++++++++++++------------------
 src/kudu/server/webserver.cc    |  2 +-
 src/kudu/util/zlib.cc           |  6 +++++-
 src/kudu/util/zlib.h            |  4 ++++
 5 files changed, 34 insertions(+), 21 deletions(-)


[kudu] 02/02: [build] Fix Java build on JDK 13

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit e6ac21838acf077b617bc8829511045dff3c859b
Author: Grant Henke <gr...@apache.org>
AuthorDate: Fri Jan 17 13:25:05 2020 -0600

    [build] Fix Java build on JDK 13
    
    This patch fixes build issues on JDK 13. It disables errorprone
    due to compatibility issues and upgrades the SpotBugs
    dependency.
    
    Some tests still fail due to dependency incompatibility with Java 13:
    - All Spark/Scala related tests
    — kudu-spark, kudu-spark-tools, kudu-backup
    - All Hive related tests
    — kudu-hive, kudu-client:testHiveMetastoreIntegration
    
    Change-Id: Ic67dd66e64e7fda88a58cb9eae8821f5f3cf08bb
    Reviewed-on: http://gerrit.cloudera.org:8080/15066
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 java/gradle/dependencies.gradle |  2 +-
 java/gradle/quality.gradle      | 41 +++++++++++++++++++++++------------------
 2 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/java/gradle/dependencies.gradle b/java/gradle/dependencies.gradle
index 76cc8cd..67b42a7 100755
--- a/java/gradle/dependencies.gradle
+++ b/java/gradle/dependencies.gradle
@@ -56,7 +56,7 @@ versions += [
     scopt          : "3.7.1",
     slf4j          : "1.7.29",
     spark          : "2.4.4",
-    spotBugs       : "3.1.12",
+    spotBugs       : "4.0.0-beta1",
     yetus          : "0.11.1"
 ]
 
diff --git a/java/gradle/quality.gradle b/java/gradle/quality.gradle
index 4a75071..640f9fa 100644
--- a/java/gradle/quality.gradle
+++ b/java/gradle/quality.gradle
@@ -22,7 +22,6 @@ apply plugin: "com.github.spotbugs"   // Performs static code analysis to look f
 apply plugin: "com.github.ben-manes.versions" // Provides a task to determine which dependencies have updates.
 apply plugin: "ru.vyarus.animalsniffer" // Ensures Java code uses APIs from a particular version of Java.
 apply plugin: "scalafmt" // Automatically formats Scala code on each build.
-apply plugin: "net.ltgt.errorprone" // Performs static code analysis to look for bugs in Java code.
 
 checkstyle {
   toolVersion = versions.checkstyle
@@ -69,25 +68,31 @@ tasks.withType(ScalaCompile) {
   }
 }
 
-// Configure error-prone.
-// Running with '-Derrorprone-fix=...' can instruct error-prone to automatically fix issues.
-tasks.withType(JavaCompile) {
-  options.errorprone {
-    disableWarningsInGeneratedCode = true
-    excludedPaths = '.*/build/generated.*/.*'
-    allErrorsAsWarnings = true
-    def fix = propertyWithDefault("errorprone-fix", "")
-    if (!fix.isEmpty()) {
-      errorproneArgs += ['-XepPatchChecks:' + fix, '-XepPatchLocation:IN_PLACE']
+// Errorprone doesn't support Java 12+
+// https://github.com/google/error-prone/issues/1106
+if(!JavaVersion.current().isJava12Compatible()) {
+  apply plugin: "net.ltgt.errorprone" // Performs static code analysis to look for bugs in Java code.
+
+  // Configure error-prone.
+  // Running with '-Derrorprone-fix=...' can instruct error-prone to automatically fix issues.
+  tasks.withType(JavaCompile) {
+    options.errorprone {
+      disableWarningsInGeneratedCode = true
+      excludedPaths = '.*/build/generated.*/.*'
+      allErrorsAsWarnings = true
+      def fix = propertyWithDefault("errorprone-fix", "")
+      if (!fix.isEmpty()) {
+        errorproneArgs += ['-XepPatchChecks:' + fix, '-XepPatchLocation:IN_PLACE']
+      }
     }
   }
-}
-dependencies {
-  // Set a specific version of Error Prone
-  errorprone libs.errorProne
-  // Configure Error Prone to use it's own static javac as described here:
-  // https://github.com/tbroyer/gradle-errorprone-plugin#jdk-8-support
-  errorproneJavac libs.errorProneJavac
+  dependencies {
+    // Set a specific version of Error Prone
+    errorprone libs.errorProne
+    // Configure Error Prone to use it's own static javac as described here:
+    // https://github.com/tbroyer/gradle-errorprone-plugin#jdk-8-support
+    errorproneJavac libs.errorProneJavac
+  }
 }
 
 // Define a Java API signature for use by animal-sniffer. It'll enforce that all


[kudu] 01/02: webserver: use faster gzip compression

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 9106a3ca8d5b44a8305cb01a012064358bf5dcb9
Author: Todd Lipcon <to...@apache.org>
AuthorDate: Wed Jan 15 01:26:31 2020 -0800

    webserver: use faster gzip compression
    
    If an HTTP client indicates that it supports gzip, we gzip-compress the
    web response. This can be beneficial over slow links, but the default
    gzip compression level is pretty slow. This changes the gzip compression
    to use the fastest level, which is several times faster, without that
    much loss in space.
    
    Change-Id: If97d883483a7313bd5496af68b17e968a5223b1a
    Reviewed-on: http://gerrit.cloudera.org:8080/15059
    Tested-by: Kudu Jenkins
    Reviewed-by: Todd Lipcon <to...@apache.org>
---
 src/kudu/server/webserver.cc | 2 +-
 src/kudu/util/zlib.cc        | 6 +++++-
 src/kudu/util/zlib.h         | 4 ++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/kudu/server/webserver.cc b/src/kudu/server/webserver.cc
index 3dad6d7..f0c9861 100644
--- a/src/kudu/server/webserver.cc
+++ b/src/kudu/server/webserver.cc
@@ -626,7 +626,7 @@ void Webserver::SendResponse(struct sq_connection* connection,
       }
 
       ostringstream oss;
-      Status s = zlib::Compress(uncompressed, &oss);
+      Status s = zlib::CompressLevel(uncompressed, 1, &oss);
       if (s.ok()) {
         resp->output.str(oss.str());
         is_compressed = true;
diff --git a/src/kudu/util/zlib.cc b/src/kudu/util/zlib.cc
index 4805885..702e6f6 100644
--- a/src/kudu/util/zlib.cc
+++ b/src/kudu/util/zlib.cc
@@ -70,9 +70,13 @@ Status ZlibResultToStatus(int rc) {
 } // anonymous namespace
 
 Status Compress(Slice input, ostream* out) {
+  return CompressLevel(input, Z_DEFAULT_COMPRESSION, out);
+}
+
+Status CompressLevel(Slice input, int level, ostream* out) {
   z_stream zs;
   memset(&zs, 0, sizeof(zs));
-  ZRETURN_NOT_OK(deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
+  ZRETURN_NOT_OK(deflateInit2(&zs, level, Z_DEFLATED,
                               15 + 16 /* 15 window bits, enable gzip */,
                               8 /* memory level, max is 9 */,
                               Z_DEFAULT_STRATEGY));
diff --git a/src/kudu/util/zlib.h b/src/kudu/util/zlib.h
index 35330fd..478382b 100644
--- a/src/kudu/util/zlib.h
+++ b/src/kudu/util/zlib.h
@@ -29,6 +29,10 @@ namespace zlib {
 // In case of an error, some data may still be appended to 'out'.
 Status Compress(Slice input, std::ostream* out);
 
+// The same as the above, but with a custom level (1-9, where 1 is fastest
+// and 9 is best compression).
+Status CompressLevel(Slice input, int level, std::ostream* out);
+
 // Uncompress the zlib-compressed data in 'compressed', appending the result
 // to 'out'.
 //