Java 类org.apache.hadoop.io.WritableFactories 实例源码

项目:flink    文件:HadoopInputSplit.java   
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);
}
项目:flink    文件:HadoopInputSplit.java   
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);
}
项目:vs.msc.ws14    文件:HadoopInputSplit.java   
@Override
public void read(DataInputView in) throws IOException {
    this.splitNumber=in.readInt();
    this.hadoopInputSplitTypeName = in.readUTF();
    if(hadoopInputSplit == null) {
        try {
            Class<? extends org.apache.hadoop.io.Writable> inputSplit =
                    Class.forName(hadoopInputSplitTypeName).asSubclass(org.apache.hadoop.io.Writable.class);
            this.hadoopInputSplit = (org.apache.hadoop.mapred.InputSplit) WritableFactories.newInstance( inputSplit );
        }
        catch (Exception e) {
            throw new RuntimeException("Unable to create InputSplit", e);
        }
    }
    jobConf = new JobConf();
    jobConf.readFields(in);
    if (this.hadoopInputSplit instanceof Configurable) {
        ((Configurable) this.hadoopInputSplit).setConf(this.jobConf);
    }
    this.hadoopInputSplit.readFields(in);

}
项目:vs.msc.ws14    文件:HadoopInputSplit.java   
@Override
public void read(DataInputView in) throws IOException {
    this.splitNumber=in.readInt();
    String className = in.readUTF();

    if(this.mapreduceInputSplit == null) {
        try {
            Class<? extends org.apache.hadoop.io.Writable> inputSplit = 
                    Class.forName(className).asSubclass(org.apache.hadoop.io.Writable.class);
            this.mapreduceInputSplit = (org.apache.hadoop.mapreduce.InputSplit) WritableFactories.newInstance(inputSplit);
        } catch (Exception e) {
            throw new RuntimeException("Unable to create InputSplit", e);
        }
    }
    ((Writable)this.mapreduceInputSplit).readFields(in);
}
项目:flink    文件:HadoopInputSplit.java   
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // read the parent fields and the final fields
    in.defaultReadObject();

    try {
        Class<? extends Writable> writableSplit = splitType.asSubclass(Writable.class);
        mapreduceInputSplit = (org.apache.hadoop.mapreduce.InputSplit) WritableFactories.newInstance(writableSplit);
    }

    catch (Exception e) {
        throw new RuntimeException("Unable to instantiate the Hadoop InputSplit", e);
    }

    ((Writable) mapreduceInputSplit).readFields(in);
}
项目:flink    文件:HadoopInputSplit.java   
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // read the parent fields and the final fields
    in.defaultReadObject();

    try {
        Class<? extends Writable> writableSplit = splitType.asSubclass(Writable.class);
        mapreduceInputSplit = (org.apache.hadoop.mapreduce.InputSplit) WritableFactories.newInstance(writableSplit);
    }

    catch (Exception e) {
        throw new RuntimeException("Unable to instantiate the Hadoop InputSplit", e);
    }

    ((Writable) mapreduceInputSplit).readFields(in);
}
项目:LCIndex-HBase-0.94.16    文件:Classes.java   
/**
 * Used to dynamically load a filter class, and create a Writable filter.
 * This filter class most likely extends Configurable.
 *
 * @param className the filter class name.
 * @return a filter
 */
public static Filter createWritableForName(String className) {
  try {
    Class<? extends Filter> clazz = getFilterClassByName(className);
    return (Filter)WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:IRIndex    文件:Classes.java   
/**
 * Used to dynamically load a filter class, and create a Writable filter.
 * This filter class most likely extends Configurable.
 *
 * @param className the filter class name.
 * @return a filter
 */
public static Filter createWritableForName(String className) {
  try {
    Class<? extends Filter> clazz = getFilterClassByName(className);
    return (Filter)WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:RStore    文件:Scan.java   
@SuppressWarnings("unchecked")
private Writable createForName(String className) {
    try {
        Class<? extends Writable> clazz = (Class<? extends Writable>) Class
                .forName(className);
        return WritableFactories.newInstance(clazz, new Configuration());
    } catch (ClassNotFoundException e) {
        throw new RuntimeException("Can't find class " + className);
    }
}
项目:RStore    文件:Get.java   
@SuppressWarnings("unchecked")
private Writable createForName(String className) {
  try {
    Class<? extends Writable> clazz =
      (Class<? extends Writable>) Class.forName(className);
    return WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:CSBT    文件:ClusterLocatorRPCObject.java   
@SuppressWarnings("unchecked")
private Writable createForName(String className) {
  try {
    Class<? extends Writable> clazz = (Class<? extends Writable>) Class.forName(className);
    return WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:HBase-Research    文件:Classes.java   
/**
 * Used to dynamically load a filter class, and create a Writable filter.
 * This filter class most likely extends Configurable.
 *
 * @param className the filter class name.
 * @return a filter
 */
@SuppressWarnings("unchecked")
public static Filter createWritableForName(String className) {
  try {
    Class<? extends Filter> clazz =
      (Class<? extends Filter>) Class.forName(className, true, CLASS_LOADER);
    return (Filter)WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:hbase-0.94.8-qod    文件:Classes.java   
/**
 * Used to dynamically load a filter class, and create a Writable filter.
 * This filter class most likely extends Configurable.
 *
 * @param className the filter class name.
 * @return a filter
 */
@SuppressWarnings("unchecked")
public static Filter createWritableForName(String className) {
  try {
    Class<? extends Filter> clazz =
      (Class<? extends Filter>) Class.forName(className, true, CLASS_LOADER);
    return (Filter)WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:hbase-0.94.8-qod    文件:Classes.java   
/**
 * Used to dynamically load a filter class, and create a Writable filter.
 * This filter class most likely extends Configurable.
 *
 * @param className the filter class name.
 * @return a filter
 */
@SuppressWarnings("unchecked")
public static Filter createWritableForName(String className) {
  try {
    Class<? extends Filter> clazz =
      (Class<? extends Filter>) Class.forName(className, true, CLASS_LOADER);
    return (Filter)WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}
项目:hindex    文件:Classes.java   
/**
 * Used to dynamically load a filter class, and create a Writable filter.
 * This filter class most likely extends Configurable.
 *
 * @param className the filter class name.
 * @return a filter
 */
@SuppressWarnings("unchecked")
public static Filter createWritableForName(String className) {
  try {
    Class<? extends Filter> clazz =
      (Class<? extends Filter>) Class.forName(className, true, CLASS_LOADER);
    return (Filter)WritableFactories.newInstance(clazz, new Configuration());
  } catch (ClassNotFoundException e) {
    throw new RuntimeException("Can't find class " + className);
  }
}