Exemplo n.º 1
0
 private static void updateExcludedSymbols() {
   Configuration conf = FTConfiguration.create();
   Collection<String> excludes = conf.getStringCollection("tx.exclude.symbols");
   for (String s : excludes) {
     Symbol symbol = new Symbol(s);
     EXCLUDED_SYMBOLS.add(symbol);
   }
 }
    @Override
    protected void setup(Context context) throws IOException, InterruptedException {
      super.setup(context);

      final Configuration conf = context.getConfiguration();

      // get permissible file extensions from the configuration
      Extensions.clear();
      Extensions.addAll(conf.getStringCollection("extensions"));
    }
Exemplo n.º 3
0
  // TODO: HADOOP UPGRADE - replace with YarnConfiguration constants
  private Token<RMDelegationTokenIdentifier> getRMHAToken(
      org.apache.hadoop.yarn.api.records.Token rmDelegationToken) {
    // Build a list of service addresses to form the service name
    ArrayList<String> services = new ArrayList<String>();
    for (String rmId : conf.getStringCollection(RM_HA_IDS)) {
      LOG.info("Yarn Resource Manager id: {}", rmId);
      // Set RM_ID to get the corresponding RM_ADDRESS
      services.add(
          SecurityUtil.buildTokenService(
                  NetUtils.createSocketAddr(
                      conf.get(RM_HOSTNAME_PREFIX + rmId),
                      YarnConfiguration.DEFAULT_RM_PORT,
                      RM_HOSTNAME_PREFIX + rmId))
              .toString());
    }
    Text rmTokenService = new Text(Joiner.on(',').join(services));

    return new Token<RMDelegationTokenIdentifier>(
        rmDelegationToken.getIdentifier().array(),
        rmDelegationToken.getPassword().array(),
        new Text(rmDelegationToken.getKind()),
        rmTokenService);
  }