|
@@ -198,6 +198,7 @@ public class HttpFSFileSystem extends FileSystem
|
|
|
|
|
|
public static final String ENC_BIT_JSON = "encBit";
|
|
|
public static final String EC_BIT_JSON = "ecBit";
|
|
|
+ public static final String SNAPSHOT_BIT_JSON = "seBit";
|
|
|
|
|
|
public static final String DIRECTORY_LISTING_JSON = "DirectoryListing";
|
|
|
public static final String PARTIAL_LISTING_JSON = "partialListing";
|
|
@@ -1066,19 +1067,27 @@ public class HttpFSFileSystem extends FileSystem
|
|
|
final Boolean aclBit = (Boolean) json.get(ACL_BIT_JSON);
|
|
|
final Boolean encBit = (Boolean) json.get(ENC_BIT_JSON);
|
|
|
final Boolean erasureBit = (Boolean) json.get(EC_BIT_JSON);
|
|
|
+ final Boolean snapshotEnabledBit = (Boolean) json.get(SNAPSHOT_BIT_JSON);
|
|
|
final boolean aBit = (aclBit != null) ? aclBit : false;
|
|
|
final boolean eBit = (encBit != null) ? encBit : false;
|
|
|
final boolean ecBit = (erasureBit != null) ? erasureBit : false;
|
|
|
- if (aBit || eBit || ecBit) {
|
|
|
+ final boolean seBit =
|
|
|
+ (snapshotEnabledBit != null) ? snapshotEnabledBit : false;
|
|
|
+ if (aBit || eBit || ecBit || seBit) {
|
|
|
// include this for compatibility with 2.x
|
|
|
FsPermissionExtension deprecatedPerm =
|
|
|
new FsPermissionExtension(permission, aBit, eBit, ecBit);
|
|
|
- return new FileStatus(len, FILE_TYPE.DIRECTORY == type,
|
|
|
+ FileStatus fileStatus = new FileStatus(len, FILE_TYPE.DIRECTORY == type,
|
|
|
replication, blockSize, mTime, aTime, deprecatedPerm, owner, group,
|
|
|
null, path, aBit, eBit, ecBit);
|
|
|
+ if (seBit) {
|
|
|
+ fileStatus.setSnapShotEnabledFlag(seBit);
|
|
|
+ }
|
|
|
+ return fileStatus;
|
|
|
+ } else {
|
|
|
+ return new FileStatus(len, FILE_TYPE.DIRECTORY == type,
|
|
|
+ replication, blockSize, mTime, aTime, permission, owner, group, path);
|
|
|
}
|
|
|
- return new FileStatus(len, FILE_TYPE.DIRECTORY == type,
|
|
|
- replication, blockSize, mTime, aTime, permission, owner, group, path);
|
|
|
}
|
|
|
|
|
|
/**
|