private static Class<?> findTypeInfoClass(String className) { try { return new DynConstructors.Builder(TypeInfo.class) .impl(className).buildChecked().getConstructedClass(); } catch (NoSuchMethodException e) { return null; } }
/** * Returns the first valid implementation as a StaticMethod or throws a * NoSuchMethodException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws NoSuchMethodException if no implementation was found */ public StaticMethod buildStaticChecked() throws NoSuchMethodException { return buildChecked().asStatic(); }
/** * Returns the first valid implementation as a StaticMethod or throws a * RuntimeException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws RuntimeException if no implementation was found */ public StaticMethod buildStatic() { return build().asStatic(); }
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 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 <R> R invoke(Object... args) { return method.invoke(receiver, args); } }
public Builder impl(Class<?>... types) { impl(baseClass, types); return this; }
/** * Returns the first valid implementation as a BoundMethod or throws a * RuntimeError if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws RuntimeException if no implementation was found */ public BoundMethod build(Object receiver) { return build().bind(receiver); }
/** * Returns the first valid implementation as a BoundMethod or throws a * NoSuchMethodException if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws NoSuchMethodException if no implementation was found */ public BoundMethod buildChecked(Object receiver) throws NoSuchMethodException { return buildChecked().bind(receiver); }
/** * Returns this method as a StaticMethod. * * @return a {@link StaticMethod} for this method * @throws IllegalStateException if the method is not static */ public StaticMethod asStatic() { Preconditions.checkState(isStatic(), "Method is not static"); return new StaticMethod(this); }
@Override public StaticMethod asStatic() { return new StaticMethod(this); }
public Builder hiddenImpl(Class<?>... types) { hiddenImpl(baseClass, types); return this; }
@Override public BoundMethod bind(Object receiver) { return new BoundMethod(this, receiver); }
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(); } }
/** * Returns the first valid implementation as a StaticMethod or throws a * NoSuchMethodException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws NoSuchMethodException if no implementation was found */ public StaticMethod buildStaticChecked() throws NoSuchMethodException { return buildChecked().asStatic(); }
/** * Returns the first valid implementation as a StaticMethod or throws a * RuntimeException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws RuntimeException if no implementation was found */ public StaticMethod buildStatic() { return build().asStatic(); }
/** * Returns the first valid implementation as a BoundMethod or throws a * RuntimeError if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws RuntimeException if no implementation was found */ public BoundMethod build(Object receiver) { return build().bind(receiver); }
/** * Returns the first valid implementation as a BoundMethod or throws a * NoSuchMethodException if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws NoSuchMethodException if no implementation was found */ public BoundMethod buildChecked(Object receiver) throws NoSuchMethodException { return buildChecked().bind(receiver); }
/** * Returns this method as a StaticMethod. * * @return a {@link StaticMethod} for this method * @throws IllegalStateException if the method is not static */ public StaticMethod asStatic() { Preconditions.checkState(isStatic(), "Method is not static"); return new StaticMethod(this); }