Package com.intel.hadoop.graphbuilder.preprocess.mapreduce

Examples of com.intel.hadoop.graphbuilder.preprocess.mapreduce.CreateGraphMR


  public boolean run(GraphTokenizer<VidType, VertexData, EdgeData> tokenizer,
      InputFormat inputformat, String[] inputs, String output)
      throws CannotCompileException, NotFoundException, IOException {
    // Required parameters;
    CreateGraphMR mr = new CreateGraphMR(tokenizer, inputformat);

    Class valueClass = PreprocessJobValueFactory.getValueClassByClassName(
        tokenizer.vidClass().getName(), tokenizer.vdataClass().getName(),
        tokenizer.edataClass().getName());
    // Set value class based on the types of tokenizer.
    mr.setValueClass(valueClass);
    // Distributed the new class file to cluster.
    FsUtil.distributedTempClassToClassPath(mr.getConf());

    // Optional parameters;
    Class vreducerClass = vertexReducer() == null ? null : vertexReducer()
        .getClass();
    Class ereducerClass = edgeReducer() == null ? null : edgeReducer()
        .getClass();
    mr.setFunctionClass(vreducerClass, ereducerClass);
    mr.cleanBidirectionalEdge(cleanBidirectionalEdge());

    // User defined parameters;
    if (userOpts != null) {
      mr.setUserOptions(userOpts);
    }

    try {
      mr.run(inputs, output);
    } catch (Exception e) {
      e.printStackTrace();
      return false;
    }
    return true;
View Full Code Here

TOP

Related Classes of com.intel.hadoop.graphbuilder.preprocess.mapreduce.CreateGraphMR

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.