Search in sources :

Example 1 with JobConfigurable

use of org.apache.hadoop.mapred.JobConfigurable in project flink by apache.

the class HadoopInputSplit method readObject.

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // read the parent fields and the final fields
    in.defaultReadObject();
    // the job conf knows how to deserialize itself
    jobConf = new JobConf();
    jobConf.readFields(in);
    try {
        hadoopInputSplit = (org.apache.hadoop.mapred.InputSplit) WritableFactories.newInstance(splitType);
    } catch (Exception e) {
        throw new RuntimeException("Unable to instantiate Hadoop InputSplit", e);
    }
    if (hadoopInputSplit instanceof Configurable) {
        ((Configurable) hadoopInputSplit).setConf(this.jobConf);
    } else if (hadoopInputSplit instanceof JobConfigurable) {
        ((JobConfigurable) hadoopInputSplit).configure(this.jobConf);
    }
    hadoopInputSplit.readFields(in);
}
Also used : JobConfigurable(org.apache.hadoop.mapred.JobConfigurable) JobConfigurable(org.apache.hadoop.mapred.JobConfigurable) Configurable(org.apache.hadoop.conf.Configurable) JobConf(org.apache.hadoop.mapred.JobConf) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Configurable (org.apache.hadoop.conf.Configurable)1 JobConf (org.apache.hadoop.mapred.JobConf)1 JobConfigurable (org.apache.hadoop.mapred.JobConfigurable)1