Examples of FsDelegationToken


Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      // Get the target fs (HBase region server fs) delegation token
      // Since we have checked the permission via 'preBulkLoadHFile', now let's give
      // the 'request user' necessary token to operate on the target fs.
      // After this point the 'doAs' user will hold two tokens, one for the source fs
      // ('request user'), another for the target fs (HBase region server principal).
      FsDelegationToken targetfsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      try {
        targetfsDelegationToken.acquireDelegationToken(fs);
      } catch (IOException e) {
        ResponseConverter.setControllerException(controller, e);
        done.run(null);
        return;
      }
      ugi.addToken(targetfsDelegationToken.getUserToken());

      loaded = ugi.doAs(new PrivilegedAction<Boolean>() {
        @Override
        public Boolean run() {
          FileSystem fs = null;
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      Configuration conf = getConf();
      // disable blockcache for tool invocation, see HBASE-10500
      conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
      this.hbAdmin = new HBaseAdmin(conf);
      this.userProvider = UserProvider.instantiate(conf);
      this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true);
      maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      LOG.debug("Add Input Path=" + path);
      SequenceFileInputFormat.addInputPath(job, path);
    }

    UserProvider userProvider = UserProvider.instantiate(job.getConfiguration());
    FsDelegationToken inputFsToken = new FsDelegationToken(userProvider, "irenewer");
    FsDelegationToken outputFsToken = new FsDelegationToken(userProvider, "orenewer");
    try {
      // Acquire the delegation Tokens
      inputFsToken.acquireDelegationToken(inputFs);
      outputFsToken.acquireDelegationToken(outputFs);

      // Run the MR Job
      if (!job.waitForCompletion(true)) {
        // TODO: Replace the fixed string with job.getStatus().getFailureInfo()
        // when it will be available on all the supported versions.
        throw new ExportSnapshotException("Copy Files Map-Reduce Job failed");
      }
    } finally {
      inputFsToken.releaseDelegationToken();
      outputFsToken.releaseDelegationToken();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

    setConf(HBaseConfiguration.create(getConf()));
    // disable blockcache for tool invocation, see HBASE-10500
    getConf().setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
    this.hbAdmin = new HBaseAdmin(conf);
    this.userProvider = UserProvider.instantiate(conf);
    this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer");
    assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true);
    maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      // Get the target fs (HBase region server fs) delegation token
      // Since we have checked the permission via 'preBulkLoadHFile', now let's give
      // the 'request user' necessary token to operate on the target fs.
      // After this point the 'doAs' user will hold two tokens, one for the source fs
      // ('request user'), another for the target fs (HBase region server principal).
      FsDelegationToken targetfsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      try {
        targetfsDelegationToken.acquireDelegationToken(fs);
      } catch (IOException e) {
        ResponseConverter.setControllerException(controller, e);
        done.run(null);
        return;
      }
      Token<?> targetFsToken = targetfsDelegationToken.getUserToken();
      if (targetFsToken != null && (userToken == null
          || !targetFsToken.getService().equals(userToken.getService()))) {
        ugi.addToken(targetFsToken);
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

    setConf(HBaseConfiguration.create(getConf()));
    // disable blockcache for tool invocation, see HBASE-10500
    getConf().setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
    this.hbAdmin = new HBaseAdmin(conf);
    this.userProvider = UserProvider.instantiate(conf);
    this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer");
    assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true);
    maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      Configuration conf = getConf();
      // disable blockcache for tool invocation, see HBASE-10500
      conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
      this.hbAdmin = new HBaseAdmin(conf);
      this.userProvider = UserProvider.instantiate(conf);
      this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true);
      maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      // Get the target fs (HBase region server fs) delegation token
      // Since we have checked the permission via 'preBulkLoadHFile', now let's give
      // the 'request user' necessary token to operate on the target fs.
      // After this point the 'doAs' user will hold two tokens, one for the source fs
      // ('request user'), another for the target fs (HBase region server principal).
      FsDelegationToken targetfsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      try {
        targetfsDelegationToken.acquireDelegationToken(fs);
      } catch (IOException e) {
        ResponseConverter.setControllerException(controller, e);
        done.run(null);
        return;
      }
      Token<?> targetFsToken = targetfsDelegationToken.getUserToken();
      if (targetFsToken != null && (userToken == null
          || !targetFsToken.getService().equals(userToken.getService()))) {
        ugi.addToken(targetFsToken);
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      Configuration conf = getConf();
      // disable blockcache for tool invocation, see HBASE-10500
      conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
      this.hbAdmin = new HBaseAdmin(conf);
      this.userProvider = UserProvider.instantiate(conf);
      this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true);
      maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.security.token.FsDelegationToken

      Configuration conf = getConf();
      // disable blockcache for tool invocation, see HBASE-10500
      conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
      this.hbAdmin = new HBaseAdmin(conf);
      this.userProvider = UserProvider.instantiate(conf);
      this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer");
      assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true);
      maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32);
    }
  }
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.