You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ja...@apache.org on 2019/08/05 15:41:17 UTC

[hbase] branch branch-1.4 updated: HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc

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

janh pushed a commit to branch branch-1.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1.4 by this push:
     new 6d8ba8b  HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc
6d8ba8b is described below

commit 6d8ba8bd2c3952dcc78fd6d7da50827af3c5b34f
Author: Jan Hentschel <ja...@ultratendency.com>
AuthorDate: Mon Aug 5 15:05:49 2019 +0200

    HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc
    
    Signed-off-by: stack <st...@apache.org>
---
 .../apache/hadoop/hbase/DoNotRetryIOException.java | 20 +++++++--------
 .../hadoop/hbase/DroppedSnapshotException.java     | 15 ++++-------
 .../hadoop/hbase/NotServingRegionException.java    | 22 +++++++---------
 .../apache/hadoop/hbase/TableExistsException.java  | 19 +++++++-------
 .../hadoop/hbase/TableInfoMissingException.java    | 29 ++++++++++++++--------
 .../hadoop/hbase/TableNotDisabledException.java    | 17 ++++++-------
 .../hadoop/hbase/TableNotEnabledException.java     | 16 ++++++------
 .../hadoop/hbase/TableNotFoundException.java       | 21 +++++++++++-----
 .../hadoop/hbase/UnknownRegionException.java       |  3 +++
 .../hadoop/hbase/UnknownScannerException.java      | 23 +++++++++--------
 .../apache/hadoop/hbase/YouAreDeadException.java   |  3 +++
 .../hadoop/hbase/ZooKeeperConnectionException.java | 19 +++++++-------
 12 files changed, 111 insertions(+), 96 deletions(-)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java
