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

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


    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));
    }
   
    this.memoryManager.release(outView.close());
View Full Code Here


      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));
    }
   
    this.memoryManager.release(outView.close());
View Full Code Here

    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));
    }
   
    this.memoryManager.release(outView.close());
View Full Code Here

      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));
    }
   
    this.memoryManager.release(outView.close());
View Full Code Here

    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));
    }
   
    this.memoryManager.release(inView.close());
View Full Code Here

    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());
    reader.deleteChannel();
View Full Code Here

      final Record readRec = new Record();
      for (int i = 0; i < NUM_PAIRS_SHORT + 1; 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));
      }
      Assert.fail("Expected an EOFException which did not occur.");
    }
    catch (EOFException eofex) {
View Full Code Here

    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));
    }
   
    this.memoryManager.release(inView.close());
View Full Code Here

    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));
    }
   
    this.memoryManager.release(inView.close());
View Full Code Here

    for (int i = 0; i < NUM_PAIRS_SHORT / 2; 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));
    }
   
    this.memoryManager.release(inView.close());
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.