Github user MikeThomsen commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2464#discussion_r167394630
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_ClientService.java
 ---
    @@ -549,11 +551,7 @@ public String toTransitUri(String tableName, String 
rowKey) {
                 logger.warn("Connection has not been established, could not 
create a transit URI. Returning null.");
                 return null;
             }
    -        try {
    -            final String masterAddress = 
connection.getAdmin().getClusterStatus().getMaster().getHostAndPort();
    -            return "hbase://" + masterAddress + "/" + tableName + (rowKey 
!= null && !rowKey.isEmpty() ? "/" + rowKey : "");
    -        } catch (IOException e) {
    -            throw new RuntimeException("Failed to get HBase Admin 
interface, due to " + e, e);
    -        }
    +        final String transitUriMasterAddress = 
StringUtils.isEmpty(masterAddress) ? "unknown" : masterAddress;
    --- End diff --
    
    @ijokarumawak I think a timer that asks the cluster for the current master 
on a configurable interval would be good to have here. It could have a default 
of 5-15 minutes. I skimmed through the Java API for HBase and didn't see 
anything that we can use for that, but we should periodically make sure the 
current master info is correct so the provenance info is correct(ish).


---

Reply via email to