コード例 #1
0
 private static INodeDirectory createINodeDirectory(
     INodeDirectory parent, String name, String owner, String group, short perm)
     throws IOException {
   PermissionStatus permStatus =
       PermissionStatus.createImmutable(owner, group, FsPermission.createImmutable(perm));
   INodeDirectory inodeDirectory =
       new INodeDirectory(INodeId.GRANDFATHER_INODE_ID, name.getBytes("UTF-8"), permStatus, 0L);
   parent.addChild(inodeDirectory);
   return inodeDirectory;
 }
コード例 #2
0
 private static INodeFile createINodeFile(
     INodeDirectory parent, String name, String owner, String group, short perm)
     throws IOException {
   PermissionStatus permStatus =
       PermissionStatus.createImmutable(owner, group, FsPermission.createImmutable(perm));
   INodeFile inodeFile =
       new INodeFile(
           INodeId.GRANDFATHER_INODE_ID,
           name.getBytes("UTF-8"),
           permStatus,
           0L,
           0L,
           null,
           REPLICATION,
           PREFERRED_BLOCK_SIZE);
   parent.addChild(inodeFile);
   return inodeFile;
 }