Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.94.1, 0.95.2
-
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.