HADOOP-16307. Intern User Name and Group Name in FileStatus.

Author:    David Mollitor

(cherry picked from commit 2713dcf6e9)
This commit is contained in:
David Mollitor 2019-05-16 16:03:34 +02:00 committed by Steve Loughran
parent d4b4d90a52
commit cf0d5a0e6e
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.fs.protocolPB;
import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.StringInterner;
import java.io.IOException; import java.io.IOException;
@ -91,8 +92,8 @@ public final class PBHelper {
mtime = proto.getModificationTime(); mtime = proto.getModificationTime();
atime = proto.getAccessTime(); atime = proto.getAccessTime();
permission = convert(proto.getPermission()); permission = convert(proto.getPermission());
owner = proto.getOwner(); owner = StringInterner.weakIntern(proto.getOwner());
group = proto.getGroup(); group = StringInterner.weakIntern(proto.getGroup());
int flags = proto.getFlags(); int flags = proto.getFlags();
FileStatus fileStatus = new FileStatus(length, isdir, blockReplication, FileStatus fileStatus = new FileStatus(length, isdir, blockReplication,
blocksize, mtime, atime, permission, owner, group, symlink, path, blocksize, mtime, atime, permission, owner, group, symlink, path,