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

    https://github.com/apache/nifi/pull/2304#discussion_r153818372
  
    --- 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_RecordLookupService.java
 ---
    @@ -114,8 +114,12 @@
         }
     
         @Override
    -    public Optional<Record> lookup(Map<String, String> coordinates) throws 
LookupFailureException {
    -        final String rowKey = coordinates.get(ROW_KEY_KEY);
    +    public Optional<Record> lookup(Map<String, Object> coordinates) throws 
LookupFailureException {
    +        if (coordinates.get(ROW_KEY_KEY) == null) {
    +            return Optional.empty();
    +        }
    +
    +        final String rowKey = coordinates.get(ROW_KEY_KEY) instanceof 
String ? (String)coordinates.get(ROW_KEY_KEY) : 
coordinates.get(ROW_KEY_KEY).toString();
    --- End diff --
    
    I don't think we need to be checking any instanceof here -- just call 
coordinates.get(ROW_KEY_KEY).toString() -- it is a String, then toString() will 
simply return 'this'.


---

Reply via email to