public void addTokenFromUserToJobConf(UserGroupInformation user, JobConf jobConf)
      throws IOException {
    checkNotNull(user, "Provided UGI was null");
    checkNotNull(jobConf, "JobConf was null");

    // Accumulo token already in Configuration, but the Token isn't in the Job credentials like the
    // AccumuloInputFormat expects
    Token<?> accumuloToken = getAccumuloToken(user);

    // If we didn't find the Token, we can't proceed. Log the tokens for debugging.
    if (null == accumuloToken) {
      log.error("Could not find accumulo token in user: " + user.getTokens());
      throw new IOException("Could not find Accumulo Token in user's tokens");
    }

    // Add the Hadoop token back to the Job, the configuration still has the necessary
    // Accumulo token information.
    mergeTokenIntoJobConf(jobConf, accumuloToken);
  }
Extract the appropriate Token for Accumulo from the provided {@code user} and add it to the
{@link JobConf}'s credentials.

@param user
         User containing tokens
@param jobConf
         The configuration for the job
@throws IOException
          If the correct token is not found or the Token fails to be merged with the
          configuration
accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/HiveAccumuloHelper.java