You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Andrew Purtell (JIRA)" <ji...@apache.org> on 2014/12/01 00:57:13 UTC

[jira] [Comment Edited] (HBASE-11819) Unit test for CoprocessorHConnection

    [ https://issues.apache.org/jira/browse/HBASE-11819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14229286#comment-14229286 ] 

Andrew Purtell edited comment on HBASE-11819 at 11/30/14 11:56 PM:
-------------------------------------------------------------------

After 25 iterations it looks good.

Last round of feedback from me. Here:
{code}
+    public Result getOnCoprocessorHConnection(TableName tableName, byte[] key)
+        throws IOException {
+      conn = CoprocessorHConnection.getConnectionForEnvironment(env);
+      Table hTable = conn.getTable(tableName);
+      Get get = new Get(key);
+      Result result = hTable.get(get);
+      return result;
+    }
{code}
two issues:
# Why are we using a class field instead of a local variable ('conn')? Let's not.
# Add an assertion that the Connection returned by CoprocessorHConnection#getConnectionForEnvironment is the expected type. A test for {{instanceof CoprocessorHConnection}} should evaluate to {{true}}

0.98 version needs the same changes.


was (Author: apurtell):
After 25 iterations it looks good.

Last round of feedback from me. Here:
{code}
+    public Result getOnCoprocessorHConnection(TableName tableName, byte[] key)
+        throws IOException {
+      conn = CoprocessorHConnection.getConnectionForEnvironment(env);
+      Table hTable = conn.getTable(tableName);
+      Get get = new Get(key);
+      Result result = hTable.get(get);
+      return result;
+    }
{code}
two issues:
# Why are we using a class field instead of a local variable ('conn')? Let's not.
# Add an assertion that the Connection returned by CoprocessorHConnection#getConnectionForEnvironment is the expected type. A test for {{instanceof CoprocessorHConnection}} should evaluate to {{true}}


> Unit test for CoprocessorHConnection 
> -------------------------------------
>
>                 Key: HBASE-11819
>                 URL: https://issues.apache.org/jira/browse/HBASE-11819
>             Project: HBase
>          Issue Type: Test
>            Reporter: Andrew Purtell
>            Assignee: Talat UYARER
>            Priority: Minor
>              Labels: newbie++
>             Fix For: 2.0.0, 0.98.9, 0.99.2
>
>         Attachments: HBASE-11819.patch, HBASE-11819v2.patch, HBASE-11819v3.patch, HBASE-11819v4-0.98.patch, HBASE-11819v4-branch-1.patch, HBASE-11819v4-master.patch, HBASE-11819v4-master.patch
>
>
> Add a unit test to hbase-server that exercises CoprocessorHConnection . 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)