kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject kudu git commit: [Java] Add Yetus doclet to Gradle build
Date Fri, 13 Apr 2018 18:35:27 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 0d167529a -> 0ddb860d0


[Java] Add Yetus doclet to Gradle build

- Adds the yetus doclet to the gradle build
- Adds missing interface annotations
- Fixes a couple leaked SLF4J Loggers that are
  also documented.

Change-Id: I283a3ccb8003356c875c603c9169d68a66b45804
Reviewed-on: http://gerrit.cloudera.org:8080/10059
Reviewed-by: Adar Dembo <adar@cloudera.com>
Reviewed-by: Dan Burkert <danburkert@apache.org>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/0ddb860d
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/0ddb860d
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/0ddb860d

Branch: refs/heads/master
Commit: 0ddb860d0f331fa79617ae192b62cae6c653c3a9
Parents: 0d16752
Author: Grant Henke <granthenke@apache.org>
Authored: Fri Apr 13 11:11:14 2018 -0500
Committer: Grant Henke <granthenke@apache.org>
Committed: Fri Apr 13 18:33:02 2018 +0000

----------------------------------------------------------------------
 java/build.gradle                               | 25 +++++++++----
 java/gradle/compile.gradle                      |  8 -----
 java/gradle/docs.gradle                         | 38 ++++++++++++++++++++
 .../main/java/org/apache/kudu/ColumnSchema.java |  4 +++
 .../org/apache/kudu/client/AsyncKuduClient.java |  2 +-
 .../java/org/apache/kudu/client/KuduClient.java |  2 +-
 .../org/apache/kudu/client/KuduSession.java     |  3 +-
 .../java/org/apache/kudu/util/DecimalUtil.java  |  2 ++
 java/kudu-hive/build.gradle                     |  6 ++++
 9 files changed, 72 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/build.gradle
----------------------------------------------------------------------
diff --git a/java/build.gradle b/java/build.gradle
index 51fb517..30c3cd6 100755
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -17,6 +17,8 @@
 
 // This file is the entry-point for the gradle build and contains
 // common logic for the various subprojects in the build.
+// Plugins and scripts are applied in the natural "build order"
+// they are used to ensure there are no dependency issues.
 
 // Plugins and scripts applied at the root level only, instead of per module.
 apply plugin: "idea"
@@ -25,9 +27,18 @@ apply from: "$rootDir/gradle/properties.gradle"
 apply from: "$rootDir/gradle/dependencies.gradle"
 apply from: "$rootDir/gradle/wrapper.gradle"
 
+allprojects {
+  // These are common to all projects, including this
+  // top level parent project.
+  repositories {
+    mavenCentral()
+    mavenLocal()
+  }
+
+  apply from: "$rootDir/gradle/docs.gradle"
+}
+
 subprojects {
-  // Plugins and scripts are applied in the natural "build order"
-  // they are used to ensure there are no dependency issues.
   // These are common to all subprojects. However, subprojects may
   // include their own plugins and scripts as well.
   apply plugin: "java"
@@ -37,9 +48,11 @@ subprojects {
   apply from: "$rootDir/gradle/quality.gradle"
   apply from: "$rootDir/gradle/artifacts.gradle"
   apply from: "$rootDir/gradle/publishing.gradle"
+}
 
-  repositories {
-    mavenCentral()
-    mavenLocal()
-  }
+task javadocAggregate(type: Javadoc, group: "Documentation") {
+  description = "Generates Aggregate Javadoc API documentation for the main source code."
+  source subprojects.collect { it.sourceSets.main.allJava }
+  classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath })
+  destinationDir = file("${buildDir}/docs/javadoc")
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/gradle/compile.gradle
----------------------------------------------------------------------
diff --git a/java/gradle/compile.gradle b/java/gradle/compile.gradle
index 44d011c..1e42acf 100644
--- a/java/gradle/compile.gradle
+++ b/java/gradle/compile.gradle
@@ -25,14 +25,6 @@ tasks.withType(JavaCompile) {
   options.incremental = true // enable incremental compilation.
 }
 
