You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by ek...@gmail.com on 2010/12/31 22:25:41 UTC

Review Request: Coprocessor Protocol Generic Support

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1405/
-----------------------------------------------------------

Review request for hbase.


Summary
-------

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.


This addresses bug HBASE-3400.
    http://issues.apache.org/jira/browse/HBASE-3400


Diffs
-----

  src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java c127ea3 
  src/main/java/org/apache/hadoop/hbase/client/coprocessor/ExecResult.java be46cd2 
  src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java 9609652 
  src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java 75f76e8 

Diff: http://review.cloudera.org/r/1405/diff


Testing
-------

Integration test included in patch. Demonstrates generic interface using objects, arrays, and primitives, and checks that all primitive classes work as well.


Thanks,

ekohlwey


Re: Review Request: Coprocessor Protocol Generic Support

Posted by ek...@gmail.com.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1405/
-----------------------------------------------------------

(Updated 2010-12-31 17:45:56.197941)


Review request for hbase.


Changes
-------

Added classes that were missing for tests.


Summary
-------

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.


This addresses bug HBASE-3400.
    http://issues.apache.org/jira/browse/HBASE-3400


Diffs (updated)
-----

  src/main/java/org/apache/hadoop/hbase/client/coprocessor/Exec.java c127ea3 
  src/main/java/org/apache/hadoop/hbase/client/coprocessor/ExecResult.java be46cd2 
  src/main/java/org/apache/hadoop/hbase/ipc/Invocation.java 9609652 
  src/test/java/org/apache/hadoop/hbase/coprocessor/GenericEndpoint.java PRE-CREATION 
  src/test/java/org/apache/hadoop/hbase/coprocessor/GenericProtocol.java PRE-CREATION 
  src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java 75f76e8 

Diff: http://review.cloudera.org/r/1405/diff


Testing
-------

Integration test included in patch. Demonstrates generic interface using objects, arrays, and primitives, and checks that all primitive classes work as well.


Thanks,

ekohlwey