Example usage for org.apache.hadoop.conf Configuration getClass

List of usage examples for org.apache.hadoop.conf Configuration getClass

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration getClass.

Prototype

public <U> Class<? extends U> getClass(String name, Class<? extends U> defaultValue, Class<U> xface) 

Source Link

Document

Get the value of the name property as a Class implementing the interface specified by xface.

Usage

From source file:org.apache.tez.engine.common.ConfigUtils.java

License:Apache License

public static <K> Class<K> getIntermediateInputKeyClass(Configuration conf) {
    Class<K> retv = (Class<K>) conf.getClass(TezJobConfig.TEZ_ENGINE_INTERMEDIATE_INPUT_KEY_CLASS, null,
            Object.class);
    return retv;//w ww .  j  av a 2  s . c o  m
}

From source file:org.apache.tez.engine.common.ConfigUtils.java

License:Apache License

public static <K> RawComparator<K> getIntermediateOutputKeyComparator(Configuration conf) {
    Class<? extends RawComparator> theClass = conf.getClass(
            TezJobConfig.TEZ_ENGINE_INTERMEDIATE_OUTPUT_KEY_COMPARATOR_CLASS, null, RawComparator.class);
    if (theClass != null)
        return ReflectionUtils.newInstance(theClass, conf);
    return WritableComparator.get(getIntermediateOutputKeyClass(conf).asSubclass(WritableComparable.class));
}

From source file:org.apache.tez.engine.common.ConfigUtils.java

License:Apache License

public static <K> RawComparator<K> getIntermediateInputKeyComparator(Configuration conf) {
    Class<? extends RawComparator> theClass = conf.getClass(
            TezJobConfig.TEZ_ENGINE_INTERMEDIATE_INPUT_KEY_COMPARATOR_CLASS, null, RawComparator.class);
    if (theClass != null)
        return ReflectionUtils.newInstance(theClass, conf);
    return WritableComparator.get(getIntermediateInputKeyClass(conf).asSubclass(WritableComparable.class));
}

From source file:org.apache.tez.engine.common.ConfigUtils.java

License:Apache License

public static <V> RawComparator<V> getInputKeySecondaryGroupingComparator(Configuration conf) {
    Class<? extends RawComparator> theClass = conf.getClass(
            TezJobConfig.TEZ_ENGINE_INTERMEDIATE_INPUT_KEY_SECONDARY_COMPARATOR_CLASS, null,
            RawComparator.class);
    if (theClass == null) {
        return getIntermediateInputKeyComparator(conf);
    }/*w  w  w  .j  av  a  2 s.  c  o  m*/

    return ReflectionUtils.newInstance(theClass, conf);
}

From source file:org.apache.tez.http.SSLFactory.java

License:Apache License

/**
 * Creates an SSLFactory./*from  ww w  .  java2 s .  co m*/
 *
 * @param mode SSLFactory mode, client or server.
 * @param conf Hadoop configuration from where the SSLFactory configuration
 *             will be read.
 */
public SSLFactory(Mode mode, Configuration conf) {
    this.conf = conf;
    if (mode == null) {
        throw new IllegalArgumentException("mode cannot be NULL");
    }
    this.mode = mode;
    requireClientCert = conf.getBoolean(SSL_REQUIRE_CLIENT_CERT_KEY, DEFAULT_SSL_REQUIRE_CLIENT_CERT);
    Configuration sslConf = readSSLConfiguration(mode);

    Class<? extends KeyStoresFactory> klass = conf.getClass(KEYSTORES_FACTORY_CLASS_KEY,
            FileBasedKeyStoresFactory.class, KeyStoresFactory.class);
    keystoresFactory = ReflectionUtils.newInstance(klass, sslConf);

    enabledProtocols = conf.getStrings(SSL_ENABLED_PROTOCOLS, DEFAULT_SSL_ENABLED_PROTOCOLS);
}

From source file:org.apache.tez.runtime.library.common.ConfigUtils.java

License:Apache License

public static <V> Class<V> getIntermediateOutputValueClass(Configuration conf) {
    Class<V> retv = (Class<V>) conf.getClass(TezRuntimeConfiguration.TEZ_RUNTIME_VALUE_CLASS, null,
            Object.class);
    return retv;/*from w  ww.j av  a 2s. c  o m*/
}

From source file:org.apache.tez.runtime.library.common.ConfigUtils.java

License:Apache License

public static <V> Class<V> getIntermediateInputValueClass(Configuration conf) {
    Class<V> retv = (Class<V>) conf.getClass(TezRuntimeConfiguration.TEZ_RUNTIME_VALUE_CLASS, null,
            Object.class);
    return retv;/*from   w  w  w  .  j a  va 2s .c o  m*/
}

From source file:org.apache.tez.runtime.library.common.ConfigUtils.java

License:Apache License

public static <K> Class<K> getIntermediateOutputKeyClass(Configuration conf) {
    Class<K> retv = (Class<K>) conf.getClass(TezRuntimeConfiguration.TEZ_RUNTIME_KEY_CLASS, null, Object.class);
    return retv;/*from w w w  .  j a v a  2s  . c o  m*/
}

From source file:org.apache.tez.runtime.library.common.ConfigUtils.java

License:Apache License

public static <K> Class<K> getIntermediateInputKeyClass(Configuration conf) {
    Class<K> retv = (Class<K>) conf.getClass(TezRuntimeConfiguration.TEZ_RUNTIME_KEY_CLASS, null, Object.class);
    return retv;/*from w  w w  .  j av  a2s.  c  o m*/
}

From source file:org.apache.tez.runtime.library.common.ConfigUtils.java

License:Apache License

public static <K> RawComparator<K> getIntermediateOutputKeyComparator(Configuration conf) {
    Class<? extends RawComparator> theClass = conf
            .getClass(TezRuntimeConfiguration.TEZ_RUNTIME_KEY_COMPARATOR_CLASS, null, RawComparator.class);
    if (theClass != null)
        return ReflectionUtils.newInstance(theClass, conf);
    return WritableComparator.get(getIntermediateOutputKeyClass(conf).asSubclass(WritableComparable.class));
}