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

Examples of org.apache.flink.runtime.operators.testutils.UniformRecordGenerator


  //
  //
 
  private final MutableObjectIterator<Record> getProbeInput(final int numKeys,
      final int probeValsPerKey, final int repeatedValue1, final int repeatedValue2) {
    MutableObjectIterator<Record> probe1 = new UniformRecordGenerator(numKeys, probeValsPerKey, true);
    MutableObjectIterator<Record> probe2 = new ConstantsKeyValuePairsIterator(repeatedValue1, 17, 5);
    MutableObjectIterator<Record> probe3 = new ConstantsKeyValuePairsIterator(repeatedValue2, 23, 5);
    List<MutableObjectIterator<Record>> probes = new ArrayList<MutableObjectIterator<Record>>();
    probes.add(probe1);
    probes.add(probe2);
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));
      addInput(new UniformRecordGenerator(keyCnt, valCnt, true));
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("The test caused an exception.");
    }
   
View Full Code Here

    final int NUM_KEYS = 1000000;
    final int BUILD_VALS_PER_KEY = 3;
    final int PROBE_VALS_PER_KEY = 10;
   
    // create a build input that gives 3 million pairs with 3 values sharing the same key, plus 400k pairs with two colliding keys
    MutableObjectIterator<Record> build1 = new UniformRecordGenerator(NUM_KEYS, BUILD_VALS_PER_KEY, false);
    MutableObjectIterator<Record> build2 = new ConstantsKeyValuePairsIterator(REPEATED_VALUE_1, 17, REPEATED_VALUE_COUNT_BUILD);
    MutableObjectIterator<Record> build3 = new ConstantsKeyValuePairsIterator(REPEATED_VALUE_2, 23, REPEATED_VALUE_COUNT_BUILD);
    List<MutableObjectIterator<Record>> builds = new ArrayList<MutableObjectIterator<Record>>();
    builds.add(build1);
    builds.add(build2);
View Full Code Here

    final int NUM_KEYS = 1000000;
    final int BUILD_VALS_PER_KEY = 3;
    final int PROBE_VALS_PER_KEY = 10;
   
    // create a build input that gives 3 million pairs with 3 values sharing the same key, plus 400k pairs with two colliding keys
    MutableObjectIterator<Record> build1 = new UniformRecordGenerator(NUM_KEYS, BUILD_VALS_PER_KEY, false);
    MutableObjectIterator<Record> build2 = new ConstantsKeyValuePairsIterator(REPEATED_VALUE_1, 17, REPEATED_VALUE_COUNT_BUILD);
    MutableObjectIterator<Record> build3 = new ConstantsKeyValuePairsIterator(REPEATED_VALUE_2, 23, REPEATED_VALUE_COUNT_BUILD);
    List<MutableObjectIterator<Record>> builds = new ArrayList<MutableObjectIterator<Record>>();
    builds.add(build1);
    builds.add(build2);
View Full Code Here

    int valCnt = 20;
   
    this.outList = new ArrayList<Record>();
   
    try {
      InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false),
        this.tempTestPath, true);
    } catch (IOException e1) {
      Assert.fail("Unable to set-up test input file");
    }
   
View Full Code Here

    int valCnt = 10;
   
    this.outList = new NirvanaOutputList();
   
    try {
      InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false),
        this.tempTestPath, false);
    } catch (IOException e1) {
      Assert.fail("Unable to set-up test input file");
    }
View Full Code Here

    super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE);
    super.addOutput(new NirvanaOutputList());
   
    try {
      InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false),
        this.tempTestPath, false);
    } catch (IOException e1) {
      Assert.fail("Unable to set-up test input file");
    }
   
View Full Code Here

    addDriverComparator(this.comparator);
    setOutput(this.outList);
    getTaskConfig().setDriverStrategy(DriverStrategy.SORTED_GROUP_REDUCE);
   
    try {
      addInputSorted(new UniformRecordGenerator(keyCnt, valCnt, false), this.comparator.duplicate());
     
      GroupReduceDriver<Record, Record> testTask = new GroupReduceDriver<Record, Record>();
     
      testDriver(testTask, MockReduceStub.class);
    } catch (Exception e) {
View Full Code Here

  @Test
  public void testReduceTaskOnPreSortedInput() {
    final int keyCnt = 100;
    final int valCnt = 20;
   
    addInput(new UniformRecordGenerator(keyCnt, valCnt, true));
    addDriverComparator(this.comparator);
    setOutput(this.outList);
    getTaskConfig().setDriverStrategy(DriverStrategy.SORTED_GROUP_REDUCE);
   
    GroupReduceDriver<Record, Record> testTask = new GroupReduceDriver<Record, Record>();
View Full Code Here

    getTaskConfig().setDriverStrategy(DriverStrategy.SORTED_GROUP_REDUCE);
   
    CombiningUnilateralSortMerger<Record> sorter = null;
    try {
      sorter = new CombiningUnilateralSortMerger<Record>(new MockCombiningReduceStub(),
        getMemoryManager(), getIOManager(), new UniformRecordGenerator(keyCnt, valCnt, false),
        getOwningNepheleTask(), RecordSerializerFactory.get(), this.comparator.duplicate(), this.perSortFractionMem,
          4, 0.8f);
      addInput(sorter.getIterator());
     
      GroupReduceDriver<Record, Record> testTask = new GroupReduceDriver<Record, Record>();
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.operators.testutils.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.