[ 
https://issues.apache.org/jira/browse/NIFI-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16245845#comment-16245845
 ] 

ASF GitHub Bot commented on NIFI-4589:
--------------------------------------

GitHub user mattyb149 opened a pull request:

    https://github.com/apache/nifi/pull/2260

    NIFI-4589: Allow multiple keys in FetchDistributedMapCache, add subMap to 
API

    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
    - [x] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [x] Have you ensured that format looks appropriate for the output in 
which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mattyb149/nifi NIFI-4589

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2260.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2260
    
----
commit 16b0fae5599f47857ae926b3c025d351a855987c
Author: Matthew Burgess <mattyb...@apache.org>
Date:   2017-11-09T15:31:16Z

    NIFI-4589: Allow multiple keys in FetchDistributedMapCache, add subMap 
operation to API

----


> Allow multiple keys in FetchDistributedMapCache
> -----------------------------------------------
>
>                 Key: NIFI-4589
>                 URL: https://issues.apache.org/jira/browse/NIFI-4589
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Matt Burgess
>
> Currently (1.4.0) FetchDistributedMapCache will look up a single key and 
> place the value (if present) in either the flow file content or a user-named 
> attribute, depending on the value of the "Put Cache Value In Attribute" 
> property. If the user wishes to look up more than one value, they need 
> multiple FetchDistributedMapCache processors, and each would make one call to 
> the server to get a single key.
> A useful improvement would be to allow multiple keys to be retrieved at once 
> by FetchDistributedMapCache. This would likely involve the following:
> 1) Update documentation and code to accept a comma-separated list of Cache 
> Key Identifiers
> 2) If a single Cache Key Identifier is specified, current behavior is 
> retained (i.e. output to flow file content or a specified attribute)
> 3) If multiple Cache Key Identifiers are specified, then Put Cache Value In 
> Attribute must be set, and the attributes will be prefixed by the value of 
> said property, followed by a period, followed by the evaluated cache key. So 
> if Cache Key Identifier is set to "field1, field2" and Put Cache Value In 
> Attribute is set to "myattrs", then the value for field1 will be placed in 
> the "myattrs.field1" attribute, and field2's value in "myattrs.field2" 
> respectively.
> 4) Due to the possible presence of Expression Language in the Cache Key 
> Identifier property, it may not be possible to determine whether multiple 
> cache keys are present (i.e. a single EL function that generates a 
> comma-separated list), so the requirement on Put Cache Value In Attribute 
> being set must be checked at validation time (if possible) and also run-time
> 5) To make this fetch efficient, a method "subMap" can be created on the 
> DistributedMapCache API, so multiple keys can be passed and multiple 
> key/value pairs can be returned in a single call to the cache server.
> 6) #5 implies a new protocol version (would be 3 at the time of this writing) 
> be added to the DistributedMapCache API
> 7) If protocol negotiation results in a lower version being used, then the 
> client should gracefully degrade into using the "subMap" operation to make 
> multiple calls to the "get" operation, and fill in the result map manually.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to