Examples of toShort()


Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

  private void assertPermissions(File f, int expected) throws IOException {
    FileSystem localfs = FileSystem.getLocal(new Configuration());
    FsPermission perms = localfs.getFileStatus(
      new Path(f.getAbsolutePath())).getPermission();
    assertEquals(expected, perms.toShort());
  }

  @Test (timeout = 30000)
  public void testGetUserName() throws IOException {
    if (Path.WINDOWS) {
View Full Code Here

Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

            " for rsrc vis " + p.getKey().getVisibility().name());
        assert(rsrcVis.containsKey(p.getKey()));
        switch (rsrcVis.get(p.getKey())) {
        case PUBLIC:
          Assert.assertTrue("Public file should be 555",
              perm.toShort() == FSDownload.PUBLIC_FILE_PERMS.toShort());
          break;
        case PRIVATE:
        case APPLICATION:
          Assert.assertTrue("Private file should be 500",
              perm.toShort() == FSDownload.PRIVATE_FILE_PERMS.toShort());         
View Full Code Here

Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

              perm.toShort() == FSDownload.PUBLIC_FILE_PERMS.toShort());
          break;
        case PRIVATE:
        case APPLICATION:
          Assert.assertTrue("Private file should be 500",
              perm.toShort() == FSDownload.PRIVATE_FILE_PERMS.toShort());         
          break;
        }
      }
    } catch (ExecutionException e) {
      throw new IOException("Failed exec", e);
View Full Code Here

Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

        FsPermission fsp = new FsPermission(
            JobHistoryUtils.HISTORY_DONE_DIR_PERMISSION);
        doneDirFc.mkdir(path, fsp, true);
        FileStatus fsStatus = doneDirFc.getFileStatus(path);
        LOG.info("Perms after creating " + fsStatus.getPermission().toShort()
            + ", Expected: " + fsp.toShort());
        if (fsStatus.getPermission().toShort() != fsp.toShort()) {
          LOG.info("Explicitly setting permissions to : " + fsp.toShort()
              + ", " + fsp);
          doneDirFc.setPermission(path, fsp);
        }
View Full Code Here

Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

            JobHistoryUtils.HISTORY_DONE_DIR_PERMISSION);
        doneDirFc.mkdir(path, fsp, true);
        FileStatus fsStatus = doneDirFc.getFileStatus(path);
        LOG.info("Perms after creating " + fsStatus.getPermission().toShort()
            + ", Expected: " + fsp.toShort());
        if (fsStatus.getPermission().toShort() != fsp.toShort()) {
          LOG.info("Explicitly setting permissions to : " + fsp.toShort()
              + ", " + fsp);
          doneDirFc.setPermission(path, fsp);
        }
        existingDoneSubdirs.add(path);
View Full Code Here

Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

        doneDirFc.mkdir(path, fsp, true);
        FileStatus fsStatus = doneDirFc.getFileStatus(path);
        LOG.info("Perms after creating " + fsStatus.getPermission().toShort()
            + ", Expected: " + fsp.toShort());
        if (fsStatus.getPermission().toShort() != fsp.toShort()) {
          LOG.info("Explicitly setting permissions to : " + fsp.toShort()
              + ", " + fsp);
          doneDirFc.setPermission(path, fsp);
        }
        existingDoneSubdirs.add(path);
      } catch (FileAlreadyExistsException faeE) { // Nothing to do.
View Full Code Here

Examples of org.apache.hadoop.fs.permission.FsPermission.toShort()

        perm = status.getPermission();
        System.out.println("File permission " + perm +
            " for rsrc vis " + p.getKey().getVisibility().name());
        assert(rsrcVis.containsKey(p.getKey()));
        Assert.assertTrue("Private file should be 500",
            perm.toShort() == FSDownload.PRIVATE_FILE_PERMS.toShort());
      }
    } catch (ExecutionException e) {
      throw new IOException("Failed exec", e);
    } finally {
      exec.shutdown();
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toShort()

      Facet facet = (Facet) enumeration.nextElement();
      String name = facet.getName();

      //-- maxExclusive
      if (Facet.MAX_EXCLUSIVE.equals(name))
        setMaxExclusive(facet.toShort());
      //-- maxInclusive
      else if (Facet.MAX_INCLUSIVE.equals(name))
        setMaxInclusive(facet.toShort());
      //-- minExclusive
      else if (Facet.MIN_EXCLUSIVE.equals(name)) {
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toShort()

      //-- maxExclusive
      if (Facet.MAX_EXCLUSIVE.equals(name))
        setMaxExclusive(facet.toShort());
      //-- maxInclusive
      else if (Facet.MAX_INCLUSIVE.equals(name))
        setMaxInclusive(facet.toShort());
      //-- minExclusive
      else if (Facet.MIN_EXCLUSIVE.equals(name)) {
        setMinExclusive(facet.toShort());
      }
      //-- minInclusive
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toShort()

      //-- maxInclusive
      else if (Facet.MAX_INCLUSIVE.equals(name))
        setMaxInclusive(facet.toShort());
      //-- minExclusive
      else if (Facet.MIN_EXCLUSIVE.equals(name)) {
        setMinExclusive(facet.toShort());
      }
      //-- minInclusive
      else if (Facet.MIN_INCLUSIVE.equals(name))
        setMinInclusive(facet.toShort());
      //-- pattern
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.