public Builder impl(String className, Class<?>... types) { // don't do any work if an implementation has been found if (ctor != null) { return this; } try { Class<?> targetClass = Class.forName(className, true, loader); impl(targetClass, types); } catch (NoClassDefFoundError e) { // cannot load this implementation problems.put(className, e); } catch (ClassNotFoundException e) { // not the right implementation problems.put(className, e); } return this; }
public Builder impl(String className, Class<?>... types) { // don't do any work if an implementation has been found if (ctor != null) { return this; } try { Class<?> targetClass = Class.forName(className, true, loader); impl(targetClass, types); } catch (NoClassDefFoundError e) { // cannot load this implementation } catch (ClassNotFoundException e) { // not the right implementation } return this; }
new DynConstructors.Builder(DoFn.class) .loader(loader) .impl(transform) .buildChecked(); transformFn = ctor.newInstance();
new DynConstructors.Builder(DoFn.class) .loader(loaderForJars(jars)) .impl(transform) .buildChecked(); transformFn = ctor.newInstance();
new DynConstructors.Builder(DoFn.class) .loader(loaderForJars(jars)) .impl(transform) .buildChecked(); transformFn = ctor.newInstance();
new DynConstructors.Builder(DoFn.class) .loader(loaderForJars(jars)) .impl(transform) .buildChecked(); transformFn = ctor.newInstance();
public Builder ctorImpl(String className, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { this.method = new DynConstructors.Builder() .impl(className, argClasses) .buildChecked(); } catch (NoSuchMethodException e) { // not the right implementation } return this; }
public Builder ctorImpl(Class<?> targetClass, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { this.method = new DynConstructors.Builder() .impl(targetClass, argClasses) .buildChecked(); } catch (NoSuchMethodException e) { // not the right implementation } return this; }
public Builder ctorImpl(String className, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { this.method = new DynConstructors.Builder() .impl(className, argClasses) .buildChecked(); } catch (NoSuchMethodException e) { // not the right implementation } return this; }
public Builder ctorImpl(Class<?> targetClass, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { this.method = new DynConstructors.Builder() .impl(targetClass, argClasses) .buildChecked(); } catch (NoSuchMethodException e) { // not the right implementation } return this; }
public Builder impl(Class<?>... types) { impl(baseClass, types); return this; }
public Builder impl(Class<?>... types) { impl(baseClass, types); return this; }
private static Class<?> findTypeInfoClass(String className) { try { return new DynConstructors.Builder(TypeInfo.class) .impl(className).buildChecked().getConstructedClass(); } catch (NoSuchMethodException e) { return null; } }
private synchronized static void checkHiveDependencies() { if (Loader.HIVE_CONF == null) { // check that Hive is available by resolving the HiveConf constructor // this is also needed by newHiveConf(Configuration) Loader.HIVE_CONF = new DynConstructors.Builder() .impl("org.apache.hadoop.hive.conf.HiveConf", Configuration.class, Class.class) .build(); } }
public static <K, V> FileInputFormat<K, V> newInputFormatInstance( DatasetDescriptor descriptor) { DynConstructors.Ctor<FileInputFormat<K, V>> ctor = new DynConstructors.Builder() .impl(descriptor.getProperty(INPUT_FORMAT_CLASS_PROP)) .build(); return ctor.newInstance(); }
private static Class<?> findTypeInfoClass(String className) { try { return new DynConstructors.Builder(TypeInfo.class) .impl(className).buildChecked().getConstructedClass(); } catch (NoSuchMethodException e) { return null; } }
private synchronized static void checkHiveDependencies() { if (Loader.HIVE_CONF == null) { // check that Hive is available by resolving the HiveConf constructor // this is also needed by newHiveConf(Configuration) Loader.HIVE_CONF = new DynConstructors.Builder() .impl("org.apache.hadoop.hive.conf.HiveConf", Configuration.class, Class.class) .build(); } }