Search in sources :

Example 16 with Configurable

use of org.apache.hadoop.conf.Configurable in project nutch by apache.

the class GenericWritableConfigurable method readFields.

@Override
public void readFields(DataInput in) throws IOException {
    byte type = in.readByte();
    Class<?> clazz = getTypes()[type];
    try {
        set((Writable) clazz.newInstance());
    } catch (Exception e) {
        e.printStackTrace();
        throw new IOException("Cannot initialize the class: " + clazz);
    }
    Writable w = get();
    if (w instanceof Configurable)
        ((Configurable) w).setConf(conf);
    w.readFields(in);
}
Also used : GenericWritable(org.apache.hadoop.io.GenericWritable) Writable(org.apache.hadoop.io.Writable) IOException(java.io.IOException) Configurable(org.apache.hadoop.conf.Configurable) IOException(java.io.IOException)

Aggregations

Configurable (org.apache.hadoop.conf.Configurable)16 CompressionCodec (org.apache.hadoop.io.compress.CompressionCodec)6 IOException (java.io.IOException)4 FileOutputStream (java.io.FileOutputStream)3 Map (java.util.Map)3 Configuration (org.apache.hadoop.conf.Configuration)3 FSDataInputStream (org.apache.hadoop.fs.FSDataInputStream)2 FileSystem (org.apache.hadoop.fs.FileSystem)2 Path (org.apache.hadoop.fs.Path)2 Writable (org.apache.hadoop.io.Writable)2 Compressor (org.apache.hadoop.io.compress.Compressor)2 EncryptionMaterialsProvider (com.amazonaws.services.s3.model.EncryptionMaterialsProvider)1 KMSEncryptionMaterialsProvider (com.amazonaws.services.s3.model.KMSEncryptionMaterialsProvider)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 BSONFileSplit (com.mongodb.hadoop.input.BSONFileSplit)1 BufferOverflowException (java.nio.BufferOverflowException)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 GoraException (org.apache.gora.util.GoraException)1 FileStatus (org.apache.hadoop.fs.FileStatus)1