Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
HBaseInterClusterReplicationEndpoint currently creates the cluster connection and sink manager instances inside its init method and assigns those to private class variables. Then any potential custom extension of HBaseInterClusterReplicationEndpoint that requires custom implementations of connection and/or sink manager would need to resort to java reflection for effectively replace those instances, such as below:
... ClusterConnection conn = (ClusterConnection)ConnectionFactory. createConnection(context.getConfiguration(), User.create(replicationUgi)); ReplicationSinkManager sinkManager = new ReplicationSinkManager(conn, ctx.getPeerId(), this, context.getConfiguration()); try { Field field = this.getClass().getSuperclass().getDeclaredField("conn"); field.setAccessible(true); field.set(this, conn); field = this.getClass().getSuperclass().getDeclaredField("replicationSinkMgr"); field.setAccessible(true); field.set(this, sinkManager); } catch (Exception e) { throw new IOException(e); } ...