Package eu.stratosphere.core.io

Examples of eu.stratosphere.core.io.StringRecord


  public void invoke() throws Exception {
    this.output.initializeSerializers();

    while (this.input.hasNext()) {

      StringRecord s = input.next();
      this.output.emit(s);
    }

    this.output.flush();
  }
View Full Code Here


    dist.put(1, 1); dist.put(2, 2); dist.put(3, 3);
    Assert.assertEquals(dist, res.getAccumulatorResult("words-per-line"));
   
    // Test distinct words (custom accumulator)
    Set<StringRecord> distinctWords = Sets.newHashSet();
    distinctWords.add(new StringRecord("one"));
    distinctWords.add(new StringRecord("two"));
    distinctWords.add(new StringRecord("three"));
    Assert.assertEquals(distinctWords, res.getAccumulatorResult("distinct-words"));
  }
View Full Code Here

      int wordsPerLine = 0;
      this.word = new StringValue();
      while (tokenizer.next(this.word))
      {
        // Use custom counter
        distinctWords.add(new StringRecord(this.word.getValue()));
 
        this.outputRecord.setField(0, this.word);
        this.outputRecord.setField(1, this.one);
        collector.collect(this.outputRecord);
        ++ wordsPerLine;
View Full Code Here

TOP

Related Classes of eu.stratosphere.core.io.StringRecord

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.