Package eu.stratosphere.types

Examples of eu.stratosphere.types.IntValue


    private void reduceInternal(Iterator<Record> records, Collector<Record> out) {
      Record element = null;
      int sum = 0;
      while (records.hasNext()) {
        element = records.next();
        IntValue i = element.getField(1, IntValue.class);
        sum += i.getValue();
      }

      this.cnt.setValue(sum);
      element.setField(1, this.cnt);
      out.collect(element);
View Full Code Here


    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

     
      Record r = new Record(2);
     
      try {
        r.setField(0, new StringValue("Hello World"));
        r.setField(1, new IntValue(42));
        format.writeRecord(r);
       
        r.setField(0, new StringValue("AbCdE"));
        r.setField(1, new IntValue(13));
        format.writeRecord(r);
       
        format.close();
       
        BufferedReader dis = new BufferedReader(new FileReader(tempFile));
View Full Code Here

     
      boolean success = true;
     
      try {
        r.setField(0, new StringValue("Hello World"));
        r.setField(1, new IntValue(42));
        format.writeRecord(r);
       
        r.setNull(0);
        r.setField(1, new IntValue(13));
        format.writeRecord(r);
       
        format.close();
             
      } catch (IOException e) {
View Full Code Here

     
      Record r = new Record(2);
     
      try {
        r.setField(0, new StringValue("Hello World"));
        r.setField(1, new IntValue(42));
        format.writeRecord(r);
       
        r.setNull(0);
        r.setField(1, new IntValue(13));
        format.writeRecord(r);
       
        format.close();
       
        BufferedReader dis = new BufferedReader(new FileReader(tempFile));
View Full Code Here

        }
      }

      // emit a new record with the center id and the data point. add a one to ease the
      // implementation of the average function with a combiner
      result.setField(0, new IntValue(centerId));
      result.setField(1, p);
      result.setField(2, one);

      out.collect(result);
    }
View Full Code Here

     
      Record r = new Record(2);
     
      try {
        r.setField(0, new StringValue("Hello World"));
        r.setField(1, new IntValue(42));
        r.setField(2, new StringValue("Hello User"));
        format.writeRecord(r);
       
        r.setField(0, new StringValue("AbCdE"));
        r.setField(1, new IntValue(13));
        r.setField(2, new StringValue("ZyXvW"));
        format.writeRecord(r);
       
        format.close();
       
View Full Code Here

     
      boolean success = true;
     
      try {
        r.setField(0, new StringValue("Hello World"));
        r.setField(1, new IntValue(42));
        r.setField(2, new StringValue("Hello User"));
        format.writeRecord(r);
 
        r = new Record();
       
        r.setField(0, new StringValue("AbCdE"));
        r.setField(1, new IntValue(13));
        format.writeRecord(r);
       
        format.close();
       
      } catch (IOException e) {
View Full Code Here

     
      Record r = new Record(2);
     
      try {
        r.setField(0, new StringValue("Hello World"));
        r.setField(1, new IntValue(42));
        r.setField(2, new StringValue("Hello User"));
        format.writeRecord(r);
 
        r = new Record();
       
        r.setField(0, new StringValue("AbCdE"));
        r.setField(1, new IntValue(13));
        format.writeRecord(r);
       
        format.close();
       
        BufferedReader dis = new BufferedReader(new FileReader(tempFile));
View Full Code Here

        p.add(next.getField(1, Point.class));
        count += next.getField(2, IntValue.class).getValue();
      }
     
      next.setField(1, p);
      next.setField(2, new IntValue(count));
      return next;
    }
View Full Code Here

TOP

Related Classes of eu.stratosphere.types.IntValue

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.