-// Javadoc Configuration
-tasks.withType(Javadoc) {
-  if (JavaVersion.current().isJava8Compatible()) {
-    // Disable the super-strict doclint tool in Java 8+
-    options.addStringOption('Xdoclint:none', '-quiet')
-  }
-}
-
 // Scala configuration
 tasks.withType(ScalaCompile) {
   sourceCompatibility = javaCompatibility

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/gradle/docs.gradle
----------------------------------------------------------------------
diff --git a/java/gradle/docs.gradle b/java/gradle/docs.gradle
new file mode 100644
index 0000000..deb2aea
--- /dev/null
+++ b/java/gradle/docs.gradle
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// This file contains common tasks and configuration for documentation generation.
+
+configurations {
+  doclet
+}
+
+dependencies {
+  doclet "org.apache.yetus:audience-annotations:0.7.0"
+}
+
+// Javadoc Configuration
+tasks.withType(Javadoc) {
+  // Configure the Yetus doclet
+  options.docletpath = configurations.doclet.files.asType(List)
+  options.doclet = "org.apache.yetus.audience.tools.IncludePublicAnnotationsStandardDoclet"
+  // Link to Java SE javadoc
+  options.links "https://docs.oracle.com/javase/7/docs/api/"
+  // Hacky workaround to YETUS-627. Replace with options.noTimestamp
+  // once this workaround is no longer needed.
+  options.addStringOption("notimestamp", "org.apache.kudu")
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java b/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
index 17dec97..0cb7099 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
@@ -49,6 +49,8 @@ public class ColumnSchema {
    * Not all encodings are available for all data types.
    * Refer to the Kudu documentation for more information on each encoding.
    */
+  @InterfaceAudience.Public
+  @InterfaceStability.Evolving
   public enum Encoding {
     UNKNOWN(EncodingType.UNKNOWN_ENCODING),
     AUTO_ENCODING(EncodingType.AUTO_ENCODING),
@@ -74,6 +76,8 @@ public class ColumnSchema {
   /**
    * Specifies the compression algorithm of data for a column on disk.
    */
+  @InterfaceAudience.Public
+  @InterfaceStability.Evolving
   public enum CompressionAlgorithm {
     UNKNOWN(CompressionType.UNKNOWN_COMPRESSION),
     DEFAULT_COMPRESSION(CompressionType.DEFAULT_COMPRESSION),

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
index 102df11..c4d558f 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
@@ -302,7 +302,7 @@ public class AsyncKuduClient implements AutoCloseable {
   /**
    * Timestamp required for HybridTime external consistency through timestamp
    * propagation.
-   * @see src/kudu/common/common.proto
+   * @see "src/kudu/common/common.proto"
    */
   private long lastPropagatedTimestamp = NO_TIMESTAMP;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java b/java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
index 0539d21..d56af58 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
@@ -41,7 +41,7 @@ import org.apache.kudu.master.Master.TableIdentifierPB;
 @InterfaceStability.Evolving
 public class KuduClient implements AutoCloseable {
 
-  public static final Logger LOG = LoggerFactory.getLogger(AsyncKuduClient.class);
+  private static final Logger LOG = LoggerFactory.getLogger(AsyncKuduClient.class);
   public static final long NO_TIMESTAMP = -1;
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/kudu-client/src/main/java/org/apache/kudu/client/KuduSession.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/KuduSession.java b/java/kudu-client/src/main/java/org/apache/kudu/client/KuduSession.java
index d6ad04f..0daaecb 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/KuduSession.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/KuduSession.java
@@ -35,8 +35,7 @@ import org.slf4j.LoggerFactory;
 @InterfaceStability.Evolving
 public class KuduSession implements SessionConfiguration {
 
-  public static final Logger LOG = LoggerFactory.getLogger(KuduSession.class);
-
+  private static final Logger LOG = LoggerFactory.getLogger(KuduSession.class);
   private final AsyncKuduSession session;
 
   KuduSession(AsyncKuduSession session) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/kudu-client/src/main/java/org/apache/kudu/util/DecimalUtil.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/util/DecimalUtil.java b/java/kudu-client/src/main/java/org/apache/kudu/util/DecimalUtil.java
index 19a470a..531329f 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/util/DecimalUtil.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/util/DecimalUtil.java
@@ -24,9 +24,11 @@ import java.math.RoundingMode;
 import com.google.common.base.Strings;
 
 import org.apache.kudu.ColumnTypeAttributes;
+import org.apache.yetus.audience.InterfaceAudience;
 
 import static org.apache.kudu.Common.DataType;
 
+@InterfaceAudience.Private
 public class DecimalUtil {
   public static final int MAX_DECIMAL32_PRECISION = 9;
   public static final int MAX_UNSCALED_DECIMAL32 = 999999999;

http://git-wip-us.apache.org/repos/asf/kudu/blob/0ddb860d/java/kudu-hive/build.gradle
----------------------------------------------------------------------
diff --git a/java/kudu-hive/build.gradle b/java/kudu-hive/build.gradle
index 6d9d03d..7d4d6b3 100644
--- a/java/kudu-hive/build.gradle
+++ b/java/kudu-hive/build.gradle
@@ -32,3 +32,9 @@ test {
   // Configure the derby log file location.
   systemProperty "derby.stream.error.file", "$temporaryDir/derby.log"
 }
+
+
+// kudu-hive has no public Javadoc.
+javadoc {
+  enabled = false
+}
\ No newline at end of file


Mime
View raw message