hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serega Sheypak <serega.shey...@gmail.com>
Subject No applicable class implementing Serialization in conf at io.serializations: class org.apache.hadoop.hbase.client.Put
Date Sun, 02 Nov 2014 21:02:41 GMT
Hi, I'm migrating from CDH4 to CDH5 (hbase 0.98.6-cdh5.2.0)
I had a unit test for mapper used to create HFile and bulk load later.

I've bumped maven deps from cdh4 to cdh5 0.98.6-cdh5.2.0
Now I've started to get exception

java.lang.IllegalStateException: No applicable class implementing
Serialization in conf at io.serializations: class
org.apache.hadoop.hbase.client.Put
at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
at
org.apache.hadoop.mrunit.internal.io.Serialization.copy(Serialization.java:75)
at
org.apache.hadoop.mrunit.internal.io.Serialization.copy(Serialization.java:97)
at
org.apache.hadoop.mrunit.internal.output.MockOutputCollector.collect(MockOutputCollector.java:48)
at
org.apache.hadoop.mrunit.internal.mapreduce.AbstractMockContextWrapper$4.answer(AbstractMockContextWrapper.java:90)
at
org.mockito.internal.stubbing.StubbedInvocationMatcher.answer(StubbedInvocationMatcher.java:34)
at
org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:91)
at
org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at
org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)
at
org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:51)
at
org.apache.hadoop.mapreduce.Mapper$Context$$EnhancerByMockitoWithCGLIB$$ba4633fb.write(<generated>)


And here is mapper code:



public class ItemRecommendationHBaseMapper extends Mapper<LongWritable,
BytesWritable, ImmutableBytesWritable, Put> {

    private final ImmutableBytesWritable hbaseKey = new
ImmutableBytesWritable();
    private final DynamicObjectSerDe<ItemRecommendation> serde = new
DynamicObjectSerDe<ItemRecommendation>(ItemRecommendation.class);

    @Override
    protected void map(LongWritable key, BytesWritable value, Context
context) throws IOException, InterruptedException {
        checkPreconditions(key, value);
        hbaseKey.set(Bytes.toBytes(key.get()));

        ItemRecommendation item = serde.deserialize(value.getBytes());
        checkPreconditions(item);
        Put put = PutFactory.createPut(serde, item, getColumnFamily());

        context.write(hbaseKey, put); //Exception here
    }

Whatcan i do in order to make unit-test pass?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message