use of com.tencent.angel.AppSubmitter in project angel by Tencent.
the class AngelRunJar method submit.
public static void submit(Configuration conf) throws Exception {
LOG.info("angel python file: " + conf.get("angel.pyangel.pyfile"));
if (null != conf.get("angel.pyangel.pyfile")) {
conf.set(AngelConf.ANGEL_APP_SUBMIT_CLASS, "com.tencent.angel.api.python.PythonRunner");
}
// instance submitter class
final String submitClassName = conf.get(AngelConf.ANGEL_APP_SUBMIT_CLASS, AngelConf.DEFAULT_ANGEL_APP_SUBMIT_CLASS);
setKerberos(conf);
UserGroupInformation ugi = UGITools.getCurrentUser(conf);
ugi.doAs(new PrivilegedExceptionAction<String>() {
@Override
public String run() throws Exception {
AppSubmitter submmiter = null;
try {
Class<?> submitClass = Class.forName(submitClassName);
submmiter = (AppSubmitter) submitClass.newInstance();
LOG.info("submitClass: " + submitClass.getName());
} catch (Exception x) {
String message = "load submit class failed " + x.getMessage();
LOG.fatal(message, x);
throw new InvalidParameterException(message);
}
submmiter.submit(conf);
return "OK";
}
});
}
Aggregations