/** * load job token from a file * @deprecated Use {@link Credentials#readTokenStorageFile} instead, * this method is included for compatibility against Hadoop-1. * @param conf * @throws IOException */ @InterfaceAudience.Private @Deprecated public static Credentials loadTokens(String jobTokenFile, Configuration conf) throws IOException { return loadTokens(jobTokenFile, new JobConf(conf)); }
/** * load job token from a file * @deprecated Use {@link Credentials#readTokenStorageFile} instead, * this method is included for compatibility against Hadoop-1. * @param conf * @throws IOException */ @InterfaceAudience.Private @Deprecated public static Credentials loadTokens(String jobTokenFile, Configuration conf) throws IOException { return loadTokens(jobTokenFile, new JobConf(conf)); }
/** * load job token from a file * @deprecated Use {@link Credentials#readTokenStorageFile} instead, * this method is included for compatibility against Hadoop-1. * @param conf * @throws IOException */ @InterfaceAudience.Private @Deprecated public static Credentials loadTokens(String jobTokenFile, Configuration conf) throws IOException { return loadTokens(jobTokenFile, new JobConf(conf)); }
/** * load job token from a file * @deprecated Use {@link Credentials#readTokenStorageFile} instead, * this method is included for compatibility against Hadoop-1. * @param conf * @throws IOException */ @InterfaceAudience.Private @Deprecated public static Credentials loadTokens(String jobTokenFile, Configuration conf) throws IOException { return loadTokens(jobTokenFile, new JobConf(conf)); }
/** * Obtain JobToken, which we'll use as a credential for SASL authentication * when connecting to other Giraph BSPWorkers. * * @param conf Configuration * @return a JobToken containing username and password so that client can * authenticate with a server. */ private Token<JobTokenIdentifier> createJobToken(Configuration conf) throws IOException { String localJobTokenFile = System.getenv().get( UserGroupInformation.HADOOP_TOKEN_FILE_LOCATION); if (localJobTokenFile != null) { JobConf jobConf = new JobConf(conf); Credentials credentials = TokenCache.loadTokens(localJobTokenFile, jobConf); return TokenCache.getJobToken(credentials); } else { throw new IOException("createJobToken: Cannot obtain authentication " + "credentials for job: file: '" + UserGroupInformation.HADOOP_TOKEN_FILE_LOCATION + "' not found"); } }
TokenCache.loadTokens(localJobTokenFile, jobConf); Collection<Token<? extends TokenIdentifier>> collection = credentials.getAllTokens();
rjob.ugi = UserGroupInformation.createRemoteUser(t.getUser()); Credentials ts = TokenCache.loadTokens(localJobTokenFile, fConf); Token<JobTokenIdentifier> jt = TokenCache.getJobToken(ts); if (jt != null) { //could be null in the case of some unit tests
System.getenv().get(UserGroupInformation.HADOOP_TOKEN_FILE_LOCATION); Credentials credentials = TokenCache.loadTokens(jobTokenFile, defaultConf); LOG.debug("loading token. # keys =" +credentials.numberOfSecretKeys() + "; from file=" + jobTokenFile);