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

Make HBaseInterClusterReplicationEndpoint more extensible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.3.0, 2.2.4
    • Replication
    • 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);
          }
      ...
      

      Attachments

        Activity

          People

            wchevreuil Wellington Chevreuil
            wchevreuil Wellington Chevreuil
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: