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 14:27:18 UTC
[hbase] branch branch-2.1 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-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 946f5e6 HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc
946f5e6 is described below
commit 946f5e6eb5688a67f6e6a6fc490f4a87e08c2f8a
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 | 20 ++++++---------
.../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 | 5 +++-
.../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 93fbd0c..509844e 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
@@ -29,29 +29,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 ef65441..263c458 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
@@ -22,27 +22,22 @@ import java.io.IOException;
import org.apache.yetus.audience.InterfaceAudience;
-
/**
* Thrown during flush if the possibility snapshot content was not properly
* persisted into store files. Response should include replay of wal content.
*/
@InterfaceAudience.Public
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 6d3ae0c..9184087 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
@@ -20,35 +20,31 @@ package org.apache.hadoop.hbase;
import java.io.IOException;
-import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.yetus.audience.InterfaceAudience;
/**
- * 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
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 69929d8..9d67a37 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
@@ -21,26 +21,27 @@ package org.apache.hadoop.hbase;
import org.apache.yetus.audience.InterfaceAudience;
/**
- * Thrown when a table exists but should not
+ * Thrown when a table exists but should not.
*/
@InterfaceAudience.Public
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 09d0b2b..a113f7c 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
@@ -20,28 +20,37 @@ package org.apache.hadoop.hbase;
import org.apache.yetus.audience.InterfaceAudience;
/**
- *
- * Failed to find .tableinfo file under table dir
- *
+ * Failed to find {@code .tableinfo} file under the table directory.
*/
@InterfaceAudience.Public
@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 813c4e9..7e50465 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,37 +18,36 @@
*/
package org.apache.hadoop.hbase;
-import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.yetus.audience.InterfaceAudience;
/**
- * Thrown if a table should be offline but is not
+ * Thrown if a table should be offline but is not.
*/
@InterfaceAudience.Public
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 e64a04e..90c0156 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,12 +18,11 @@
*/
package org.apache.hadoop.hbase;
-import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.util.Bytes;
-
+import org.apache.yetus.audience.InterfaceAudience;
/**
- * Thrown if a table should be enabled but is not
+ * Thrown if a table should be enabled but is not.
*/
@InterfaceAudience.Public
public class TableNotEnabledException extends DoNotRetryIOException {
@@ -34,22 +33,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 47805cf..ae114fe 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,28 +18,37 @@
*/
package org.apache.hadoop.hbase;
-import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.yetus.audience.InterfaceAudience;
-/** Thrown when a table can not be located */
+/**
+ * Thrown when a table cannot be located.
+ */
@InterfaceAudience.Public
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 da305a2..f870bfc 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
@@ -18,8 +18,8 @@
*/
package org.apache.hadoop.hbase;
-import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.client.DoNotRetryRegionException;
+import org.apache.yetus.audience.InterfaceAudience;
/**
* Thrown when we are asked to operate on a region we know nothing about.
@@ -28,6 +28,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 77126e9..14afb97 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
@@ -20,31 +20,32 @@ package org.apache.hadoop.hbase;
import org.apache.yetus.audience.InterfaceAudience;
-
/**
- * 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
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 9585d2e..0c44b9a 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 org.apache.yetus.audience.InterfaceStability;
@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 6c61468..4dc44b4 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
@@ -23,29 +23,30 @@ import java.io.IOException;
import org.apache.yetus.audience.InterfaceAudience;
/**
- * Thrown if the client can't connect to zookeeper
+ * Thrown if the client can't connect to ZooKeeper.
*/
@InterfaceAudience.Public
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);
}
}