HDFS-5860. Refactor INodeDirectory getDirectoryXFeature methods to use common getFeature helper method. Contributed by Jing Zhao.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-4685@1563374 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e8cabf8ce
commit
3fd9f29d56
|
@ -56,6 +56,9 @@ HDFS-4685 (Unreleased)
|
|||
HDFS-5858. Refactor common ACL test cases to be run through multiple
|
||||
FileSystem implementations. (cnauroth)
|
||||
|
||||
HDFS-5860. Refactor INodeDirectory getDirectoryXFeature methods to use
|
||||
common getFeature helper method. (Jing Zhao via cnauroth)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
BUG FIXES
|
||||
|
|
|
@ -146,12 +146,7 @@ public class INodeDirectory extends INodeWithAdditionalFields
|
|||
* otherwise, return null.
|
||||
*/
|
||||
public final DirectoryWithQuotaFeature getDirectoryWithQuotaFeature() {
|
||||
for (Feature f : features) {
|
||||
if (f instanceof DirectoryWithQuotaFeature) {
|
||||
return (DirectoryWithQuotaFeature)f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return getFeature(DirectoryWithQuotaFeature.class);
|
||||
}
|
||||
|
||||
/** Is this directory with quota? */
|
||||
|
@ -186,12 +181,7 @@ public class INodeDirectory extends INodeWithAdditionalFields
|
|||
* otherwise, return null.
|
||||
*/
|
||||
public final DirectoryWithSnapshotFeature getDirectoryWithSnapshotFeature() {
|
||||
for (Feature f : features) {
|
||||
if (f instanceof DirectoryWithSnapshotFeature) {
|
||||
return (DirectoryWithSnapshotFeature) f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return getFeature(DirectoryWithSnapshotFeature.class);
|
||||
}
|
||||
|
||||
/** Is this file has the snapshot feature? */
|
||||
|
|
Loading…
Reference in New Issue