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

Make HBaseInterClusterReplicationEndpoint more extensible

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.3.0, 2.2.4
    • Component/s: Replication
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: