Package eu.stratosphere.api.java.tuple

Examples of eu.stratosphere.api.java.tuple.Tuple


    if (expected.length != found.length) {
      throw new IllegalArgumentException();
    }
   
    for (int i = 0; i < expected.length; i++) {
      Tuple v1 = (Tuple) expected[i];
      Tuple v2 = (Tuple) found[i];
     
      for (int k = 0; k < v1.getArity(); k++) {
        Object o1 = v1.getField(k);
        Object o2 = v2.getField(k);
        Assert.assertEquals(o1, o2);
      }
    }
  }
View Full Code Here


  public static <X> TypeInformation<X> getForObject(X value) {
    Validate.notNull(value);
   
    // check if we can extract the types from tuples, otherwise work with the class
    if (value instanceof Tuple) {
      Tuple t = (Tuple) value;
      int numFields = t.getArity();
     
      TypeInformation<?>[] infos = new TypeInformation[numFields];
      for (int i = 0; i < numFields; i++) {
        Object field = t.getField(i);
       
        if (field == null) {
          throw new InvalidTypesException("Automatic type extraction is not possible on candidates with null values. "
              + "Please specify the types directly.");
        }
View Full Code Here

 
 
  @Override
  public Tuple2<K, T> map(T value) throws Exception {
   
    Tuple v = (Tuple) value;
   
    K key = v.getField(pos);
    tuple.f0 = key;
    tuple.f1 = value;
   
    return tuple;
  }
View Full Code Here

    edgesUsed = true;
   
    outValue.f1 = m;
   
    while (edges.hasNext()) {
      Tuple next = (Tuple) edges.next();
      VertexKey k = next.getField(1);
      outValue.f0 = k;
      out.collect(outValue);
    }
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.api.java.tuple.Tuple

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.