Java 类org.apache.hadoop.mapred.Master 实例源码

项目:hadoop    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  // RM skips renewing token with empty renewer
  String delegTokenRenewer = "";
  if (!isTokenRenewalExcluded(fs, conf)) {
    delegTokenRenewer = Master.getMasterPrincipal(conf);
    if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
      throw new IOException(
          "Can't get Master Kerberos principal for use as renewer");
    }
  }

  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:big-c    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  // RM skips renewing token with empty renewer
  String delegTokenRenewer = "";
  if (!isTokenRenewalExcluded(fs, conf)) {
    delegTokenRenewer = Master.getMasterPrincipal(conf);
    if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
      throw new IOException(
          "Can't get Master Kerberos principal for use as renewer");
    }
  }

  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:hadoop-plus    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:FlexMap    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:hops    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  // RM skips renewing token with empty renewer
  String delegTokenRenewer = "";
  if (!isTokenRenewalExcluded(fs, conf)) {
    delegTokenRenewer = Master.getMasterPrincipal(conf);
    if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
      throw new IOException(
          "Can't get Master Kerberos principal for use as renewer");
    }
  }

  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:hadoop-TCP    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:hardfs    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:hadoop-on-lustre2    文件:TokenCache.java   
/**
 * get delegation token for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
static void obtainTokensForNamenodesInternal(FileSystem fs, 
    Credentials credentials, Configuration conf) throws IOException {
  String delegTokenRenewer = Master.getMasterPrincipal(conf);
  if (delegTokenRenewer == null || delegTokenRenewer.length() == 0) {
    throw new IOException(
        "Can't get Master Kerberos principal for use as renewer");
  }
  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
项目:incubator-gobblin    文件:TokenUtils.java   
private static Token<?> getDelegationTokenFromHS(HSClientProtocol hsProxy, Configuration conf) throws IOException {
  GetDelegationTokenRequest request =
      RecordFactoryProvider.getRecordFactory(null).newRecordInstance(GetDelegationTokenRequest.class);
  request.setRenewer(Master.getMasterPrincipal(conf));
  org.apache.hadoop.yarn.api.records.Token mrDelegationToken;
  mrDelegationToken = hsProxy.getDelegationToken(request).getDelegationToken();
  return ConverterUtils.convertFromYarn(mrDelegationToken, hsProxy.getConnectAddress());
}
项目:azkaban-plugins    文件:HadoopSecurityManager_H_2_0.java   
private Token<?> getDelegationTokenFromHS(HSClientProtocol hsProxy)
    throws IOException, InterruptedException {
  GetDelegationTokenRequest request =
      recordFactory.newRecordInstance(GetDelegationTokenRequest.class);
  request.setRenewer(Master.getMasterPrincipal(conf));
  org.apache.hadoop.yarn.api.records.Token mrDelegationToken;
  mrDelegationToken =
      hsProxy.getDelegationToken(request).getDelegationToken();
  return ConverterUtils.convertFromYarn(mrDelegationToken,
      hsProxy.getConnectAddress());
}