Coprocessor Protocol Generic Support

Review Request #1405 - Created Dec. 31, 2010 and updated

ekohlwey
old-hbase
HBASE-3400
hbase
ghelmling
Coprocessors currently do not support generic interfaces because type erasure makes their generic parameters appear as Objects to Invocation.java.
This can be overcome by writing out the parameters using their own types (rather than the type parameters), and then separately writing the class names for the type parameters. While it would be ideal to implement this in Invocation.java, some other code seems to be relying on its write order and doing so breaks other RPC code. The modification can, however, be implemented in Exec.java instead.

The included patch modifies Invocation.java's fields to that they are protected scope, and fully implements the read and write methods for Exec rather than using the parent method for the parent fields. ExecResult is also modified to accommodate generic returns in the same way.
Integration test included in patch. Demonstrates generic interface using objects, arrays, and primitives, and checks that all primitive classes work as well.
Review request changed

People:

+ghelmling
  1. +1.  Thanks for the patch, Ed!
    
    Looks good.  Only comment is minor code-style issues -- avoid whitespace/formatting changes and watch the line length.
  2. Minor nit: lines generally shouldn't exceed 80 chars.
  3. Avoid the formatting only/whitespace changes.  They distract from what's changed.
  4. 
      
Loading...