Skip to content

Commit

Permalink
HBASE-22785 Fixed Checkstyle issues in exceptions and enhanced Javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: stack <stack@apache.org>
  • Loading branch information
HorizonNet committed Aug 5, 2019
1 parent d083d17 commit 946f5e6
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,22 @@

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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,31 @@

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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,27 @@
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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,37 @@
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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -34,22 +33,21 @@ public TableNotEnabledException() {
}

/**
* 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -28,6 +28,9 @@
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,32 @@

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);
}
}
Loading

0 comments on commit 946f5e6

Please sign in to comment.