Is it possible my use of map reduce has been rendered invalid / outdated by
the upgrade? It appears to create the expected result but causes follow on
logic in the client to fail as described above.

CLIENT:

        HBaseConfiguration conf = new HBaseConfiguration()

        Job job = new Job(conf);
        job.setJobName("My Native MapReduce");

        Scan scan = new Scan();

        String tableNameIn  =
MyHBaseUtils.getDomainTableName(Publisher.class.getName());
        String tableNameOut =
MyHBaseUtils.getDomainTableName(Result.class.getName());

        TableMapReduceUtil.initTableMapperJob(tableNameIn, scan,
NativeMapper.class, ImmutableBytesWritable.class,
ImmutableBytesWritable.class, job);
        TableMapReduceUtil.initTableReducerJob(tableNameOut,
NativeReducer.class, job);

        job.setOutputFormatClass(TableOutputFormat.class);
        job.setNumReduceTasks(1);

        job.waitForCompletion(true);


REDUCE:

public class NativeReducer extends TableReducer<Writable, Writable,
Writable> {

    @Override
    public void reduce(Writable key, Iterable<Writable> values,
            Context context) throws IOException, InterruptedException {

            String city = Bytes.toString(((ImmutableBytesWritable)
key).get());
            int i = 0;
            for (Writable value : values) {
                i++;
            }

            long nextId = this.getNextId(
                    "MAPREDUCE_RESULT",
                    MyHBaseUtils.getSequenceTableName()
                    );
            Put p = new Put(Bytes.toBytes(nextId));

            p.add(Constants.DEFAULT_DATA_FAMILY, Bytes.toBytes("job_id"),
Bytes.toBytes(jobParams.getJobId()));
            p.add(Constants.DEFAULT_DATA_FAMILY,
Bytes.toBytes("persisted_key"), this.toByteArray(city));
            p.add(Constants.DEFAULT_DATA_FAMILY,
Bytes.toBytes("persisted_value"), this.toByteArray(i));

            long version = 0;
            p.add(Constants.DEFAULT_CONTROL_FAMILY,
                    Constants.DEFAULT_VERSION_QUALIFIER,
                    Bytes.toBytes(version));

            context.write(key, p);

    }
-- 
View this message in context: 
http://old.nabble.com/Exception-after-upgrading-to-90.1-tp31457860p31458091.html
Sent from the HBase User mailing list archive at Nabble.com.

Reply via email to