Examples of Step0Mapper


Examples of org.apache.mahout.df.mapred.partial.Step0Job.Step0Mapper

      RecordReader<LongWritable, Text> reader = input.getRecordReader(split, job, reporter);

      LongWritable key = reader.createKey();
      Text value = reader.createValue();

      Step0Mapper mapper = new Step0Mapper();
      mapper.configure(p);

      Long firstKey = null;
      int size = 0;

      while (reader.next(key, value)) {
        if (firstKey == null) {
          firstKey = key.get();
        }

        mapper.map(key, value, collector, reporter);

        size++;
      }

      mapper.close();

      // validate the mapper's output
      assertEquals(p, collector.keys[p]);
      assertEquals(firstKey.longValue(), collector.values[p].getFirstId());
      assertEquals(size, collector.values[p].getSize());
View Full Code Here

Examples of org.apache.mahout.df.mapred.partial.Step0Job.Step0Mapper

      RecordReader<LongWritable, Text> reader = input.getRecordReader(split, job, reporter);

      LongWritable key = reader.createKey();
      Text value = reader.createValue();

      Step0Mapper mapper = new Step0Mapper();
      mapper.configure(p);

      Long firstKey = null;
      int size = 0;

      while (reader.next(key, value)) {
        if (firstKey == null) {
          firstKey = key.get();
        }

        mapper.map(key, value, collector, reporter);

        size++;
      }

      mapper.close();

      // validate the mapper's output
      assertEquals(p, collector.keys[p]);
      assertEquals(firstKey.longValue(), collector.values[p].getFirstId());
      assertEquals(size, collector.values[p].getSize());
View Full Code Here

Examples of org.apache.mahout.df.mapreduce.partial.Step0Job.Step0Mapper

    InputSplit[] sorted = new InputSplit[NUM_MAPS];
    splits.toArray(sorted);
    Builder.sortSplits(sorted);

    Step0Context context = new Step0Context(new Step0Mapper(), job.getConfiguration(),
                                            new TaskAttemptID(), NUM_MAPS);

    for (int p = 0; p < NUM_MAPS; p++) {
      InputSplit split = sorted[p];

      RecordReader<LongWritable, Text> reader = input.createRecordReader(split,
                                                                         context);
      reader.initialize(split, context);

      Step0Mapper mapper = new Step0Mapper();
      mapper.configure(p);

      Long firstKey = null;
      int size = 0;

      while (reader.nextKeyValue()) {
        LongWritable key = reader.getCurrentKey();

        if (firstKey == null) {
          firstKey = key.get();
        }

        mapper.map(key, reader.getCurrentValue(), context);

        size++;
      }

      mapper.cleanup(context);

      // validate the mapper's output
      assertEquals(p, context.keys[p]);
      assertEquals(firstKey.longValue(), context.values[p].getFirstId());
      assertEquals(size, context.values[p].getSize());
View Full Code Here

Examples of org.apache.mahout.df.mapreduce.partial.Step0Job.Step0Mapper

    InputSplit[] sorted = new InputSplit[numMaps];
    splits.toArray(sorted);
    Builder.sortSplits(sorted);

    Step0Context context = new Step0Context(new Step0Mapper(), job.getConfiguration(),
                                            new TaskAttemptID(), numMaps);

    for (int p = 0; p < numMaps; p++) {
      InputSplit split = sorted[p];

      RecordReader<LongWritable, Text> reader = input.createRecordReader(split,
                                                                         context);
      reader.initialize(split, context);

      Step0Mapper mapper = new Step0Mapper();
      mapper.configure(p);

      Long firstKey = null;
      int size = 0;

      while (reader.nextKeyValue()) {
        LongWritable key = reader.getCurrentKey();

        if (firstKey == null) {
          firstKey = key.get();
        }

        mapper.map(key, reader.getCurrentValue(), context);

        size++;
      }

      mapper.cleanup(context);

      // validate the mapper's output
      assertEquals(p, context.keys[p]);
      assertEquals(firstKey.longValue(), context.values[p].getFirstId());
      assertEquals(size, context.values[p].getSize());
View Full Code Here

Examples of org.apache.mahout.df.mapreduce.partial.Step0Job.Step0Mapper

    InputSplit[] sorted = new InputSplit[numMaps];
    splits.toArray(sorted);
    Builder.sortSplits(sorted);

    context = new Step0Context(new Step0Mapper(), job.getConfiguration(),
        new TaskAttemptID(), numMaps);

    for (int p = 0; p < numMaps; p++) {
      InputSplit split = sorted[p];

      RecordReader<LongWritable, Text> reader = input.createRecordReader(split,
          context);
      reader.initialize(split, context);

      Step0Mapper mapper = new Step0Mapper();
      mapper.configure(p);

      Long firstKey = null;
      int size = 0;

      while (reader.nextKeyValue()) {
        LongWritable key = reader.getCurrentKey();

        if (firstKey == null) {
          firstKey = key.get();
        }

        mapper.map(key, reader.getCurrentValue(), context);

        size++;
      }

      mapper.cleanup(context);

      // validate the mapper's output
      assertEquals(p, context.keys[p]);
      assertEquals(firstKey.longValue(), context.values[p].getFirstId());
      assertEquals(size, context.values[p].getSize());
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.