Package eu.stratosphere.types

Examples of eu.stratosphere.types.IntValue


      LOG.debug("Processed: [" + keyString.toString() + "," + valueString.getValue() + "]");
     
      if (Integer.parseInt(keyString.toString()) + Integer.parseInt(valueString.toString()) < 10) {

        record.setField(0, valueString);
        record.setField(1, new IntValue(Integer.parseInt(keyString.toString()) + 10));
       
        out.collect(record);
      }
     
    }
View Full Code Here


       
        distinctWords.add(new StringValue(word));
        ++numWords;
       
        // we emit a (word, 1) pair
        collector.collect(new Record(new StringValue(word), new IntValue(1)));
      }
     
      // Add a value to the histogram accumulator
      this.wordsPerLine.add(numWords);
    }
View Full Code Here

    public void reduce(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

        sum += Integer.parseInt(reduceValue.toString());

        LOG.debug("Processed: [" + record.getField(0, StringValue.class).toString() +
            "," + reduceValue.toString() + "]");
      }
      record.setField(1, new IntValue(sum));
      out.collect(record);
    }
View Full Code Here

    return limit;
  }
 
  @Override
  public IntValue createValue() {
    return new IntValue();
  }
View Full Code Here

      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

      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

      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

      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

      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)
     
      try {
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.