HDFS-11901. Modifier 'static' is redundant for inner enums. Contributed by ZhangBing Lin.

This commit is contained in:
Brahma Reddy Battula 2017-05-31 23:09:08 +08:00
parent 547f18cb96
commit 13de636b40
23 changed files with 24 additions and 24 deletions

View File

@ -139,7 +139,7 @@ public class HttpFSFileSystem extends FileSystem
public static final String UPLOAD_CONTENT_TYPE= "application/octet-stream"; public static final String UPLOAD_CONTENT_TYPE= "application/octet-stream";
public static enum FILE_TYPE { public enum FILE_TYPE {
FILE, DIRECTORY, SYMLINK; FILE, DIRECTORY, SYMLINK;
public static FILE_TYPE getType(FileStatus fileStatus) { public static FILE_TYPE getType(FileStatus fileStatus) {
@ -210,7 +210,7 @@ public static FILE_TYPE getType(FileStatus fileStatus) {
private static final String HTTP_DELETE = "DELETE"; private static final String HTTP_DELETE = "DELETE";
@InterfaceAudience.Private @InterfaceAudience.Private
public static enum Operation { public enum Operation {
OPEN(HTTP_GET), GETFILESTATUS(HTTP_GET), LISTSTATUS(HTTP_GET), OPEN(HTTP_GET), GETFILESTATUS(HTTP_GET), LISTSTATUS(HTTP_GET),
GETHOMEDIRECTORY(HTTP_GET), GETCONTENTSUMMARY(HTTP_GET), GETHOMEDIRECTORY(HTTP_GET), GETCONTENTSUMMARY(HTTP_GET),
GETFILECHECKSUM(HTTP_GET), GETFILEBLOCKLOCATIONS(HTTP_GET), GETFILECHECKSUM(HTTP_GET), GETFILEBLOCKLOCATIONS(HTTP_GET),

View File

@ -101,7 +101,7 @@ public class Server {
* Enumeration that defines the server status. * Enumeration that defines the server status.
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public static enum Status { public enum Status {
UNDEF(false, false), UNDEF(false, false),
BOOTING(false, true), BOOTING(false, true),
HALTED(true, true), HALTED(true, true),

View File

@ -31,7 +31,7 @@ public class ServerException extends XException {
* Error codes use by the {@link Server} class. * Error codes use by the {@link Server} class.
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public static enum ERROR implements XException.ERROR { public enum ERROR implements XException.ERROR {
S01("Dir [{0}] does not exist"), S01("Dir [{0}] does not exist"),
S02("[{0}] is not a directory"), S02("[{0}] is not a directory"),
S03("Could not load file from classpath [{0}], {1}"), S03("Could not load file from classpath [{0}], {1}"),

View File

@ -27,7 +27,7 @@
public class TestXException extends HTestCase { public class TestXException extends HTestCase {
public static enum TestERROR implements XException.ERROR { public enum TestERROR implements XException.ERROR {
TC; TC;
@Override @Override

View File

@ -100,7 +100,7 @@ public void testLong() throws Exception {
test(param, "L", "a long", 1L, 2L, "x", null); test(param, "L", "a long", 1L, 2L, "x", null);
} }
public static enum ENUM { public enum ENUM {
FOO, BAR FOO, BAR
} }

View File

@ -72,7 +72,7 @@ class OpenFileCtx {
// Pending writes water mark for dump, 1MB // Pending writes water mark for dump, 1MB
private static long DUMP_WRITE_WATER_MARK = 1024 * 1024; private static long DUMP_WRITE_WATER_MARK = 1024 * 1024;
static enum COMMIT_STATUS { enum COMMIT_STATUS {
COMMIT_FINISHED, COMMIT_FINISHED,
COMMIT_WAIT, COMMIT_WAIT,
COMMIT_INACTIVE_CTX, COMMIT_INACTIVE_CTX,

View File

@ -44,7 +44,7 @@ class WriteCtx {
* wait for prerequisite writes. NO_DUMP: sequential write, no need to dump * wait for prerequisite writes. NO_DUMP: sequential write, no need to dump
* since it will be written to HDFS soon. DUMPED: already dumped to a file. * since it will be written to HDFS soon. DUMPED: already dumped to a file.
*/ */
public static enum DataState { public enum DataState {
ALLOW_DUMP, ALLOW_DUMP,
NO_DUMP, NO_DUMP,
DUMPED DUMPED

View File

@ -74,7 +74,7 @@ public interface LayoutFeature {
* </li> * </li>
* </ul> * </ul>
*/ */
public static enum Feature implements LayoutFeature { public enum Feature implements LayoutFeature {
NAMESPACE_QUOTA(-16, "Support for namespace quotas"), NAMESPACE_QUOTA(-16, "Support for namespace quotas"),
FILE_ACCESS_TIME(-17, "Support for access time on files"), FILE_ACCESS_TIME(-17, "Support for access time on files"),
DISKSPACE_QUOTA(-18, "Support for disk space quotas"), DISKSPACE_QUOTA(-18, "Support for disk space quotas"),

View File

@ -46,7 +46,7 @@
public class CorruptReplicasMap{ public class CorruptReplicasMap{
/** The corruption reason code */ /** The corruption reason code */
public static enum Reason { public enum Reason {
NONE, // not specified. NONE, // not specified.
ANY, // wildcard reason ANY, // wildcard reason
GENSTAMP_MISMATCH, // mismatch in generation stamps GENSTAMP_MISMATCH, // mismatch in generation stamps

View File

@ -398,7 +398,7 @@ void setRemainingForTests(int remaining) {
this.remaining = remaining; this.remaining = remaining;
} }
static enum AddBlockResult { enum AddBlockResult {
ADDED, REPLACED, ALREADY_EXIST ADDED, REPLACED, ALREADY_EXIST
} }
} }

View File

@ -96,7 +96,7 @@ class BPServiceActor implements Runnable {
Thread bpThread; Thread bpThread;
DatanodeProtocolClientSideTranslatorPB bpNamenode; DatanodeProtocolClientSideTranslatorPB bpNamenode;
static enum RunningState { enum RunningState {
CONNECTING, INIT_FAILED, RUNNING, EXITED, FAILED; CONNECTING, INIT_FAILED, RUNNING, EXITED, FAILED;
} }

View File

@ -1185,7 +1185,7 @@ private ReplicaHandler claimReplicaHandler() {
return handler; return handler;
} }
private static enum PacketResponderType { private enum PacketResponderType {
NON_PIPELINE, LAST_IN_PIPELINE, HAS_DOWNSTREAM_IN_PIPELINE NON_PIPELINE, LAST_IN_PIPELINE, HAS_DOWNSTREAM_IN_PIPELINE
} }

View File

@ -61,7 +61,7 @@ public static boolean supports(final LayoutFeature f, final int lv) {
* </li> * </li>
* </ul> * </ul>
*/ */
public static enum Feature implements LayoutFeature { public enum Feature implements LayoutFeature {
FIRST_LAYOUT(-55, -53, "First datanode layout", false), FIRST_LAYOUT(-55, -53, "First datanode layout", false),
BLOCKID_BASED_LAYOUT(-56, BLOCKID_BASED_LAYOUT(-56,
"The block ID of a finalized block uniquely determines its position " + "The block ID of a finalized block uniquely determines its position " +

View File

@ -55,7 +55,7 @@ public class BackupImage extends FSImage {
* stopApplyingOnNextRoll is true. * stopApplyingOnNextRoll is true.
*/ */
volatile BNState bnState; volatile BNState bnState;
static enum BNState { enum BNState {
/** /**
* Edits from the NN should be dropped. On the next log roll, * Edits from the NN should be dropped. On the next log roll,
* transition to JOURNAL_ONLY state * transition to JOURNAL_ONLY state

View File

@ -63,7 +63,7 @@ public Counts newInstance() {
public static class CountsMap public static class CountsMap
extends EnumCounters.Map<CountsMap.Key, Content, Counts> { extends EnumCounters.Map<CountsMap.Key, Content, Counts> {
/** The key type of the map. */ /** The key type of the map. */
public static enum Key { CURRENT, SNAPSHOT } public enum Key { CURRENT, SNAPSHOT }
CountsMap() { CountsMap() {
super(FACTORY); super(FACTORY);

View File

@ -33,7 +33,7 @@
@InterfaceAudience.Private @InterfaceAudience.Private
public abstract class INodeWithAdditionalFields extends INode public abstract class INodeWithAdditionalFields extends INode
implements LinkedElement { implements LinkedElement {
static enum PermissionStatusFormat { enum PermissionStatusFormat {
MODE(null, 16), MODE(null, 16),
GROUP(MODE.BITS, 25), GROUP(MODE.BITS, 25),
USER(GROUP.BITS, 23); USER(GROUP.BITS, 23);

View File

@ -209,7 +209,7 @@ public class NameNode extends ReconfigurableBase implements
/** /**
* Categories of operations supported by the namenode. * Categories of operations supported by the namenode.
*/ */
public static enum OperationCategory { public enum OperationCategory {
/** Operations that are state agnostic */ /** Operations that are state agnostic */
UNCHECKED, UNCHECKED,
/** Read operation that does not change the namespace state */ /** Read operation that does not change the namespace state */

View File

@ -77,7 +77,7 @@ public static boolean supports(final LayoutFeature f, final int lv) {
* support downgrade. * support downgrade.
* </ul> * </ul>
*/ */
public static enum Feature implements LayoutFeature { public enum Feature implements LayoutFeature {
ROLLING_UPGRADE(-55, -53, -55, "Support rolling upgrade", false), ROLLING_UPGRADE(-55, -53, -55, "Support rolling upgrade", false),
EDITLOG_LENGTH(-56, -56, "Add length field to every edit log op"), EDITLOG_LENGTH(-56, -56, "Add length field to every edit log op"),
XATTRS(-57, -57, "Extended attributes"), XATTRS(-57, -57, "Extended attributes"),

View File

@ -28,7 +28,7 @@ public class ReceivedDeletedBlockInfo {
BlockStatus status; BlockStatus status;
String delHints; String delHints;
public static enum BlockStatus { public enum BlockStatus {
RECEIVING_BLOCK(1), RECEIVING_BLOCK(1),
RECEIVED_BLOCK(2), RECEIVED_BLOCK(2),
DELETED_BLOCK(3); DELETED_BLOCK(3);

View File

@ -61,7 +61,7 @@ class OfflineEditsXmlLoader
private long nextTxId; private long nextTxId;
private final OpInstanceCache opCache = new OpInstanceCache(); private final OpInstanceCache opCache = new OpInstanceCache();
static enum ParseState { enum ParseState {
EXPECT_EDITS_TAG, EXPECT_EDITS_TAG,
EXPECT_VERSION, EXPECT_VERSION,
EXPECT_RECORD, EXPECT_RECORD,

View File

@ -73,7 +73,7 @@
* @param <E> The element type, which must implement {@link Element} interface. * @param <E> The element type, which must implement {@link Element} interface.
*/ */
public class Diff<K, E extends Diff.Element<K>> { public class Diff<K, E extends Diff.Element<K>> {
public static enum ListType { public enum ListType {
CREATED, DELETED CREATED, DELETED
} }

View File

@ -1123,7 +1123,7 @@ public void testCreateNonCanonicalPathAndRestartFromUri()
doCreateTest(CreationMethod.PATH_FROM_URI); doCreateTest(CreationMethod.PATH_FROM_URI);
} }
private static enum CreationMethod { private enum CreationMethod {
DIRECT_NN_RPC, DIRECT_NN_RPC,
PATH_FROM_URI, PATH_FROM_URI,
PATH_FROM_STRING PATH_FROM_STRING

View File

@ -82,7 +82,7 @@ public class TestFailureToReadEdits {
private NameNode nn1; private NameNode nn1;
private FileSystem fs; private FileSystem fs;
private static enum TestType { private enum TestType {
SHARED_DIR_HA, SHARED_DIR_HA,
QJM_HA; QJM_HA;
}; };