Skip to content

Commit e26f695

Browse files
committed
HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc
Signed-off-by: stack <stack@apache.org>
1 parent 9f92a9c commit e26f695

12 files changed

+111
-96
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,29 @@ public class DoNotRetryIOException extends HBaseIOException {
3232
// TODO: This would be more useful as a marker interface than as a class.
3333
private static final long serialVersionUID = 1197446454511704139L;
3434

35-
/**
36-
* default constructor
37-
*/
3835
public DoNotRetryIOException() {
3936
super();
4037
}
4138

4239
/**
43-
* @param message
40+
* @param message the message for this exception
4441
*/
4542
public DoNotRetryIOException(String message) {
4643
super(message);
4744
}
4845

4946
/**
50-
* @param message
51-
* @param cause
47+
* @param message the message for this exception
48+
* @param throwable the {@link Throwable} to use for this exception
5249
*/
53-
public DoNotRetryIOException(String message, Throwable cause) {
54-
super(message, cause);
50+
public DoNotRetryIOException(String message, Throwable throwable) {
51+
super(message, throwable);
5552
}
5653

57-
public DoNotRetryIOException(Throwable cause) {
58-
super(cause);
54+
/**
55+
* @param throwable the {@link Throwable} to use for this exception
56+
*/
57+
public DoNotRetryIOException(Throwable throwable) {
58+
super(throwable);
5959
}
6060
}

hbase-client/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,23 @@
2323

2424
import java.io.IOException;
2525

26-
2726
/**
2827
* Thrown during flush if the possibility snapshot content was not properly
2928
* persisted into store files. Response should include replay of wal content.
3029
*/
3130
@InterfaceAudience.Public
3231
@InterfaceStability.Stable
3332
public class DroppedSnapshotException extends IOException {
34-
3533
private static final long serialVersionUID = -5463156580831677374L;
3634

37-
/**
38-
* @param msg
39-
*/
40-
public DroppedSnapshotException(String msg) {
41-
super(msg);
35+
public DroppedSnapshotException() {
36+
super();
4237
}
4338

4439
/**
45-
* default constructor
40+
* @param message the message for this exception
4641
*/
47-
public DroppedSnapshotException() {
48-
super();
42+
public DroppedSnapshotException(String message) {
43+
super(message);
4944
}
5045
}

hbase-client/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,35 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21+
import java.io.IOException;
22+
2123
import org.apache.hadoop.hbase.classification.InterfaceAudience;
2224
import org.apache.hadoop.hbase.classification.InterfaceStability;
2325
import org.apache.hadoop.hbase.util.Bytes;
2426

25-
import java.io.IOException;
26-
2727
/**
28-
* Thrown by a region server if it is sent a request for a region it is not
29-
* serving.
28+
* Thrown by a region server if it is sent a request for a region it is not serving.
3029
*/
3130
@InterfaceAudience.Public
3231
@InterfaceStability.Stable
3332
public class NotServingRegionException extends IOException {
3433
private static final long serialVersionUID = (1L << 17) - 1L;
3534

36-
/** default constructor */
3735
public NotServingRegionException() {
3836
super();
3937
}
4038

4139
/**
42-
* Constructor
43-
* @param s message
40+
* @param message the message for this exception
4441
*/
45-
public NotServingRegionException(String s) {
46-
super(s);
42+
public NotServingRegionException(String message) {
43+
super(message);
4744
}
4845

4946
/**
50-
* Constructor
51-
* @param s message
47+
* @param message the message for this exception
5248
*/
53-
public NotServingRegionException(final byte [] s) {
54-
super(Bytes.toString(s));
49+
public NotServingRegionException(final byte[] message) {
50+
super(Bytes.toString(message));
5551
}
5652
}

hbase-client/src/main/java/org/apache/hadoop/hbase/TableExistsException.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,28 @@
2323
import org.apache.hadoop.hbase.TableName;
2424

2525
/**
26-
* Thrown when a table exists but should not
26+
* Thrown when a table exists but should not.
2727
*/
2828
@InterfaceAudience.Public
2929
@InterfaceStability.Stable
3030
public class TableExistsException extends DoNotRetryIOException {
3131
private static final long serialVersionUID = (1L << 7) - 1L;
32-
/** default constructor */
32+
3333
public TableExistsException() {
3434
super();
3535
}
3636

3737
/**
38-
* Constructor
39-
*
40-
* @param s message
38+
* @param tableName the name of the table that should not exist
4139
*/
42-
public TableExistsException(String s) {
43-
super(s);
40+
public TableExistsException(String tableName) {
41+
super(tableName);
4442
}
4543

46-
public TableExistsException(TableName t) {
47-
this(t.getNameAsString());
44+
/**
45+
* @param tableName the name of the table that should not exist
46+
*/
47+
public TableExistsException(TableName tableName) {
48+
this(tableName.getNameAsString());
4849
}
4950
}

hbase-client/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,38 @@
2121
import org.apache.hadoop.hbase.classification.InterfaceStability;
2222

2323
/**
24-
*
25-
* Failed to find .tableinfo file under table dir
26-
*
24+
* Failed to find {@code .tableinfo} file under the table directory.
2725
*/
2826
@InterfaceAudience.Public
2927
@InterfaceStability.Evolving
3028
@SuppressWarnings("serial")
3129
public class TableInfoMissingException extends HBaseIOException {
32-
30+
/**
31+
* Failed to find {@code .tableinfo} file under the table directory.
32+
*/
3333
public TableInfoMissingException() {
3434
super();
3535
}
3636

37-
public TableInfoMissingException( String message ) {
37+
/**
38+
* @param message the message for this exception
39+
*/
40+
public TableInfoMissingException(String message) {
3841
super(message);
3942
}
4043

41-
public TableInfoMissingException( String message, Throwable t ) {
42-
super(message, t);
44+
/**
45+
* @param message the message for this exception
46+
* @param throwable the {@link Throwable} to use for this exception
47+
*/
48+
public TableInfoMissingException(String message, Throwable throwable) {
49+
super(message, throwable);
4350
}
4451

45-
public TableInfoMissingException( Throwable t ) {
46-
super(t);
52+
/**
53+
* @param throwable the {@link Throwable} to use for this exception
54+
*/
55+
public TableInfoMissingException(Throwable throwable) {
56+
super(throwable);
4757
}
48-
4958
}

hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,39 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21+
import org.apache.hadoop.hbase.TableName;
2122
import org.apache.hadoop.hbase.classification.InterfaceAudience;
2223
import org.apache.hadoop.hbase.classification.InterfaceStability;
23-
import org.apache.hadoop.hbase.TableName;
2424
import org.apache.hadoop.hbase.util.Bytes;
2525

2626
/**
27-
* Thrown if a table should be offline but is not
27+
* Thrown if a table should be offline but is not.
2828
*/
2929
@InterfaceAudience.Public
3030
@InterfaceStability.Stable
3131
public class TableNotDisabledException extends DoNotRetryIOException {
3232
private static final long serialVersionUID = (1L << 19) - 1L;
33-
/** default constructor */
33+
3434
public TableNotDisabledException() {
3535
super();
3636
}
3737

3838
/**
39-
* Constructor
40-
* @param s message
39+
* @param tableName the name of the table that is not disabled
4140
*/
42-
public TableNotDisabledException(String s) {
43-
super(s);
41+
public TableNotDisabledException(String tableName) {
42+
super(tableName);
4443
}
4544

4645
/**
47-
* @param tableName Name of table that is not disabled
46+
* @param tableName the name of the table that is not disabled
4847
*/
4948
public TableNotDisabledException(byte[] tableName) {
5049
this(Bytes.toString(tableName));
5150
}
5251

5352
/**
54-
* @param tableName Name of table that is not disabled
53+
* @param tableName the name of the table that is not disabled
5554
*/
5655
public TableNotDisabledException(TableName tableName) {
5756
this(tableName.getNameAsString());

hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21+
import org.apache.hadoop.hbase.TableName;
2122
import org.apache.hadoop.hbase.classification.InterfaceAudience;
2223
import org.apache.hadoop.hbase.classification.InterfaceStability;
23-
import org.apache.hadoop.hbase.TableName;
2424
import org.apache.hadoop.hbase.util.Bytes;
2525

26-
2726
/**
28-
* Thrown if a table should be enabled but is not
27+
* Thrown if a table should be enabled but is not.
2928
*/
3029
@InterfaceAudience.Public
3130
@InterfaceStability.Stable
@@ -37,22 +36,21 @@ public TableNotEnabledException() {
3736
}
3837

3938
/**
40-
* Constructor
41-
* @param s message
39+
* @param tableName the name of table that is not enabled
4240
*/
43-
public TableNotEnabledException(String s) {
44-
super(s);
41+
public TableNotEnabledException(String tableName) {
42+
super(tableName);
4543
}
4644

4745
/**
48-
* @param tableName Name of table that is not enabled
46+
* @param tableName the name of table that is not enabled
4947
*/
5048
public TableNotEnabledException(TableName tableName) {
5149
this(tableName.getNameAsString());
5250
}
5351

5452
/**
55-
* @param tableName Name of table that is not enabled
53+
* @param tableName the name of table that is not enabled
5654
*/
5755
public TableNotEnabledException(byte[] tableName) {
5856
this(Bytes.toString(tableName));

hbase-client/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,40 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21+
import org.apache.hadoop.hbase.TableName;
2122
import org.apache.hadoop.hbase.classification.InterfaceAudience;
2223
import org.apache.hadoop.hbase.classification.InterfaceStability;
23-
import org.apache.hadoop.hbase.TableName;
2424
import org.apache.hadoop.hbase.util.Bytes;
2525

26-
/** Thrown when a table can not be located */
26+
/**
27+
* Thrown when a table cannot be located.
28+
*/
2729
@InterfaceAudience.Public
2830
@InterfaceStability.Stable
2931
public class TableNotFoundException extends DoNotRetryIOException {
3032
private static final long serialVersionUID = 993179627856392526L;
3133

32-
/** default constructor */
3334
public TableNotFoundException() {
3435
super();
3536
}
3637

37-
/** @param s message */
38-
public TableNotFoundException(String s) {
39-
super(s);
38+
/**
39+
* @param tableName the name of the table which was not found
40+
*/
41+
public TableNotFoundException(String tableName) {
42+
super(tableName);
4043
}
4144

45+
/**
46+
* @param tableName the name of the table which was not found
47+
*/
4248
public TableNotFoundException(byte[] tableName) {
4349
super(Bytes.toString(tableName));
4450
}
4551

52+
/**
53+
* @param tableName the name of the table which was not found
54+
*/
4655
public TableNotFoundException(TableName tableName) {
4756
super(tableName.getNameAsString());
4857
}

hbase-client/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
public class UnknownRegionException extends DoNotRetryRegionException {
3131
private static final long serialVersionUID = 1968858760475205392L;
3232

33+
/**
34+
* @param regionName the name of the region which is unknown
35+
*/
3336
public UnknownRegionException(String regionName) {
3437
super(regionName);
3538
}

0 commit comments

Comments
 (0)