Skip to content

Commit da114ac

Browse files
authored
HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc
Signed-off-by: stack <[email protected]>
1 parent 8411668 commit da114ac

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
@@ -29,29 +29,29 @@ public class DoNotRetryIOException extends HBaseIOException {
2929
// TODO: This would be more useful as a marker interface than as a class.
3030
private static final long serialVersionUID = 1197446454511704139L;
3131

32-
/**
33-
* default constructor
34-
*/
3532
public DoNotRetryIOException() {
3633
super();
3734
}
3835

3936
/**
40-
* @param message
37+
* @param message the message for this exception
4138
*/
4239
public DoNotRetryIOException(String message) {
4340
super(message);
4441
}
4542

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

54-
public DoNotRetryIOException(Throwable cause) {
55-
super(cause);
51+
/**
52+
* @param throwable the {@link Throwable} to use for this exception
53+
*/
54+
public DoNotRetryIOException(Throwable throwable) {
55+
super(throwable);
5656
}
5757
}

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
@@ -22,27 +22,22 @@
2222

2323
import org.apache.yetus.audience.InterfaceAudience;
2424

25-
2625
/**
2726
* Thrown during flush if the possibility snapshot content was not properly
2827
* persisted into store files. Response should include replay of wal content.
2928
*/
3029
@InterfaceAudience.Public
3130
public class DroppedSnapshotException extends IOException {
32-
3331
private static final long serialVersionUID = -5463156580831677374L;
3432

35-
/**
36-
* @param msg
37-
*/
38-
public DroppedSnapshotException(String msg) {
39-
super(msg);
33+
public DroppedSnapshotException() {
34+
super();
4035
}
4136

4237
/**
43-
* default constructor
38+
* @param message the message for this exception
4439
*/
45-
public DroppedSnapshotException() {
46-
super();
40+
public DroppedSnapshotException(String message) {
41+
super(message);
4742
}
4843
}

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,31 @@
2020

2121
import java.io.IOException;
2222

23-
import org.apache.yetus.audience.InterfaceAudience;
2423
import org.apache.hadoop.hbase.util.Bytes;
24+
import org.apache.yetus.audience.InterfaceAudience;
2525

2626
/**
27-
* Thrown by a region server if it is sent a request for a region it is not
28-
* serving.
27+
* Thrown by a region server if it is sent a request for a region it is not serving.
2928
*/
3029
@InterfaceAudience.Public
3130
public class NotServingRegionException extends IOException {
3231
private static final long serialVersionUID = (1L << 17) - 1L;
3332

34-
/** default constructor */
3533
public NotServingRegionException() {
3634
super();
3735
}
3836

3937
/**
40-
* Constructor
41-
* @param s message
38+
* @param message the message for this exception
4239
*/
43-
public NotServingRegionException(String s) {
44-
super(s);
40+
public NotServingRegionException(String message) {
41+
super(message);
4542
}
4643

4744
/**
48-
* Constructor
49-
* @param s message
45+
* @param message the message for this exception
5046
*/
51-
public NotServingRegionException(final byte [] s) {
52-
super(Bytes.toString(s));
47+
public NotServingRegionException(final byte[] message) {
48+
super(Bytes.toString(message));
5349
}
5450
}

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
@@ -21,26 +21,27 @@
2121
import org.apache.yetus.audience.InterfaceAudience;
2222

2323
/**
24-
* Thrown when a table exists but should not
24+
* Thrown when a table exists but should not.
2525
*/
2626
@InterfaceAudience.Public
2727
public class TableExistsException extends DoNotRetryIOException {
2828
private static final long serialVersionUID = (1L << 7) - 1L;
29-
/** default constructor */
29+
3030
public TableExistsException() {
3131
super();
3232
}
3333

3434
/**
35-
* Constructor
36-
*
37-
* @param s message
35+
* @param tableName the name of the table that should not exist
3836
*/
39-
public TableExistsException(String s) {
40-
super(s);
37+
public TableExistsException(String tableName) {
38+
super(tableName);
4139
}
4240

43-
public TableExistsException(TableName t) {
44-
this(t.getNameAsString());
41+
/**
42+
* @param tableName the name of the table that should not exist
43+
*/
44+
public TableExistsException(TableName tableName) {
45+
this(tableName.getNameAsString());
4546
}
4647
}

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
@@ -20,28 +20,37 @@
2020
import org.apache.yetus.audience.InterfaceAudience;
2121

2222
/**
23-
*
24-
* Failed to find .tableinfo file under table dir
25-
*
23+
* Failed to find {@code .tableinfo} file under the table directory.
2624
*/
2725
@InterfaceAudience.Public
2826
@SuppressWarnings("serial")
2927
public class TableInfoMissingException extends HBaseIOException {
30-
28+
/**
29+
* Failed to find {@code .tableinfo} file under the table directory.
30+
*/
3131
public TableInfoMissingException() {
3232
super();
3333
}
3434

35-
public TableInfoMissingException( String message ) {
35+
/**
36+
* @param message the message for this exception
37+
*/
38+
public TableInfoMissingException(String message) {
3639
super(message);
3740
}
3841

39-
public TableInfoMissingException( String message, Throwable t ) {
40-
super(message, t);
42+
/**
43+
* @param message the message for this exception
44+
* @param throwable the {@link Throwable} to use for this exception
45+
*/
46+
public TableInfoMissingException(String message, Throwable throwable) {
47+
super(message, throwable);
4148
}
4249

43-
public TableInfoMissingException( Throwable t ) {
44-
super(t);
50+
/**
51+
* @param throwable the {@link Throwable} to use for this exception
52+
*/
53+
public TableInfoMissingException(Throwable throwable) {
54+
super(throwable);
4555
}
46-
4756
}

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,37 +18,36 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21-
import org.apache.yetus.audience.InterfaceAudience;
2221
import org.apache.hadoop.hbase.util.Bytes;
22+
import org.apache.yetus.audience.InterfaceAudience;
2323

2424
/**
25-
* Thrown if a table should be offline but is not
25+
* Thrown if a table should be offline but is not.
2626
*/
2727
@InterfaceAudience.Public
2828
public class TableNotDisabledException extends DoNotRetryIOException {
2929
private static final long serialVersionUID = (1L << 19) - 1L;
30-
/** default constructor */
30+
3131
public TableNotDisabledException() {
3232
super();
3333
}
3434

3535
/**
36-
* Constructor
37-
* @param s message
36+
* @param tableName the name of the table that is not disabled
3837
*/
39-
public TableNotDisabledException(String s) {
40-
super(s);
38+
public TableNotDisabledException(String tableName) {
39+
super(tableName);
4140
}
4241

4342
/**
44-
* @param tableName Name of table that is not disabled
43+
* @param tableName the name of the table that is not disabled
4544
*/
4645
public TableNotDisabledException(byte[] tableName) {
4746
this(Bytes.toString(tableName));
4847
}
4948

5049
/**
51-
* @param tableName Name of table that is not disabled
50+
* @param tableName the name of the table that is not disabled
5251
*/
5352
public TableNotDisabledException(TableName tableName) {
5453
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,12 +18,11 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21-
import org.apache.yetus.audience.InterfaceAudience;
2221
import org.apache.hadoop.hbase.util.Bytes;
23-
22+
import org.apache.yetus.audience.InterfaceAudience;
2423

2524
/**
26-
* Thrown if a table should be enabled but is not
25+
* Thrown if a table should be enabled but is not.
2726
*/
2827
@InterfaceAudience.Public
2928
public class TableNotEnabledException extends DoNotRetryIOException {
@@ -34,22 +33,21 @@ public TableNotEnabledException() {
3433
}
3534

3635
/**
37-
* Constructor
38-
* @param s message
36+
* @param tableName the name of table that is not enabled
3937
*/
40-
public TableNotEnabledException(String s) {
41-
super(s);
38+
public TableNotEnabledException(String tableName) {
39+
super(tableName);
4240
}
4341

4442
/**
45-
* @param tableName Name of table that is not enabled
43+
* @param tableName the name of table that is not enabled
4644
*/
4745
public TableNotEnabledException(TableName tableName) {
4846
this(tableName.getNameAsString());
4947
}
5048

5149
/**
52-
* @param tableName Name of table that is not enabled
50+
* @param tableName the name of table that is not enabled
5351
*/
5452
public TableNotEnabledException(byte[] tableName) {
5553
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,28 +18,37 @@
1818
*/
1919
package org.apache.hadoop.hbase;
2020

21-
import org.apache.yetus.audience.InterfaceAudience;
2221
import org.apache.hadoop.hbase.util.Bytes;
22+
import org.apache.yetus.audience.InterfaceAudience;
2323

24-
/** Thrown when a table can not be located */
24+
/**
25+
* Thrown when a table cannot be located.
26+
*/
2527
@InterfaceAudience.Public
2628
public class TableNotFoundException extends DoNotRetryIOException {
2729
private static final long serialVersionUID = 993179627856392526L;
2830

29-
/** default constructor */
3031
public TableNotFoundException() {
3132
super();
3233
}
3334

34-
/** @param s message */
35-
public TableNotFoundException(String s) {
36-
super(s);
35+
/**
36+
* @param tableName the name of the table which was not found
37+
*/
38+
public TableNotFoundException(String tableName) {
39+
super(tableName);
3740
}
3841

42+
/**
43+
* @param tableName the name of the table which was not found
44+
*/
3945
public TableNotFoundException(byte[] tableName) {
4046
super(Bytes.toString(tableName));
4147
}
4248

49+
/**
50+
* @param tableName the name of the table which was not found
51+
*/
4352
public TableNotFoundException(TableName tableName) {
4453
super(tableName.getNameAsString());
4554
}

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

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

21-
import org.apache.yetus.audience.InterfaceAudience;
2221
import org.apache.hadoop.hbase.client.DoNotRetryRegionException;
22+
import org.apache.yetus.audience.InterfaceAudience;
2323

2424
/**
2525
* Thrown when we are asked to operate on a region we know nothing about.
@@ -28,6 +28,9 @@
2828
public class UnknownRegionException extends DoNotRetryRegionException {
2929
private static final long serialVersionUID = 1968858760475205392L;
3030

31+
/**
32+
* @param regionName the name of the region which is unknown
33+
*/
3134
public UnknownRegionException(String regionName) {
3235
super(regionName);
3336
}

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,32 @@
2020

2121
import org.apache.yetus.audience.InterfaceAudience;
2222

23-
2423
/**
25-
* Thrown if a region server is passed an unknown scanner id.
26-
* Usually means the client has take too long between checkins and so the
27-
* scanner lease on the serverside has expired OR the serverside is closing
24+
* Thrown if a region server is passed an unknown scanner ID.
25+
* This usually means that the client has taken too long between checkins and so the
26+
* scanner lease on the server-side has expired OR the server-side is closing
2827
* down and has cancelled all leases.
2928
*/
3029
@InterfaceAudience.Public
3130
public class UnknownScannerException extends DoNotRetryIOException {
3231
private static final long serialVersionUID = 993179627856392526L;
3332

34-
/** constructor */
3533
public UnknownScannerException() {
3634
super();
3735
}
3836

3937
/**
40-
* Constructor
41-
* @param s message
38+
* @param message the message for this exception
4239
*/
43-
public UnknownScannerException(String s) {
44-
super(s);
40+
public UnknownScannerException(String message) {
41+
super(message);
4542
}
4643

47-
public UnknownScannerException(String s, Exception e) {
48-
super(s, e);
44+
/**
45+
* @param message the message for this exception
46+
* @param exception the exception to grab data from
47+
*/
48+
public UnknownScannerException(String message, Exception exception) {
49+
super(message, exception);
4950
}
5051
}

0 commit comments

Comments
 (0)