Java 类org.apache.hadoop.hbase.util.Methods 实例源码

项目:ditb    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class<?> c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:ditb    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class<?> c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:LCIndex-HBase-0.94.16    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:LCIndex-HBase-0.94.16    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:LCIndex-HBase-0.94.16    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:pbase    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class<?> c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:pbase    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class<?> c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:HIndex    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:HIndex    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:HIndex    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:IRIndex    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:IRIndex    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:IRIndex    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:RStore    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:RStore    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:RStore    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:PyroDB    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:PyroDB    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:PyroDB    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:c5    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:c5    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:c5    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:HBase-Research    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:HBase-Research    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:HBase-Research    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:hbase-0.94.8-qod    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:hbase-0.94.8-qod    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:hbase-0.94.8-qod    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:hbase-0.94.8-qod    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:hbase-0.94.8-qod    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:hbase-0.94.8-qod    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:DominoHBase    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:DominoHBase    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:DominoHBase    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:hindex    文件:User.java   
@Override
public void obtainAuthTokenForJob(Configuration conf, Job job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{Configuration.class, UserGroupInformation.class,
            Job.class},
        new Object[]{conf, ugi, job});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:hindex    文件:User.java   
@Override
public void obtainAuthTokenForJob(JobConf job)
    throws IOException, InterruptedException {
  try {
    Class c = Class.forName(
        "org.apache.hadoop.hbase.security.token.TokenUtil");
    Methods.call(c, null, "obtainTokenForJob",
        new Class[]{JobConf.class, UserGroupInformation.class},
        new Object[]{job, ugi});
  } catch (ClassNotFoundException cnfe) {
    throw new RuntimeException("Failure loading TokenUtil class, "
        +"is secure RPC available?", cnfe);
  } catch (IOException ioe) {
    throw ioe;
  } catch (InterruptedException ie) {
    throw ie;
  } catch (RuntimeException re) {
    throw re;
  } catch (Exception e) {
    throw new UndeclaredThrowableException(e,
        "Unexpected error calling TokenUtil.obtainAndCacheToken()");
  }
}
项目:hindex    文件:User.java   
/**
 * Obtain credentials for the current process using the configured
 * Kerberos keytab file and principal.
 * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String)
 *
 * @param conf the Configuration to use
 * @param fileConfKey Configuration property key used to store the path
 * to the keytab file
 * @param principalConfKey Configuration property key used to store the
 * principal name to login as
 * @param localhost the local hostname
 */
public static void login(Configuration conf, String fileConfKey,
    String principalConfKey, String localhost) throws IOException {
  if (isSecurityEnabled()) {
    // check for SecurityUtil class
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[]{
          Configuration.class, String.class, String.class, String.class };
      Object[] args = new Object[]{
          conf, fileConfKey, principalConfKey, localhost };
      Methods.call(c, null, "login", types, args);
    } catch (ClassNotFoundException cnfe) {
      throw new RuntimeException("Unable to login using " +
          "org.apache.hadoop.security.SecurityUtil.login(). SecurityUtil class " +
          "was not found!  Is this a version of secure Hadoop?", cnfe);
    } catch (IOException ioe) {
      throw ioe;
    } catch (RuntimeException re) {
      throw re;
    } catch (Exception e) {
      throw new UndeclaredThrowableException(e,
          "Unhandled exception in User.login()");
    }
  }
}
项目:ditb    文件:User.java   
/**
 * Executes the given action as the login user
 * @param action
 * @return the result of the action
 * @throws IOException
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> T runAsLoginUser(PrivilegedExceptionAction<T> action) throws IOException {
  try {
    Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
    Class [] types = new Class[]{PrivilegedExceptionAction.class};
    Object[] args = new Object[]{action};
    return (T) Methods.call(c, null, "doAsLoginUser", types, args);
  } catch (Throwable e) {
    throw new IOException(e);
  }
}
项目:LCIndex-HBase-0.94.16    文件:SecureBulkLoadClient.java   
public String prepareBulkLoad(byte[] tableName) throws IOException {
  try {
    String bulkToken = (String) Methods.call(protocolClazz, proxy,
        "prepareBulkLoad", new Class[]{byte[].class}, new Object[]{tableName});
    return bulkToken;
  } catch (Exception e) {
    throw new IOException("Failed to prepareBulkLoad", e);
  }
}
项目:LCIndex-HBase-0.94.16    文件:SecureBulkLoadClient.java   
public void cleanupBulkLoad(String bulkToken) throws IOException {
  try {
    Methods.call(protocolClazz, proxy,
        "cleanupBulkLoad", new Class[]{String.class},new Object[]{bulkToken});
  } catch (Exception e) {
    throw new IOException("Failed to prepareBulkLoad", e);
  }
}