Examples of IntValue


Examples of org.apache.flink.types.IntValue

    input.addAttribute("" + 0.02);
    input.addAttribute(RETURN_FLAG);
    input.addAttribute("0");
    //the relevant column is missing now
   
    IntValue inputKey = new IntValue();
    Record rec = new Record();
    rec.setField(0, inputKey);
    rec.setField(1, input);
   
    Collector<Record> collector = new RecordOutputCollector(writerList);
View Full Code Here

Examples of org.apache.flink.types.IntValue

    public void reduce(Iterator<Record> records, Collector<Record> out) {
     
      Record next = records.next();
     
      // Increments the first field of the first record of the reduce group by 100 and emit it
      IntValue incrVal = next.getField(0, IntValue.class);
      incrVal.setValue(incrVal.getValue() + 100);
      next.setField(0, incrVal);
      out.collect(next);
     
      // emit all remaining records
      while (records.hasNext()) {
View Full Code Here

Examples of org.apache.flink.types.IntValue

      double epsilon = 0.05;
      double criterion = rank.getValue() - newRank.getValue();
     
      if(Math.abs(criterion) > epsilon)
      {
        record.setField(0, new IntValue(1));
        out.collect(record);
      }
    }
View Full Code Here

Examples of org.apache.flink.types.IntValue

    boundaries = new IntValue[len][];
   
    for (int i = 0; i < len; i++) {
      IntValue[] bucket = new IntValue[dim];
      for (int d = 0; d < dim; d++) {
        bucket[d] = new IntValue(in.readInt());
      }
     
      boundaries[i] = bucket;
    }
  }
View Full Code Here

Examples of org.apache.flink.types.IntValue

  }
 
  private static IntValue[][] packIntegers(int[] values) {
    IntValue[][] packed = new IntValue[values.length][];
    for (int i = 0; i < values.length; i++) {
      packed[i] = new IntValue[] { new IntValue(values[i]) };
    }
   
    return packed;
  }
View Full Code Here

Examples of org.apache.flink.types.IntValue

    @Override
    public void map(Record record, Collector<Record> out) throws Exception {
      final int d1 = record.getField(2, IntValue.class).getValue();
      final int d2 = record.getField(3, IntValue.class).getValue();
      if (d1 > d2) {
        IntValue first = record.getField(1, IntValue.class);
        IntValue second = record.getField(0, IntValue.class);
        record.setField(0, first);
        record.setField(1, second);
      }
      record.setNumFields(2);
      out.collect(record);
View Full Code Here

Examples of org.apache.flink.types.IntValue

      format.setFieldTypesGeneric(StringValue.class, IntValue.class, StringValue.class, IntValue.class);
     
      format.configure(parameters);
      format.open(split);
     
      Value[] values = new Value[] { new StringValue(), new IntValue(), new StringValue(), new IntValue() };
     
      assertNotNull(format.nextRecord(values));
     
      try {
        format.nextRecord(values);
View Full Code Here

Examples of org.apache.flink.types.IntValue

      format.setLenient(true);
     
      format.configure(parameters);
      format.open(split);
     
      Value[] values = new Value[] { new StringValue(), new IntValue(), new StringValue(), new IntValue() };
     
      assertNotNull(format.nextRecord(values));
      assertNull(format.nextRecord(values));
    }
    catch (Exception ex) {
View Full Code Here

Examples of org.apache.flink.types.IntValue

      format.setLenient(true);
     
      format.configure(parameters);
      format.open(split);
     
      Value[] values = new Value[] { new StringValue(), new IntValue()};
     
      assertNotNull(format.nextRecord(values));
      assertNull(format.nextRecord(values));
      assertNull(format.nextRecord(values));
      assertNotNull(format.nextRecord(values));
View Full Code Here

Examples of org.apache.flink.types.IntValue

      format.setSkipFirstLineAsHeader(true);
     
      format.configure(parameters);
      format.open(split);
     
      Value[] values = new Value[] { new IntValue(), new StringValue(), new IntValue(), new StringValue()};
     
      // first line is skipped as header
      assertNotNull(format.nextRecord(values));   //  first row (= second line)
      assertNotNull(format.nextRecord(values));   // second row (= third line)
      assertNull(format.nextRecord(values))// exhausted
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.