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

Jason Huynh commented on GEODE-3813:
------------------------------------

Here are my interpretation of the results from the dev list:
- deprecate current "ALL_KEYS" and List passing behavior in registerInterest()
- add registerInterestForAllKeys();
- add registerInterestForKeys(T... keys)
- add registerInterestForKeys(Iterable<T>keys)

I believe this will have to be done in two phases.
Phase 1:
- Deprecate ALL_KEYS and List passing behavior
- Add warnings when ALL_KEYS or Lists are passed to the current registerInterest
- add registerInterestForAllKeys();
- optional (add registerInterestForKeys(Iterable<T> and add 
registerInterestForKeys(T...) where it does the iteration on the client and 
just calls registerInterest(T) for each key.  This is not optimal but is 
definitely doable if needed)

Phase 2: (Major version/possibly breaking change)
- remove behavior of List (there is a specific messages for this)
- remove behavior of ALL_KEYS from the code.  
- add and optimize registerInterestForKeys(Iterable<T>) to do the iteration on 
the server
- add registerInterest(T... keys)

When Phase 1 is complete, possibly open a new ticket for Phase 1


> Region registerInterest API usage of type parameters is broken
> --------------------------------------------------------------
>
>                 Key: GEODE-3813
>                 URL: https://issues.apache.org/jira/browse/GEODE-3813
>             Project: Geode
>          Issue Type: Bug
>          Components: client queues, regions
>            Reporter: Kirk Lund
>            Assignee: Jason Huynh
>
> The registerInterest API works for single key registration but is broken for 
> all other types of registration if the Region is declared with type 
> parameters:
> Single key (works):
> {noformat}
> Region<Integer, ValueClass> region = clientRegionFactory.create(regionName);
> region.registerInterest(1);
> {noformat}
> ALL_KEYS token is broken (fails to compile):
> {noformat}
> Region<Integer, ValueClass> region = clientRegionFactory.create(regionName);
> region.registerInterest("ALL_KEYS");
> {noformat}
> List of keys is broken (fails to compile):
> {noformat}
> Region<Integer, ValueClass> region = clientRegionFactory.create(regionName);
> List<Integer> listOfKeys = new ArrayList<>();
> listOfKeys.add(1);
> listOfKeys.add(2);
> region.registerInterest(listOfKeys);
> {noformat}
> When this ticket is fixed and the API is updated, we should consider adding 
> support for var args:
> {noformat}
> Region<Integer, ValueClass> region = clientRegionFactory.create(regionName);
> region.registerInterest(1, 2, 3);
> {noformat}



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

Reply via email to