<?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 Store data required by a custom NiFi processor in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-data-required-by-a-custom-NiFi-processor/m-p/111271#M54767</link>
    <description>&lt;P&gt;HDP-2.5.3.0, NiFi 1.1.1&lt;/P&gt;&lt;P&gt;I am writing a custom  processor in NiFi. There are several String and Timestamp fields that  I need to store somewhere such that those are available on all/any nodes. @Tags({ "example" })&lt;/P&gt;&lt;PRE&gt;@CapabilityDescription("Provide a description")
@SeeAlso({})
@ReadsAttributes({ @ReadsAttribute(attribute = "", description = "") })
@WritesAttributes({ @WritesAttribute(attribute = "", description = "") })
public class MyProcessor extends AbstractProcessor {
.
.
.
private List&amp;lt;PropertyDescriptor&amp;gt; descriptors;
private Set&amp;lt;Relationship&amp;gt; relationships;

 /* Persist these, probably, in ZK */
private Timestamp lastRunAt;
private String startPoint;
.
.
.

@Override
public void onTrigger(final ProcessContext context,final ProcessSession session) throws ProcessException {FlowFile flowFile = session.get();

/*Retrieve lastRunAt &amp;amp; startPoint and use*/
lastRunAt ;
startPoint ;
.
.
.
}
}&lt;/PRE&gt;&lt;P&gt;Note that HDFS is NOT an option as NiFi may run without any Hadoop installation in picture.&lt;/P&gt;&lt;P&gt;What  are the options to do this - I was wondering if Zookeeper can be used to  store this data since it's small in size and NiFi is backed by ZK. I tried to find ways to use the Zookeeper API to persist these fields, in vain.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2017 16:46:38 GMT</pubDate>
    <dc:creator>kaliyugantagoni</dc:creator>
    <dc:date>2017-02-17T16:46:38Z</dc:date>
    <item>
      <title>Store data required by a custom NiFi processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-data-required-by-a-custom-NiFi-processor/m-p/111271#M54767</link>
      <description>&lt;P&gt;HDP-2.5.3.0, NiFi 1.1.1&lt;/P&gt;&lt;P&gt;I am writing a custom  processor in NiFi. There are several String and Timestamp fields that  I need to store somewhere such that those are available on all/any nodes. @Tags({ "example" })&lt;/P&gt;&lt;PRE&gt;@CapabilityDescription("Provide a description")
@SeeAlso({})
@ReadsAttributes({ @ReadsAttribute(attribute = "", description = "") })
@WritesAttributes({ @WritesAttribute(attribute = "", description = "") })
public class MyProcessor extends AbstractProcessor {
.
.
.
private List&amp;lt;PropertyDescriptor&amp;gt; descriptors;
private Set&amp;lt;Relationship&amp;gt; relationships;

 /* Persist these, probably, in ZK */
private Timestamp lastRunAt;
private String startPoint;
.
.
.

@Override
public void onTrigger(final ProcessContext context,final ProcessSession session) throws ProcessException {FlowFile flowFile = session.get();

/*Retrieve lastRunAt &amp;amp; startPoint and use*/
lastRunAt ;
startPoint ;
.
.
.
}
}&lt;/PRE&gt;&lt;P&gt;Note that HDFS is NOT an option as NiFi may run without any Hadoop installation in picture.&lt;/P&gt;&lt;P&gt;What  are the options to do this - I was wondering if Zookeeper can be used to  store this data since it's small in size and NiFi is backed by ZK. I tried to find ways to use the Zookeeper API to persist these fields, in vain.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 16:46:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-data-required-by-a-custom-NiFi-processor/m-p/111271#M54767</guid>
      <dc:creator>kaliyugantagoni</dc:creator>
      <dc:date>2017-02-17T16:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Store data required by a custom NiFi processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-data-required-by-a-custom-NiFi-processor/m-p/111272#M54768</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/5134/kaliyugantagonist.html" nodeid="5134"&gt;@Kaliyug Antagonist&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;NiFi provides a State API that allows you to do what you are looking for (using Zookeeper). Have a look here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html#state_manager" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html#state_manager&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is a lot of existing processors using this state management and I believe this is the best way for you to understand how it works. For example all ListX processors should store a state to be sure they pick up at the right position in case of restart.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 17:00:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-data-required-by-a-custom-NiFi-processor/m-p/111272#M54768</guid>
      <dc:creator>pvillard</dc:creator>
      <dc:date>2017-02-17T17:00:24Z</dc:date>
    </item>
  </channel>
</rss>

