Package org.apache.flink.runtime.operators.testutils.TestData

Examples of org.apache.flink.runtime.operators.testutils.TestData.Value


  private MutableObjectIterator<Record> newIterator(final int[] keys, final String[] values)
  {
    return new MutableObjectIterator<Record>()
    {
      private Key key = new Key();
      private Value value = new Value();
     
      private int current = 0;

      @Override
      public Record next(Record reuse)
      {
        if (current < keys.length) {
          key.setKey(keys[current]);
          value.setValue(values[current]);
          current++;
          reuse.setField(0, key);
          reuse.setField(1, value);
          return reuse;
        }
View Full Code Here


      readTarget = sorter.getRecord(readTarget, i++);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

      generator.next(record);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

      readTarget = sorter.getRecord(readTarget, i++);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

      readTarget = sorter.getRecord(readTarget, i--);
     
      Key rk = readTarget.getField(0, Key.class);
      Key gk = record.getField(0, Key.class);
     
      Value rv = readTarget.getField(1, Value.class);
      Value gv = record.getField(1, Value.class);
     
      Assert.assertEquals("The re-read key is wrong", gk, rk);
      Assert.assertEquals("The re-read value is wrong", gv, rv);
    }
   
View Full Code Here

    qs.sort(sorter);
   
    MutableObjectIterator<Record> iter = sorter.getIterator();
    Record readTarget = new Record();
   
    Value current = new Value();
    Value last = new Value();
   
    iter.next(readTarget);
    readTarget.getFieldInto(1, last);
   
    while ((readTarget = iter.next(readTarget)) != null) {
      readTarget.getFieldInto(1, current);
     
      final int cmp = last.compareTo(current);
      if (cmp > 0) {
        Assert.fail("Next value is not larger or equal to previous value.");
      }
     
      Value tmp = current;
      current = last;
      last = tmp;
    }
   
    // release the memory occupied by the buffers
View Full Code Here

    qs.sort(sorter);
   
    MutableObjectIterator<Record> iter = sorter.getIterator();
    Record readTarget = new Record();
   
    Value current = new Value();
    Value last = new Value();
   
    iter.next(readTarget);
    readTarget.getFieldInto(1, last);
   
    while ((readTarget = iter.next(readTarget)) != null) {
      readTarget.getFieldInto(1, current);
     
      final int cmp = last.compareTo(current);
      if (cmp > 0) {
        Assert.fail("Next value is not larger or equal to previous value.");
      }
     
      Value tmp = current;
      current = last;
      last = tmp;
    }
   
    // release the memory occupied by the buffers
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.operators.testutils.TestData.Value

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.