You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Andre F de Miranda (JIRA)" <ji...@apache.org> on 2017/04/26 12:25:05 UTC

[jira] [Updated] (NIFI-1305) Clarify Javadoc on DistributedMapCacheClient.getAndPutIfAbsent

     [ https://issues.apache.org/jira/browse/NIFI-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andre F de Miranda updated NIFI-1305:
-------------------------------------
    Summary: Clarify Javadoc on DistributedMapCacheClient.getAndPutIfAbsent  (was: Clarify Jacadoc on DistributedMapCacheClient.getAndPutIfAbsent)

> Clarify Javadoc on DistributedMapCacheClient.getAndPutIfAbsent
> --------------------------------------------------------------
>
>                 Key: NIFI-1305
>                 URL: https://issues.apache.org/jira/browse/NIFI-1305
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Documentation & Website
>    Affects Versions: 0.4.0
>            Reporter: Michael Kobit
>            Priority: Trivial
>
> The Javadoc for this method on DistributedMapCacheClient (https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClient.java#L53-L71) is unclear about what happens if the key does not exist in the cache.
> It looks like from the implementation of DistributedMapCacheClientService that it returns the value if it present, otherwise returns the computed value. The Javadoc doesn't state what is returned happens if an item does not exist.
> I spent some time trying to figure out what makes sense from a client's perspective, and I had some trouble trying to understand what should happen. It seems obvious to me now that the cache should return either the existing value or the newly computed value, but it took some time to get there. 
> I think the documentation should be clearer about what is returned in the case where the item does not exist



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)