Examples of PairListType


Examples of com.intel.hadoop.graphbuilder.preprocess.mapreduce.keyvalue.PairListType

  @Override
  public void reduce(VidType key, Iterator<PairListType> values,
      OutputCollector<VidType, PairListType> out, Reporter reporter)
      throws IOException {
    PairListType ret;
    try {
      ret = (PairListType) valClass.newInstance();
      while (values.hasNext()) {
        ret.append(values.next());
      }
      out.collect(key, ret);
    } catch (InstantiationException e) {
      e.printStackTrace();
    } catch (IllegalAccessException e) {
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.preprocess.mapreduce.keyvalue.PairListType

      OutputCollector<Text, Text> out, Reporter reporter) throws IOException {
    ArrayList<VidType> vids = new ArrayList<VidType>();
    ArrayList<Writable> data = new ArrayList<Writable>();

    while (values.hasNext()) {
      PairListType list = values.next();
      Iterator<Pair<VidType, Writable>> iter = list.iterator();
      while (iter.hasNext()) {
        Pair<VidType, Writable> pair = iter.next();
        vids.add(pair.getL());
        data.add(pair.getR());
      }
View Full Code Here

Examples of com.intel.hadoop.graphbuilder.preprocess.mapreduce.keyvalue.PairListType

  public void edgeTransformKeyValFactoryTest() {
    try {
      Class stringintclass = EdgeTransformJobValueFactory
          .getValueClassByClassName(TypeFactory.getClassName("string"),
              TypeFactory.getClassName("int"));
      PairListType val1 = (PairListType) stringintclass.newInstance();
      assertEquals(val1.createLValue().getClass(), StringType.class);
      assertEquals(val1.createRValue().getClass(), IntType.class);

      val1.init(new StringType("hello"), new IntType(1));
      val1.add(new StringType("world"), new IntType(2));
      int i = val1.size();
      assertEquals(val1.size(), 2);
      PairListType val0 = (PairListType) stringintclass.newInstance();
      assertEquals(val0.size(), 0);
      val0.add(new StringType("foo"), new IntType(3));
      assertEquals(val0.size(), 1);
      val0.append(val1);
      assertEquals(val0.size(), val1.size() + 1);

      Class intstringclass = EdgeTransformJobValueFactory
          .getValueClassByClassName(TypeFactory.getClassName("int"),
              TypeFactory.getClassName("string"));
      PairListType val2 = (PairListType) intstringclass.newInstance();
      assertEquals(val2.createLValue().getClass(), IntType.class);
      assertEquals(val2.createRValue().getClass(), StringType.class);

      assertEquals(val1.size(), 2);
    } catch (NotFoundException e) {
      e.printStackTrace();
    } catch (CannotCompileException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.