Reputation: 1
I am getting this error in my source code:
java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HColumnDescriptor.setMaxVersions(I)V
when I upgraded from hbase-0.92.1-cdh4.1.1 to hbase-0.94.2-cdh4.2.0 I see that the signature of the method is changed from
public void setMaxVersions(int maxVersions)
to
public HColumnDescriptor setMaxVersions(int maxVersions)
I am guessing there is binary compatibility is lost. Could someone shed some light on how this can be resolved? Thanks.
Upvotes: 0
Views: 200
Reputation: 11
You can use Java Reflection to do this:
HColumnDescriptor fam1 = new HColumnDescriptor(Bytes.toBytes('cf'));
Method method = fam1.getClass().getMethod("setMaxVersions", Integer.TYPE);
method.invoke(fam1, 10);
Upvotes: 1