Package org.apache.hadoop.fs.permission

Examples of org.apache.hadoop.fs.permission.PermissionStatus



    private INodeSymlink loadINodeSymlink(INodeSection.INode n) {
      assert n.getType() == INodeSection.INode.Type.SYMLINK;
      INodeSection.INodeSymlink s = n.getSymlink();
      final PermissionStatus permissions = loadPermission(s.getPermission(),
          parent.getLoaderContext().getStringTable());
      INodeSymlink sym = new INodeSymlink(n.getId(), n.getName().toByteArray(),
          permissions, s.getModificationTime(), s.getAccessTime(),
          s.getTarget().toStringUtf8());
      return sym;
View Full Code Here


  UpgradeCommand processDistributedUpgradeCommand(UpgradeCommand comm) throws IOException {
    return upgradeManager.processUpgradeCommand(comm);
  }

  PermissionStatus createFsOwnerPermissions(FsPermission permission) {
    return new PermissionStatus(fsOwner.getShortUserName(), supergroup, permission);
  }
View Full Code Here

  boolean startDistributedUpgradeIfNeeded() throws IOException {
    return upgradeManager.startUpgrade();
  }

  PermissionStatus createFsOwnerPermissions(FsPermission permission) {
    return new PermissionStatus(fsOwner.getShortUserName(), supergroup, permission);
  }
View Full Code Here

    }

    // add a bunch of transactions.
    @Override
    public void run() {
      PermissionStatus p = namesystem.createFsOwnerPermissions(
                                          new FsPermission((short)0777));
      FSEditLog editLog = namesystem.getEditLog();

      for (int i = 0; i < numTransactions; i++) {
        INodeFileUnderConstruction inode = new INodeFileUnderConstruction(
View Full Code Here

      LOG.debug("Running " + GenericTestUtils.getMethodName());   
    }
    LeaseManager.Lease lm = mock(LeaseManager.Lease.class);
    Path file = spy(new Path("/test.dat"));
    DatanodeDescriptor dnd = mock(DatanodeDescriptor.class);
    PermissionStatus ps =
      new PermissionStatus("test", "test", new FsPermission((short)0777));
   
    fsn.dir.addFile(file.toString(), ps, (short)3, 1l,
      "test", "test-machine", dnd, 1001l);
    assertTrue("True has to be returned in this case",
        releaseLease(fsn, lm, file));
View Full Code Here

    }
    LeaseManager.Lease lm = mock(LeaseManager.Lease.class);
    Path file =
      spy(new Path("/" + GenericTestUtils.getMethodName() + "_test.dat"));   
    DatanodeDescriptor dnd = mock(DatanodeDescriptor.class);
    PermissionStatus ps =
      new PermissionStatus("test", "test", new FsPermission((short)0777));
   
    mockFileBlocks(2, null,
      HdfsServerConstants.BlockUCState.UNDER_CONSTRUCTION, file, dnd, ps, false);
   
    releaseLease(fsn, lm, file);
View Full Code Here

    }
    LeaseManager.Lease lm = mock(LeaseManager.Lease.class);
    Path file =
      spy(new Path("/" + GenericTestUtils.getMethodName() + "_test.dat"));
    DatanodeDescriptor dnd = mock(DatanodeDescriptor.class);
    PermissionStatus ps =
      new PermissionStatus("test", "test", new FsPermission((short)0777));

    mockFileBlocks(2, HdfsServerConstants.BlockUCState.COMMITTED,
      HdfsServerConstants.BlockUCState.COMMITTED, file, dnd, ps, false);

    releaseLease(fsn, lm, file);
View Full Code Here

    }
    LeaseManager.Lease lm = mock(LeaseManager.Lease.class);
    Path file =
      spy(new Path("/" + GenericTestUtils.getMethodName() + "_test.dat"));
    DatanodeDescriptor dnd = mock(DatanodeDescriptor.class);
    PermissionStatus ps =
      new PermissionStatus("test", "test", new FsPermission((short)0777));

    mockFileBlocks(0, null, null, file, dnd, ps, false);

    assertTrue("True has to be returned in this case",
        releaseLease(fsn, lm, file));
View Full Code Here

    }
    LeaseManager.Lease lm = mock(LeaseManager.Lease.class);
    Path file =
      spy(new Path("/" + GenericTestUtils.getMethodName() + "_test.dat"));
    DatanodeDescriptor dnd = mock(DatanodeDescriptor.class);
    PermissionStatus ps =
      new PermissionStatus("test", "test", new FsPermission((short)0777));

    mockFileBlocks(1, null, HdfsServerConstants.BlockUCState.COMMITTED, file, dnd, ps, false);

    releaseLease(fsn, lm, file);
    fail("FSNamesystem.internalReleaseLease suppose to throw " +
View Full Code Here

    }
    LeaseManager.Lease lm = mock(LeaseManager.Lease.class);
    Path file =
      spy(new Path("/" + GenericTestUtils.getMethodName() + "_test.dat"));
    DatanodeDescriptor dnd = mock(DatanodeDescriptor.class);
    PermissionStatus ps =
      new PermissionStatus("test", "test", new FsPermission((short)0777));
   
    mockFileBlocks(2, HdfsServerConstants.BlockUCState.COMMITTED,
      HdfsServerConstants.BlockUCState.UNDER_CONSTRUCTION, file, dnd, ps, false);
       
    assertFalse("False is expected in return in this case",
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.permission.PermissionStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.