You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Jesse Yates (JIRA)" <ji...@apache.org> on 2012/08/02 02:16:02 UTC

[jira] [Created] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Jesse Yates created HBASE-6495:
----------------------------------

             Summary: HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
                 Key: HBASE-6495
                 URL: https://issues.apache.org/jira/browse/HBASE-6495
             Project: HBase
          Issue Type: Bug
    Affects Versions: 0.96.0, 0.94.1
            Reporter: Jesse Yates
             Fix For: 0.96.0, 0.94.1


Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
{code}
  public HBaseAdmin(HConnection connection)
      throws MasterNotRunningException, ZooKeeperConnectionException {
    this.conf = connection.getConfiguration();

    // We want the real class, without showing it our public interface,
    //  hence the cast.
    this.connection = (HConnectionManager.HConnectionImplementation)connection;
{code}

However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 

We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449333#comment-13449333 ] 

Jesse Yates commented on HBASE-6495:
------------------------------------

Patch is for trunk. Would you like a 0.94 one as well? Its going to be a bit different, given the PB changes...
                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>             Fix For: 0.96.0
>
>         Attachments: hbase-6495-v0.patch
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13429421#comment-13429421 ] 

stack commented on HBASE-6495:
------------------------------

You have list of what HBaseAdmin needs beyond HConnection mighty Jesse?
                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>             Fix For: 0.96.0, 0.94.1
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449451#comment-13449451 ] 

Hudson commented on HBASE-6495:
-------------------------------

Integrated in HBase-TRUNK #3309 (See [https://builds.apache.org/job/HBase-TRUNK/3309/])
    HBASE-6495 HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation (Revision 1381467)

     Result = FAILURE
stack : 
Files : 
* /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
* /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnection.java
* /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>            Assignee: Jesse Yates
>             Fix For: 0.96.0
>
>         Attachments: hbase-6495-v0.patch
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-6495:
-------------------------

      Resolution: Fixed
        Assignee: Jesse Yates
    Hadoop Flags: Incompatible change,Reviewed
          Status: Resolved  (was: Patch Available)

Thanks for the important Interface cleanup Jesse.  I ran  TestAdmin locally and it passed so committed to trunk (I'd say it doesn't belong in 0.94...this patch doesn't make sense there at least.... Will let Lars ask for it if he wants it)
                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>            Assignee: Jesse Yates
>             Fix For: 0.96.0
>
>         Attachments: hbase-6495-v0.patch
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated HBASE-6495:
---------------------------------

    Fix Version/s:     (was: 0.94.1)
                   0.94.2
    
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>             Fix For: 0.96.0, 0.94.2
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Yates updated HBASE-6495:
-------------------------------

    Attachment: hbase-6495-v0.patch

@lars - yup, attaching (and submitting for QA run). Minor changes, just two methods needed to be pulled up.
                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>             Fix For: 0.96.0
>
>         Attachments: hbase-6495-v0.patch
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448454#comment-13448454 ] 

Lars Hofhansl commented on HBASE-6495:
--------------------------------------

Have a patch, Jesse?
                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>             Fix For: 0.96.0, 0.94.3
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Yates updated HBASE-6495:
-------------------------------

    Fix Version/s:     (was: 0.94.3)
           Status: Patch Available  (was: Open)
    
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.94.1, 0.96.0
>            Reporter: Jesse Yates
>             Fix For: 0.96.0
>
>         Attachments: hbase-6495-v0.patch
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-6495) HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

Posted by "Jesse Yates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13429550#comment-13429550 ] 

Jesse Yates commented on HBASE-6495:
------------------------------------

@stack: yeah, when doing some work on HBASE-6055 it was basically impossible to cleanly mock out the client-to-master connection since I couldn't pass in an HConnection that was expected from a generic package. Ended up having to move to the .client package and mock out an HConnection.HConnectionImplementation which wasn't very nice. That's my main gripe - not the end of the world, but definitely a nice to have. Unless I'm missing something?
                
> HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation
> --------------------------------------------------------------------------
>
>                 Key: HBASE-6495
>                 URL: https://issues.apache.org/jira/browse/HBASE-6495
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.96.0, 0.94.1
>            Reporter: Jesse Yates
>             Fix For: 0.96.0, 0.94.1
>
>
> Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:
> {code}
>   public HBaseAdmin(HConnection connection)
>       throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = connection.getConfiguration();
>     // We want the real class, without showing it our public interface,
>     //  hence the cast.
>     this.connection = (HConnectionManager.HConnectionImplementation)connection;
> {code}
> However, this breaks the explicit contract in the javadocs and makes it basically impossible to mock out the hbaseadmin. 
> We need to either make the hbaseadmin use a basic HConnection and optimize for cases where its smarter or bring up the couple of methods in HConnectionManager.HConnectionImplementation to the HConnection interface.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira