[
https://issues.apache.org/jira/browse/NIFI-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14552244#comment-14552244
]
Mark Payne commented on NIFI-259:
---------------------------------
Toivo,
I think we want to avoid a simple in-memory HashMap... a Processor can simply
use a HashMap (or ConcurrentHashMap more likely) as a member variable. The idea
here is to have the framework persist that state so that Processors don't have
to bother with that. I also want this to handle distributing that state across
the cluster when it's appropriate - it won't always be. GetFile, for instance,
would not want to persist its state across the cluster because it's picking up
from a local filesystem - presumably. (Could be an NFS mounted file system).
Will have to think through that use case better.
I believe the idea that the state is accessible only from a single processor is
accurate/ideal. We generally use Strings for a few reasons. As you mentioned,
it's easy to determine size. But it's also super trivial to
serializer/deserialize a String. And it's easy enough to use JAXB or something
similar to build more rich models and convert to/from Strings.
> Framework should offer Processors/extensions a way to manage simple state
> -------------------------------------------------------------------------
>
> Key: NIFI-259
> URL: https://issues.apache.org/jira/browse/NIFI-259
> Project: Apache NiFi
> Issue Type: Sub-task
> Components: Core Framework
> Reporter: Joseph Witt
>
> It is not uncommon for processors to need managed state which persists
> across restarts. One good example of this is the GetHTTP processor which
> needs to save state of the last cache/e-tag information it received from the
> server it interacts with so that it can avoid constantly pulling an unchanged
> resource.
> Rather than making processors roll their own persistant state management
> perhaps we can offer something to them via the ProcessContext which will
> allow them to save simple primitive values and limited length Strings which
> are local to that node and which are local to that processor only.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)