hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject bridging potential hole in CODE_TO_CLASS and CLASS_TO_CODE of HbaseObjectWritable
Date Mon, 05 Mar 2012 23:01:11 GMT
Hi,
When I backported HBASE-5358 for 0.92, I was bringing the following into
HbaseObjectWritable.java:
+     //java.lang.reflect.Array is a placeholder for arrays not defined
above
+     GENERIC_ARRAY_CODE = code++;
+     addToMap(Array.class, GENERIC_ARRAY_CODE);

We had to handle the two classes which aren't in 0.92:

      addToMap(Append.class, code++);

      addToMap(RowMutation.class, code++);

I planned to use dummy classes in their place so that GENERIC_ARRAY_CODE
stays the same for 0.92 and 0.94

Enis suggested creating private final dummy class for the above purpose.

This is what went into 0.92:

  // the following class is used to fill potential holes in
  // CODE_TO_CLASS and CLASS_TO_CODE so that concrete classes have
  // the same ordinals across major releases
  private final static class DummyType {
  }

In the future, please make use of the above class when backporting.

Cheers

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