Package org.apache.hadoop.hdfs.security

Examples of org.apache.hadoop.hdfs.security.BlockAccessToken


        DatanodeInfo srcNode = new DatanodeInfo(dnRegistration);

        //
        // Header info
        //
        BlockAccessToken accessToken = BlockAccessToken.DUMMY_TOKEN;
        if (isAccessTokenEnabled) {
          accessToken = accessTokenHandler.generateToken(null, b.getBlockId(),
              EnumSet.of(AccessTokenHandler.AccessMode.WRITE));
        }
        DataTransferProtocol.Sender.opWriteBlock(out,
View Full Code Here


      }
    }
   
    /* Send a block replace request to the output stream*/
    private void sendRequest(DataOutputStream out) throws IOException {
      BlockAccessToken accessToken = BlockAccessToken.DUMMY_TOKEN;
      if (isAccessTokenEnabled) {
        accessToken = accessTokenHandler.generateToken(null, block.getBlock()
            .getBlockId(), EnumSet.of(AccessTokenHandler.AccessMode.REPLACE,
            AccessTokenHandler.AccessMode.COPY));
      }
View Full Code Here

      stm.hflush();

      /*
       * wait till token used in stm expires
       */
      BlockAccessToken token = DFSTestUtil.getAccessToken(stm);
      while (!SecurityTestUtil.isAccessTokenExpired(token)) {
        try {
          Thread.sleep(10);
        } catch (InterruptedException ignored) {
        }
View Full Code Here

      stm.hflush();

      /*
       * wait till token used in stm expires
       */
      BlockAccessToken token = DFSTestUtil.getAccessToken(stm);
      while (!SecurityTestUtil.isAccessTokenExpired(token)) {
        try {
          Thread.sleep(10);
        } catch (InterruptedException ignored) {
        }
View Full Code Here

      DFSClient dfsclient = new DFSClient(new InetSocketAddress("localhost",
          cluster.getNameNodePort()), conf);
      List<LocatedBlock> locatedBlocks = dfsclient.getNamenode().getBlockLocations(
          FILE_TO_READ, 0, FILE_SIZE).getLocatedBlocks();
      LocatedBlock lblock = locatedBlocks.get(0); // first block
      BlockAccessToken myToken = lblock.getAccessToken();
      // verify token is not expired
      assertFalse(SecurityTestUtil.isAccessTokenExpired(myToken));
      // read with valid token, should succeed
      tryRead(conf, lblock, true);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.security.BlockAccessToken

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.