0

Get this error when trying to connect to HBase service. I am just trying to implement increment HBase script but can not seem to figure out how to get already functioning HBase connection.

Caused by: groovy.lang.MissingMethodException: No signature of method: com.sun.proxy.$Proxy83.getConnection() is applicable for argument types: () values: [] on this code

import org.apache.nifi.controller.ControllerService
flowFile = session.get()

if(!flowFile) return

def lookup = context.controllerServiceLookup
def HbaseServiceName = HBaseConnectionName.value

def HBaseServiceId = lookup.getControllerServiceIdentifiers(ControllerService).find { 
    cs -> lookup.getControllerServiceName(cs) == HbaseServiceName
}
def conn = lookup.getControllerService(HBaseServiceId)?.getConnection()
andrew shved
  • 137
  • 1
  • 8
  • 1
    Variable names shouldn't start with capital letters. I don't think this is the issue in this case, but can you try starting then with lower case letters, to remove one area of doubt? – tim_yates Mar 18 '17 at 18:32
  • nah not it the same error. Looks like getConnection is not exposed for nifi client. I may need to write something of my own... :( – andrew shved Mar 18 '17 at 21:47
  • What should `lookup.getControllerService(HBaseServiceId)` return? What does it return? – Anton Hlinisty Mar 18 '17 at 21:58
  • 1
    Getting the controller service should return an instance of HBaseClientService, the interface is here https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-hbase-client-service-api/src/main/java/org/apache/nifi/hbase/HBaseClientService.java – Bryan Bende Mar 20 '17 at 14:12
  • right @BryanBende but how do I now connect to HBase client using this. to run my increment :( – andrew shved Mar 22 '17 at 22:12
  • @andrewshved you can't get the underlying Hbase client, the point is that the controller service hides the real HBase API from the processors, so if someone implements a new HBaseClientService for a newer HBase client, the processors don't have to change – Bryan Bende Mar 23 '17 at 13:53

0 Answers0