Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-6495

HBaseAdmin shouldn't expect HConnection to be an HConnectionImplementation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.94.1, 0.95.2
    • 0.95.0
    • None
    • None
    • Incompatible change, Reviewed

    Description

      Currently, the HBaseAdmin has a constructor that takes an HConnection, but then immediately casts it to an HConnectionManager.HConnectionImplementation:

        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;
      

      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.

      Attachments

        1. hbase-6495-v0.patch
          4 kB
          Jesse Yates

        Activity

          People

            jesse_yates Jesse Yates
            jesse_yates Jesse Yates
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: