Package eu.stratosphere.pact.runtime.test.util

Examples of eu.stratosphere.pact.runtime.test.util.UniformRecordGenerator


  @Test
  public void testSingleLevelMergeCombineTask() {
    final int keyCnt = 40000;
    final int valCnt = 8;
   
    addInput(new UniformRecordGenerator(keyCnt, valCnt, false));
    addInputComparator(this.comparator);
    setOutput(this.outList);
   
    getTaskConfig().setDriverStrategy(DriverStrategy.SORTED_GROUP_COMBINE);
    getTaskConfig().setMemoryDriver(COMBINE_MEM);
View Full Code Here


  @Test
  public void testMultiLevelMergeCombineTask() throws Exception {
    final int keyCnt = 100000;
    final int valCnt = 8;
   
    addInput(new UniformRecordGenerator(keyCnt, valCnt, false));
    addInputComparator(this.comparator);
    setOutput(this.outList);
   
    getTaskConfig().setDriverStrategy(DriverStrategy.SORTED_GROUP_COMBINE);
    getTaskConfig().setMemoryDriver(COMBINE_MEM);
View Full Code Here

    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
   
    final CoGroupDriver<Record, Record, Record> testTask = new CoGroupDriver<Record, Record, Record>();
   
    try {
      addInputSorted(new UniformRecordGenerator(keyCnt1, valCnt1, false), this.comparator1.duplicate());
      addInputSorted(new UniformRecordGenerator(keyCnt2, valCnt2, false), this.comparator2.duplicate());
      testDriver(testTask, MockCoGroupStub.class);
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
View Full Code Here

    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
   
    final CoGroupDriver<Record, Record, Record> testTask = new CoGroupDriver<Record, Record, Record>();
   
    try {
      addInputSorted(new UniformRecordGenerator(keyCnt1, valCnt1, false), this.comparator1.duplicate());
      addInputSorted(new UniformRecordGenerator(keyCnt2, valCnt2, false), this.comparator2.duplicate());
      testDriver(testTask, MockCoGroupStub.class);
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
View Full Code Here

    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
   
    final CoGroupDriver<Record, Record, Record> testTask = new CoGroupDriver<Record, Record, Record>();
   
    try {
      addInputSorted(new UniformRecordGenerator(keyCnt1, valCnt1, false), this.comparator1.duplicate());
      addInput(new UniformRecordGenerator(keyCnt2, valCnt2, true));
      testDriver(testTask, MockCoGroupStub.class);
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
View Full Code Here

    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
   
    final CoGroupDriver<Record, Record, Record> testTask = new CoGroupDriver<Record, Record, Record>();
   
    try {
      addInput(new UniformRecordGenerator(keyCnt1, valCnt1, true));
      addInputSorted(new UniformRecordGenerator(keyCnt2, valCnt2, false), this.comparator2.duplicate());
      testDriver(testTask, MockCoGroupStub.class);
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
View Full Code Here

    final int expCnt = valCnt1*valCnt2*Math.min(keyCnt1, keyCnt2) +
      (keyCnt1 > keyCnt2 ? (keyCnt1 - keyCnt2) * valCnt1 : (keyCnt2 - keyCnt1) * valCnt2);
   
    setOutput(this.output);
   
    addInput(new UniformRecordGenerator(keyCnt1, valCnt1, true));
    addInput(new UniformRecordGenerator(keyCnt2, valCnt2, true));
    addInputComparator(this.comparator1);
    addInputComparator(this.comparator2);
   
    getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
View Full Code Here

    int keyCnt2 = 200;
    int valCnt2 = 1;
   
    setOutput(this.output);
   
    addInput(new UniformRecordGenerator(keyCnt1, valCnt1, true));
    addInput(new UniformRecordGenerator(keyCnt2, valCnt2, true));
    addInputComparator(this.comparator1);
    addInputComparator(this.comparator2);
   
    getTaskConfig().setDriverPairComparator(RecordPairComparatorFactory.get());
    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
View Full Code Here

   
    final CoGroupDriver<Record, Record, Record> testTask = new CoGroupDriver<Record, Record, Record>();
   
    try {
      addInputSorted(new DelayingInfinitiveInputIterator(1000), this.comparator1.duplicate());
      addInput(new UniformRecordGenerator(keyCnt, valCnt, true));
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
   
View Full Code Here

    getTaskConfig().setDriverStrategy(DriverStrategy.CO_GROUP);
   
    final CoGroupDriver<Record, Record, Record> testTask = new CoGroupDriver<Record, Record, Record>();
   
    try {
      addInput(new UniformRecordGenerator(keyCnt, valCnt, true));
      addInputSorted(new DelayingInfinitiveInputIterator(1000), this.comparator2.duplicate());
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
View Full Code Here

TOP

Related Classes of eu.stratosphere.pact.runtime.test.util.UniformRecordGenerator

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.