Package org.apache.flink.types

Examples of org.apache.flink.types.Record


      out.collect(element);
    }
   
    @Override
    public void combine(Iterable<Record> records, Collector<Record> out) {
      Record element = null;
      int sum = 0;
     
      for (Record next : records) {
        element = next;
        element.getField(1, this.combineValue);
       
        sum += this.combineValue.getValue();
      }
     
      this.combineValue.setValue(sum);
      element.setField(1, this.combineValue);
      out.collect(element);
    }
View Full Code Here


    private final IntValue key = new IntValue();
    private final IntValue value = new IntValue();

    @Override
    public void reduce(Iterable<Record> records, Collector<Record> out) {
      Record element = null;
      int valCnt = 0;
     
      for (Record next : records) {
        element = next;
        valCnt++;
      }
     
      if (++this.cnt >= 10) {
        throw new ExpectedTestException();
      }
     
      element.getField(0, this.key);
      this.value.setValue(valCnt - this.key.getValue());
      element.setField(1, this.value);
      out.collect(element);
    }
View Full Code Here

      this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
      memSegments, ioManager);
    join.open(buildInput, probeInput);
   
   
    final Record recordReuse = new Record();
    int numRecordsInJoinResult = 0;
   
    while (join.nextRecord()) {
      HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
      while (buildSide.next(recordReuse) != null) {
View Full Code Here

        this.recordBuildSideAccesssor, this.recordProbeSideAccesssor,
        this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
        memSegments, ioManager);
    join.open(buildInput, probeInput);
   
    final Record recordReuse = new Record();
    int numRecordsInJoinResult = 0;
   
    while (join.nextRecord()) {
      HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
      while (buildSide.next(recordReuse) != null) {
View Full Code Here

        this.recordBuildSideAccesssor, this.recordProbeSideAccesssor,
        this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
        memSegments, ioManager);
    join.open(buildInput, probeInput);
 
    Record record;
    final Record recordReuse = new Record();

    while (join.nextRecord())
    {
      int numBuildValues = 0;
     
      int key = 0;
     
      HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
      if ((record = buildSide.next(recordReuse)) != null) {
        numBuildValues = 1;
        key = record.getField(0, IntValue.class).getValue();
      }
      else {
        fail("No build side values found for a probe key.");
      }
      while ((record = buildSide.next(recordReuse)) != null) {
        numBuildValues++;
      }
     
      if (numBuildValues != 3) {
        fail("Other than 3 build values!!!");
      }
     
      Record pr = join.getCurrentProbeRecord();
      Assert.assertEquals("Probe-side key was different than build-side key.", key, pr.getField(0, IntValue.class).getValue());
     
      Long contained = map.get(key);
      if (contained == null) {
        contained = new Long(numBuildValues);
      }
View Full Code Here

        this.recordBuildSideAccesssor, this.recordProbeSideAccesssor,
        this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
        memSegments, ioManager);
    join.open(buildInput, probeInput);
 
    Record record;
    final Record recordReuse = new Record();

    while (join.nextRecord())
    { 
      int numBuildValues = 0;
 
      final Record probeRec = join.getCurrentProbeRecord();
      int key = probeRec.getField(0, IntValue.class).getValue();
     
      HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
      if ((record = buildSide.next(recordReuse)) != null) {
        numBuildValues = 1;
        Assert.assertEquals("Probe-side key was different than build-side key.", key, record.getField(0, IntValue.class).getValue());
View Full Code Here

        this.recordBuildSideAccesssor, this.recordProbeSideAccesssor,
        this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
        memSegments, ioManager);
    join.open(buildInput, probeInput);
   
    Record record;
    final Record recordReuse = new Record();

    while (join.nextRecord())
    { 
      int numBuildValues = 0;
     
      final Record probeRec = join.getCurrentProbeRecord();
      int key = probeRec.getField(0, IntValue.class).getValue();
     
      HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
      if ((record = buildSide.next(recordReuse)) != null) {
        numBuildValues = 1;
        Assert.assertEquals("Probe-side key was different than build-side key.", key, record.getField(0, IntValue.class).getValue());
View Full Code Here

        this.recordBuildSideAccesssor, this.recordProbeSideAccesssor,
        this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
        memSegments, ioManager);
    join.open(buildInput, probeInput);
   
    final Record recordReuse = new Record();

    try {
      while (join.nextRecord()) { 
        HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
        if (buildSide.next(recordReuse) == null) {
View Full Code Here

    join.open(buildInput, new UniformRecordGenerator(NUM_PROBE_KEYS, NUM_PROBE_VALS, true));

    int expectedNumResults = (Math.min(NUM_PROBE_KEYS, NUM_BUILD_KEYS) * NUM_BUILD_VALS)
        * NUM_PROBE_VALS;

    final Record recordReuse = new Record();
    int numRecordsInJoinResult = 0;
   
    while (join.nextRecord()) {
      HashBucketIterator<Record, Record> buildSide = join.getBuildSideIterator();
      while (buildSide.next(recordReuse) != null) {
View Full Code Here

        this.recordBuildSideAccesssor, this.recordProbeSideAccesssor,
        this.recordBuildSideComparator, this.recordProbeSideComparator, this.pactRecordComparator,
        memSegments, ioManager);
    join.open(buildInput, new UniformRecordGenerator(NUM_PROBE_KEYS, NUM_PROBE_VALS, true));
   
    final Record recordReuse = new Record();
    int numRecordsInJoinResult = 0;
   
    int expectedNumResults = (Math.min(NUM_PROBE_KEYS, NUM_BUILD_KEYS) * NUM_BUILD_VALS)
    * NUM_PROBE_VALS;
   
 
View Full Code Here

TOP

Related Classes of org.apache.flink.types.Record

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.