Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
  public void map(ImmutableBytesWritable key, VectorWritable value,
      OutputCollector<ImmutableBytesWritable, VectorWritable> output,
      Reporter reporter) throws IOException {

    /* Do something */value.scale(0.5);
    output.collect(key, value);
  }

  public void reduce(ImmutableBytesWritable key, Iterator<VectorWritable> values,
      OutputCollector<ImmutableBytesWritable, BatchUpdate> output,
      Reporter reporter) throws IOException {

    BatchUpdate batchObj = new BatchUpdate(key.get());
    VectorDatum vector = values.next();
    for (Map.Entry<byte[], Cell> f : vector.entrySet()) {
      batchObj.put(f.getKey(), f.getValue().getValue());
    }

    output.collect(key, batchObj);
  }

...