diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml b/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml index 478a931575..7aade70ceb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml @@ -1,9 +1,16 @@ + + + + + + + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/CacheFlag.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/fs/CacheFlag.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/CacheFlag.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/fs/CacheFlag.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/XAttr.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/fs/XAttr.java similarity index 99% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/XAttr.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/fs/XAttr.java index 968ee00ce7..f688c91072 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/fs/XAttr.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/fs/XAttr.java @@ -64,54 +64,54 @@ public static enum NameSpace { SYSTEM, RAW; } - + private final NameSpace ns; private final String name; private final byte[] value; - + public static class Builder { private NameSpace ns = NameSpace.USER; private String name; private byte[] value; - + public Builder setNameSpace(NameSpace ns) { this.ns = ns; return this; } - + public Builder setName(String name) { this.name = name; return this; } - + public Builder setValue(byte[] value) { this.value = value; return this; } - + public XAttr build() { return new XAttr(ns, name, value); } } - + private XAttr(NameSpace ns, String name, byte[] value) { this.ns = ns; this.name = name; this.value = value; } - + public NameSpace getNameSpace() { return ns; } - + public String getName() { return name; } - + public byte[] getValue() { return value; } - + @Override public int hashCode() { return new HashCodeBuilder(811, 67) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/Event.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/Event.java similarity index 99% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/Event.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/Event.java index a6de289b67..53eefa0425 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/Event.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/Event.java @@ -154,7 +154,7 @@ public Builder symlinkTarget(String symlinkTarget) { this.symlinkTarget = symlinkTarget; return this; } - + public Builder overwrite(boolean overwrite) { this.overwrite = overwrite; return this; @@ -224,7 +224,7 @@ public FsPermission getPerms() { public String getSymlinkTarget() { return symlinkTarget; } - + public boolean getOverwrite() { return overwrite; } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatch.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatch.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatch.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatch.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatchList.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatchList.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatchList.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/inotify/EventBatchList.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/AlreadyBeingCreatedException.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/AlreadyBeingCreatedException.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/AlreadyBeingCreatedException.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/AlreadyBeingCreatedException.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockStoragePolicy.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/BlockStoragePolicy.java similarity index 99% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockStoragePolicy.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/BlockStoragePolicy.java index 4bfb33bb5b..9ecf6e8684 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockStoragePolicy.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/BlockStoragePolicy.java @@ -123,7 +123,7 @@ private List chooseStorageTypes(final short replication, * Choose the storage types for storing the remaining replicas, given the * replication number, the storage types of the chosen replicas and * the unavailable storage types. It uses fallback storage in case that - * the desired storage type is unavailable. + * the desired storage type is unavailable. * * @param replication the replication number. * @param chosen the storage types of the chosen replicas. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java similarity index 99% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java index 6065786147..1b5dbd336d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java @@ -61,7 +61,7 @@ public boolean equals(Object obj) { Arrays.equals(files, other.files); } - + @Override public int hashCode() { int result = cookie.hashCode(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeLocalInfo.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeLocalInfo.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeLocalInfo.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeLocalInfo.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java similarity index 97% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java index 169287b856..23802ad6db 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java @@ -28,13 +28,13 @@ public class DirectoryListing { private HdfsFileStatus[] partialListing; private int remainingEntries; - + /** * constructor * @param partialListing a partial listing of a directory * @param remainingEntries number of entries that are left to be listed */ - public DirectoryListing(HdfsFileStatus[] partialListing, + public DirectoryListing(HdfsFileStatus[] partialListing, int remainingEntries) { if (partialListing == null) { throw new IllegalArgumentException("partial listing should not be null"); @@ -54,7 +54,7 @@ public DirectoryListing(HdfsFileStatus[] partialListing, public HdfsFileStatus[] getPartialListing() { return partialListing; } - + /** * Get the number of remaining entries that are left to be listed * @return the number of remaining entries that are left to be listed @@ -62,7 +62,7 @@ public HdfsFileStatus[] getPartialListing() { public int getRemainingEntries() { return remainingEntries; } - + /** * Check if there are more entries that are left to be listed * @return true if there are more entries that are left to be listed; @@ -71,7 +71,7 @@ public int getRemainingEntries() { public boolean hasMore() { return remainingEntries != 0; } - + /** * Get the last name in this list * @return the last name in the list if it is not empty; otherwise return null diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/EncryptionZone.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/EncryptionZone.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/EncryptionZone.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/EncryptionZone.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LastBlockWithStatus.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/LastBlockWithStatus.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LastBlockWithStatus.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/LastBlockWithStatus.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java similarity index 93% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java index 7c28cd90ae..eeedd5a372 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java @@ -25,15 +25,15 @@ @InterfaceStability.Evolving public final class NSQuotaExceededException extends QuotaExceededException { protected static final long serialVersionUID = 1L; - + private String prefix; - + public NSQuotaExceededException() {} public NSQuotaExceededException(String msg) { super(msg); } - + public NSQuotaExceededException(long quota, long count) { super(quota, count); } @@ -42,9 +42,9 @@ public NSQuotaExceededException(long quota, long count) { public String getMessage() { String msg = super.getMessage(); if (msg == null) { - msg = "The NameSpace quota (directories and files)" + - (pathName==null?"":(" of directory " + pathName)) + - " is exceeded: quota=" + quota + " file count=" + count; + msg = "The NameSpace quota (directories and files)" + + (pathName==null?"":(" of directory " + pathName)) + + " is exceeded: quota=" + quota + " file count=" + count; if (prefix != null) { msg = prefix + ": " + msg; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java similarity index 95% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java index 6dfed79f28..f4e7f343f9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java @@ -23,15 +23,15 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -/** +/** * This exception is thrown when modification to HDFS results in violation - * of a directory quota. A directory quota might be namespace quota (limit - * on number of files and directories) or a diskspace quota (limit on space + * of a directory quota. A directory quota might be namespace quota (limit + * on number of files and directories) or a diskspace quota (limit on space * taken by all the file under the directory tree).

- * + * * The message for the exception specifies the directory where the quota - * was violated and actual quotas. Specific message is generated in the - * corresponding Exception class: + * was violated and actual quotas. Specific message is generated in the + * corresponding Exception class: * DSQuotaExceededException or * NSQuotaExceededException */ @@ -42,22 +42,22 @@ public class QuotaExceededException extends IOException { protected String pathName=null; protected long quota; // quota protected long count; // actual value - + protected QuotaExceededException() {} protected QuotaExceededException(String msg) { super(msg); } - + protected QuotaExceededException(long quota, long count) { this.quota = quota; this.count = count; } - + public void setPathName(String path) { this.pathName = path; } - + @Override public String getMessage() { return super.getMessage(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeInfo.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeInfo.java similarity index 99% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeInfo.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeInfo.java index 80e3e3478d..b5277979c3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeInfo.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeInfo.java @@ -31,7 +31,7 @@ public class RollingUpgradeInfo extends RollingUpgradeStatus { private final long startTime; private long finalizeTime; private boolean createdRollbackImages; - + public RollingUpgradeInfo(String blockPoolId, boolean createdRollbackImages, long startTime, long finalizeTime) { super(blockPoolId, finalizeTime != 0); @@ -39,7 +39,7 @@ public RollingUpgradeInfo(String blockPoolId, boolean createdRollbackImages, this.startTime = startTime; this.finalizeTime = finalizeTime; } - + public boolean createdRollbackImages() { return createdRollbackImages; } @@ -51,7 +51,7 @@ public void setCreatedRollbackImages(boolean created) { public boolean isStarted() { return startTime != 0; } - + /** @return The rolling upgrade starting time. */ public long getStartTime() { return startTime; @@ -102,7 +102,7 @@ public String toString() { + "\n Start Time: " + (startTime == 0? "": timestamp2String(startTime)) + "\n Finalize Time: " + (finalizeTime == 0? "": timestamp2String(finalizeTime)); } - + private static String timestamp2String(long timestamp) { return new Date(timestamp) + " (=" + timestamp + ")"; } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeStatus.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeStatus.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeStatus.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/RollingUpgradeStatus.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/SnapshotAccessControlException.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/SnapshotAccessControlException.java similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/SnapshotAccessControlException.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/SnapshotAccessControlException.java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/security/token/block/DataEncryptionKey.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/block/DataEncryptionKey.java similarity index 99% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/security/token/block/DataEncryptionKey.java rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/block/DataEncryptionKey.java index 41c84e2e4d..87411f29d8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/security/token/block/DataEncryptionKey.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/block/DataEncryptionKey.java @@ -31,7 +31,7 @@ public class DataEncryptionKey { public final byte[] encryptionKey; public final long expiryDate; public final String encryptionAlgorithm; - + public DataEncryptionKey(int keyId, String blockPoolId, byte[] nonce, byte[] encryptionKey, long expiryDate, String encryptionAlgorithm) { this.keyId = keyId; @@ -41,7 +41,7 @@ public DataEncryptionKey(int keyId, String blockPoolId, byte[] nonce, this.expiryDate = expiryDate; this.encryptionAlgorithm = encryptionAlgorithm; } - + @Override public String toString() { return keyId + "/" + blockPoolId + "/" + nonce.length + "/" + diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 03c52282a1..521315b362 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -458,6 +458,9 @@ Release 2.8.0 - UNRELEASED HDFS-8185. Separate client related routines in HAUtil into a new class. (wheat9) + HDFS-8218. Move classes that used by ClientProtocol into hdfs-client. + (wheat9) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than