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

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


    Record rec1 = new Record();
    Record rec2 = new Record();
   
    Assert.assertTrue((rec1 = iterator.next(rec1)) != null);
    while ((rec2 = iterator.next(rec2)) != null) {
      final Key k1 = rec1.getField(0, TestData.Key.class);
      final Key k2 = rec2.getField(0, TestData.Key.class);
      pairsEmitted++;
     
      Assert.assertTrue(keyComparator.compare(k1, k2) <= 0);
     
      Record tmp = rec1;
      rec1 = rec2;
      k1.setKey(k2.getKey());
     
      rec2 = tmp;
    }
    Assert.assertTrue(NUM_PAIRS == pairsEmitted);
   
View Full Code Here


    Record rec1 = new Record();
    Record rec2 = new Record();
   
    Assert.assertTrue((rec1 = iterator.next(rec1)) != null);
    while ((rec2 = iterator.next(rec2)) != null) {
      final Key k1 = rec1.getField(0, TestData.Key.class);
      final Key k2 = rec2.getField(0, TestData.Key.class);
      pairsEmitted++;
     
      Assert.assertTrue(keyComparator.compare(k1, k2) <= 0);
     
      Record tmp = rec1;
      rec1 = rec2;
      k1.setKey(k2.getKey());
     
      rec2 = tmp;
    }
    Assert.assertTrue(NUM_PAIRS == pairsEmitted);
   
View Full Code Here

    Record rec1 = new Record();
    Record rec2 = new Record();
   
    Assert.assertTrue((rec1 = iterator.next(rec1)) != null);
    while ((rec2 = iterator.next(rec2)) != null) {
      final Key k1 = rec1.getField(0, TestData.Key.class);
      final Key k2 = rec2.getField(0, TestData.Key.class);
      pairsEmitted++;
     
      Assert.assertTrue(keyComparator.compare(k1, k2) <= 0);
     
      Record tmp = rec1;
      rec1 = rec2;
      k1.setKey(k2.getKey());
     
      rec2 = tmp;
    }
    Assert.assertTrue(NUM_PAIRS == pairsEmitted);
   
View Full Code Here

    Record rec1 = new Record();
    Record rec2 = new Record();
   
    Assert.assertTrue((rec1 = iterator.next(rec1)) != null);
    while ((rec2 = iterator.next(rec2)) != null) {
      final Key k1 = rec1.getField(0, TestData.Key.class);
      final Key k2 = rec2.getField(0, TestData.Key.class);
      pairsRead++;
     
      Assert.assertTrue(keyComparator.compare(k1, k2) <= 0);
     
      Record tmp = rec1;
      rec1 = rec2;
      k1.setKey(k2.getKey());
      rec2 = tmp;
     
      // log
      if (pairsRead == nextStep) {
        nextStep += PAIRS / 20;
View Full Code Here

    final Record readRec = new Record();
    for (int i = 0; i < NUM_PAIRS_INMEM; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_INMEM; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
View Full Code Here

    try {
      for (int i = 0; i < NUM_PAIRS_INMEM + 1; i++) {
        generator.next(rec);
        readRec.read(inView);
       
        Key k1 = rec.getField(0, Key.class);
        Value v1 = rec.getField(1, Value.class);
       
        Key k2 = readRec.getField(0, Key.class);
        Value v2 = readRec.getField(1, Value.class);
       
        Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
      }
      Assert.fail("Read too much, expected EOFException.");
    }
    catch (EOFException eofex) {
      // expected
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_INMEM; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
View Full Code Here

    final Record readRec = new Record();
    for (int i = 0; i < NUM_PAIRS_EXTERNAL; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_EXTERNAL; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
View Full Code Here

    try {
      for (int i = 0; i < NUM_PAIRS_EXTERNAL + 1; i++) {
        generator.next(rec);
        readRec.read(inView);
       
        Key k1 = rec.getField(0, Key.class);
        Value v1 = rec.getField(1, Value.class);
       
        Key k2 = readRec.getField(0, Key.class);
        Value v2 = readRec.getField(1, Value.class);
       
        Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
      }
      Assert.fail("Read too much, expected EOFException.");
    }
    catch (EOFException eofex) {
      // expected
    }
   
    // re-read the data
    inView = outView.flip();
    generator.reset();
   
    // read and re-generate all records and compare them
    for (int i = 0; i < NUM_PAIRS_EXTERNAL; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
View Full Code Here

    final Record readRec = new Record();
    for (int i = 0; i < NUM_PAIRS_SHORT; i++) {
      generator.next(rec);
      readRec.read(inView);
     
      Key k1 = rec.getField(0, Key.class);
      Value v1 = rec.getField(1, Value.class);
     
      Key k2 = readRec.getField(0, Key.class);
      Value v2 = readRec.getField(1, Value.class);
     
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
View Full Code Here

    // read and re-generate all records and compare them
    final Record readRec = new Record();
    for (int i = 0; i < NUM_PAIRS_LONG; i++) {
      generator.next(rec);
      readRec.read(inView);
      final Key k1 = rec.getField(0, Key.class);
      final Value v1 = rec.getField(1, Value.class);
      final Key k2 = readRec.getField(0, Key.class);
      final Value v2 = readRec.getField(1, Value.class);
      Assert.assertTrue("The re-generated and the read record do not match.", k1.equals(k2) && v1.equals(v2));
    }
   
    this.memoryManager.release(inView.close());
View Full Code Here

TOP

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

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.