index b566fcf..a52c815 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java
@@ -32,29 +32,29 @@ public class DoNotRetryIOException extends HBaseIOException {
   // TODO: This would be more useful as a marker interface than as a class.
   private static final long serialVersionUID = 1197446454511704139L;
 
-  /**
-   * default constructor
-   */
   public DoNotRetryIOException() {
     super();
   }
 
   /**
-   * @param message
+   * @param message the message for this exception
    */
   public DoNotRetryIOException(String message) {
     super(message);
   }
 
   /**
-   * @param message
-   * @param cause
+   * @param message the message for this exception
+   * @param throwable the {@link Throwable} to use for this exception
    */
-  public DoNotRetryIOException(String message, Throwable cause) {
-    super(message, cause);
+  public DoNotRetryIOException(String message, Throwable throwable) {
+    super(message, throwable);
   }
 
-  public DoNotRetryIOException(Throwable cause) {
-    super(cause);
+  /**
+   * @param throwable the {@link Throwable} to use for this exception
+   */
+  public DoNotRetryIOException(Throwable throwable) {
+    super(throwable);
   }
 }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java
index 6b01bcc..c64bfd3 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java
@@ -23,7 +23,6 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
 
 import java.io.IOException;
 
-
 /**
  * Thrown during flush if the possibility snapshot content was not properly
  * persisted into store files.  Response should include replay of wal content.
@@ -31,20 +30,16 @@ import java.io.IOException;
 @InterfaceAudience.Public
 @InterfaceStability.Stable
 public class DroppedSnapshotException extends IOException {
-
   private static final long serialVersionUID = -5463156580831677374L;
 
-  /**
-   * @param msg
-   */
-  public DroppedSnapshotException(String msg) {
-    super(msg);
+  public DroppedSnapshotException() {
+    super();
   }
 
   /**
-   * default constructor
+   * @param message the message for this exception
    */
-  public DroppedSnapshotException() {
-    super();
+  public DroppedSnapshotException(String message) {
+    super(message);
   }
 }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java
index 448c8a9..960f930 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java
@@ -18,39 +18,35 @@
  */
 package org.apache.hadoop.hbase;
 
+import java.io.IOException;
+
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.util.Bytes;
 
-import java.io.IOException;
-
 /**
- * Thrown by a region server if it is sent a request for a region it is not
- * serving.
+ * Thrown by a region server if it is sent a request for a region it is not serving.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
 public class NotServingRegionException extends IOException {
   private static final long serialVersionUID = (1L << 17) - 1L;
 
-  /** default constructor */
   public NotServingRegionException() {
     super();
   }
 
   /**
-   * Constructor
-   * @param s message
+   * @param message the message for this exception
    */
-  public NotServingRegionException(String s) {
-    super(s);
+  public NotServingRegionException(String message) {
+    super(message);
   }
 
   /**
-   * Constructor
-   * @param s message
+   * @param message the message for this exception
    */
-  public NotServingRegionException(final byte [] s) {
-    super(Bytes.toString(s));
+  public NotServingRegionException(final byte[] message) {
+    super(Bytes.toString(message));
   }
 }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableExistsException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableExistsException.java
index 1a39497..0a2f9e9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableExistsException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableExistsException.java
@@ -23,27 +23,28 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.TableName;
 
 /**
- * Thrown when a table exists but should not
+ * Thrown when a table exists but should not.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
 public class TableExistsException extends DoNotRetryIOException {
   private static final long serialVersionUID = (1L << 7) - 1L;
-  /** default constructor */
+
   public TableExistsException() {
     super();
   }
 
   /**
-   * Constructor
-   *
-   * @param s message
+   * @param tableName the name of the table that should not exist
    */
-  public TableExistsException(String s) {
-    super(s);
+  public TableExistsException(String tableName) {
+    super(tableName);
   }
 
-  public TableExistsException(TableName t) {
-    this(t.getNameAsString());
+  /**
+   * @param tableName the name of the table that should not exist
+   */
+  public TableExistsException(TableName tableName) {
+    this(tableName.getNameAsString());
   }
 }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java
index fa1f970..cb687eb 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java
@@ -21,29 +21,38 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 
 /**
- * 
- * Failed to find .tableinfo file under table dir
- *
+ * Failed to find {@code .tableinfo} file under the table directory.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
 @SuppressWarnings("serial")
 public class TableInfoMissingException extends HBaseIOException {
-
+  /**
+   * Failed to find {@code .tableinfo} file under the table directory.
+   */
   public TableInfoMissingException() {
     super();
   }
 
-  public TableInfoMissingException( String message ) {
+  /**
+   * @param message the message for this exception
+   */
+  public TableInfoMissingException(String message) {
     super(message);
   }
 
-  public TableInfoMissingException( String message, Throwable t ) {
-    super(message, t);
+  /**
+   * @param message the message for this exception
+   * @param throwable the {@link Throwable} to use for this exception
+   */
+  public TableInfoMissingException(String message, Throwable throwable) {
+    super(message, throwable);
   }
 
-  public TableInfoMissingException( Throwable t ) {
-    super(t);
+  /**
+   * @param throwable the {@link Throwable} to use for this exception
+   */
+  public TableInfoMissingException(Throwable throwable) {
+    super(throwable);
   }
-
 }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java
index 9b11122..f6d6a44 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java
@@ -18,40 +18,39 @@
  */
 package org.apache.hadoop.hbase;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
-import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.util.Bytes;
 
 /**
- * Thrown if a table should be offline but is not
+ * Thrown if a table should be offline but is not.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
 public class TableNotDisabledException extends DoNotRetryIOException {
   private static final long serialVersionUID = (1L << 19) - 1L;
-  /** default constructor */
+
   public TableNotDisabledException() {
     super();
   }
 
   /**
-   * Constructor
-   * @param s message
+   * @param tableName the name of the table that is not disabled
    */
-  public TableNotDisabledException(String s) {
-    super(s);
+  public TableNotDisabledException(String tableName) {
+    super(tableName);
   }
 
   /**
-   * @param tableName Name of table that is not disabled
+   * @param tableName the name of the table that is not disabled
    */
   public TableNotDisabledException(byte[] tableName) {
     this(Bytes.toString(tableName));
   }
 
   /**
-   * @param tableName Name of table that is not disabled
+   * @param tableName the name of the table that is not disabled
    */
   public TableNotDisabledException(TableName tableName) {
     this(tableName.getNameAsString());
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java
index 210b875..23de9b3 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java
@@ -18,14 +18,13 @@
  */
 package org.apache.hadoop.hbase;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
-import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.util.Bytes;
 
-
 /**
- * Thrown if a table should be enabled but is not
+ * Thrown if a table should be enabled but is not.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
@@ -37,22 +36,21 @@ public class TableNotEnabledException extends DoNotRetryIOException {
   }
 
   /**
-   * Constructor
-   * @param s message
+   * @param tableName the name of table that is not enabled
    */
-  public TableNotEnabledException(String s) {
-    super(s);
+  public TableNotEnabledException(String tableName) {
+    super(tableName);
   }
 
   /**
-   * @param tableName Name of table that is not enabled
+   * @param tableName the name of table that is not enabled
    */
   public TableNotEnabledException(TableName tableName) {
     this(tableName.getNameAsString());
   }
 
   /**
-   * @param tableName Name of table that is not enabled
+   * @param tableName the name of table that is not enabled
    */
   public TableNotEnabledException(byte[] tableName) {
     this(Bytes.toString(tableName));
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java
index 2433a14..91b81bd 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java
@@ -18,31 +18,40 @@
  */
 package org.apache.hadoop.hbase;
 
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
-import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.util.Bytes;
 
-/** Thrown when a table can not be located */
+/**
+ * Thrown when a table cannot be located.
+ */
 @InterfaceAudience.Public
 @InterfaceStability.Stable
 public class TableNotFoundException extends DoNotRetryIOException {
   private static final long serialVersionUID = 993179627856392526L;
 
-  /** default constructor */
   public TableNotFoundException() {
     super();
   }
 
-  /** @param s message */
-  public TableNotFoundException(String s) {
-    super(s);
+  /**
+   * @param tableName the name of the table which was not found
+   */
+  public TableNotFoundException(String tableName) {
+    super(tableName);
   }
 
+  /**
+   * @param tableName the name of the table which was not found
+   */
   public TableNotFoundException(byte[] tableName) {
     super(Bytes.toString(tableName));
   }
 
+  /**
+   * @param tableName the name of the table which was not found
+   */
   public TableNotFoundException(TableName tableName) {
     super(tableName.getNameAsString());
   }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java
index 2ebba32..dd237c0 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java
@@ -30,6 +30,9 @@ import org.apache.hadoop.hbase.client.DoNotRetryRegionException;
 public class UnknownRegionException extends DoNotRetryRegionException {
   private static final long serialVersionUID = 1968858760475205392L;
 
+  /**
+   * @param regionName the name of the region which is unknown
+   */
   public UnknownRegionException(String regionName) {
     super(regionName);
   }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java
index 3e7b22d..33efea8 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java
@@ -21,11 +21,10 @@ package org.apache.hadoop.hbase;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 
-
 /**
- * Thrown if a region server is passed an unknown scanner id.
- * Usually means the client has take too long between checkins and so the
- * scanner lease on the serverside has expired OR the serverside is closing
+ * Thrown if a region server is passed an unknown scanner ID.
+ * This usually means that the client has taken too long between checkins and so the
+ * scanner lease on the server-side has expired OR the server-side is closing
  * down and has cancelled all leases.
  */
 @InterfaceAudience.Public
@@ -33,20 +32,22 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
 public class UnknownScannerException extends DoNotRetryIOException {
   private static final long serialVersionUID = 993179627856392526L;
 
-  /** constructor */
   public UnknownScannerException() {
     super();
   }
 
   /**
-   * Constructor
-   * @param s message
+   * @param message the message for this exception
    */
-  public UnknownScannerException(String s) {
-    super(s);
+  public UnknownScannerException(String message) {
+    super(message);
   }
 
-  public UnknownScannerException(String s, Exception e) {
-    super(s, e);
+  /**
+   * @param message the message for this exception
+   * @param exception the exception to grab data from
+   */
+  public UnknownScannerException(String message, Exception exception) {
+    super(message, exception);
   }
 }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java
index b55fe33..56432fe 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java
@@ -32,6 +32,9 @@ import java.io.IOException;
 @InterfaceAudience.Private
 @InterfaceStability.Stable
 public class YouAreDeadException extends IOException {
+  /**
+   * @param message the message for this exception
+   */
   public YouAreDeadException(String message) {
     super(message);
   }
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java
index 773a64b..e8e179e 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java
@@ -24,30 +24,31 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
 import java.io.IOException;
 
 /**
- * Thrown if the client can't connect to zookeeper
+ * Thrown if the client can't connect to ZooKeeper.
  */
 @InterfaceAudience.Public
 @InterfaceStability.Evolving
 public class ZooKeeperConnectionException extends IOException {
   private static final long serialVersionUID = (1L << 23) - 1L;
-  /** default constructor */
+
   public ZooKeeperConnectionException() {
     super();
   }
 
   /**
-   * Constructor
-   * @param s message
+   * @param message the message for this exception
    */
-  public ZooKeeperConnectionException(String s) {
-    super(s);
+  public ZooKeeperConnectionException(String message) {
+    super(message);
   }
 
   /**
    * Constructor taking another exception.
-   * @param e Exception to grab data from.
+   *
+   * @param message the message for this exception
+   * @param exception the exception to grab data from
    */
-  public ZooKeeperConnectionException(String message, Exception e) {
-    super(message, e);
+  public ZooKeeperConnectionException(String message, Exception exception) {
+    super(message, exception);
   }
 }