<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Make Global connection to hbase in nif custom processor? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203716#M62616</link>
    <description>&lt;P&gt;I'm not sure I understand the question...&lt;/P&gt;&lt;P&gt;There is a controller service called HBaseClientService which would be the connection to HBase, and then your processor can declare a property like:&lt;/P&gt;&lt;PRE&gt;static final PropertyDescriptor HBASE_CLIENT_SERVICE = new PropertyDescriptor.Builder()
        .name("HBase Client Service")
        .description("Specifies the Controller Service to use for accessing HBase.")
        .required(true)
        .identifiesControllerService(HBaseClientService.class)
        .build();&lt;/PRE&gt;&lt;P&gt;Then in your onTrigger method you get the service by doing:&lt;/P&gt;&lt;PRE&gt;HBaseClientService clientService = context.getProperty(HBASE_CLIENT_SERVICE)
	.asControllerService(HBaseClientService.class);&lt;/PRE&gt;&lt;P&gt;You can look at how the existing HBase processors work:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors" target="_blank"&gt;https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2017 20:24:51 GMT</pubDate>
    <dc:creator>bbende</dc:creator>
    <dc:date>2017-06-09T20:24:51Z</dc:date>
    <item>
      <title>Make Global connection to hbase in nif custom processor?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203715#M62615</link>
      <description>&lt;P&gt;Need to make global connection to hbase in nifi custom processor with the connection properties (/etc/hbase/conf/hbase-site.xml and /etc/hadoop/conf/core-site.xml) value read from the flow file. I tried to do that but it reads from ProcessContext value which i got in onTriggerMethod so not able to make global connection. Can any one suggest how can i do this?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 14:12:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203715#M62615</guid>
      <dc:creator>taresh_soni</dc:creator>
      <dc:date>2017-06-09T14:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Make Global connection to hbase in nif custom processor?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203716#M62616</link>
      <description>&lt;P&gt;I'm not sure I understand the question...&lt;/P&gt;&lt;P&gt;There is a controller service called HBaseClientService which would be the connection to HBase, and then your processor can declare a property like:&lt;/P&gt;&lt;PRE&gt;static final PropertyDescriptor HBASE_CLIENT_SERVICE = new PropertyDescriptor.Builder()
        .name("HBase Client Service")
        .description("Specifies the Controller Service to use for accessing HBase.")
        .required(true)
        .identifiesControllerService(HBaseClientService.class)
        .build();&lt;/PRE&gt;&lt;P&gt;Then in your onTrigger method you get the service by doing:&lt;/P&gt;&lt;PRE&gt;HBaseClientService clientService = context.getProperty(HBASE_CLIENT_SERVICE)
	.asControllerService(HBaseClientService.class);&lt;/PRE&gt;&lt;P&gt;You can look at how the existing HBase processors work:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors" target="_blank"&gt;https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 20:24:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203716#M62616</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2017-06-09T20:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Make Global connection to hbase in nif custom processor?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203717#M62617</link>
      <description>&lt;P&gt;Thanks for the rply i got this but my need is to make HBase connection outside onTrigger method by using the HBASE_CLIENT_SERVICE property value. Becuase onTrigger method will be called every time flowfile comes and it will go every time to make connection. Dont need to make connection every time.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 21:17:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203717#M62617</guid>
      <dc:creator>taresh_soni</dc:creator>
      <dc:date>2017-06-09T21:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Make Global connection to hbase in nif custom processor?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203718#M62618</link>
      <description>&lt;P&gt;If you want to get the HBaseClientService outside of onTrigger you can do the following...&lt;/P&gt;&lt;PRE&gt;private volatile HBaseClientService service;

@OnScheduled
public void onScheduled(ProcessContext context) {
  this.service = context.getProperty(HBASE_CLIENT_SERVICE)
           .asControllerService(HBaseClientService.class);
}	
&lt;/PRE&gt;&lt;P&gt;A method annotated with @OnScheduled will be called one time when the processor is first started.&lt;/P&gt;&lt;P&gt;Also, keep in mind that getting the HBaseClientService every time in onTrigger is totally fine because its not making a new connection every time. The connection is made when HBaseClientService is first started, and then you would just be getting access to that existing connection each time in onTrigger.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 21:38:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Make-Global-connection-to-hbase-in-nif-custom-processor/m-p/203718#M62618</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2017-06-09T21:38:19Z</dc:date>
    </item>
  </channel>
</rss>

