Search in sources :

Example 1 with AppChecker

use of org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker in project hadoop by apache.

the class SCMStore method createAppCheckerService.

/**
   * Create an instance of the AppChecker service via reflection based on the
   * {@link YarnConfiguration#SCM_APP_CHECKER_CLASS} parameter.
   * 
   * @param conf
   * @return an instance of the AppChecker class
   */
@Private
@SuppressWarnings("unchecked")
public static AppChecker createAppCheckerService(Configuration conf) {
    Class<? extends AppChecker> defaultCheckerClass;
    try {
        defaultCheckerClass = (Class<? extends AppChecker>) Class.forName(YarnConfiguration.DEFAULT_SCM_APP_CHECKER_CLASS);
    } catch (Exception e) {
        throw new YarnRuntimeException("Invalid default scm app checker class" + YarnConfiguration.DEFAULT_SCM_APP_CHECKER_CLASS, e);
    }
    AppChecker checker = ReflectionUtils.newInstance(conf.getClass(YarnConfiguration.SCM_APP_CHECKER_CLASS, defaultCheckerClass, AppChecker.class), conf);
    return checker;
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) AppChecker(org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker) YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) YarnException(org.apache.hadoop.yarn.exceptions.YarnException) Private(org.apache.hadoop.classification.InterfaceAudience.Private)

Aggregations

Private (org.apache.hadoop.classification.InterfaceAudience.Private)1 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1 AppChecker (org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker)1