curator icon indicating copy to clipboard operation
curator copied to clipboard

[CURATOR-470] Newly added/Removed ServiceInstance should be passed to ServiceCacheListener#cacheChanged method

Open jira-importer opened this issue 7 years ago • 4 comments

Hey fellows,

We're using service discovery extension to refactor our raw zookeeper based service monitor.

Every time a service instance exits or joins, the monitor must be notified and push a notification to us, the only thing I found in service discovery package meets the requirement is ServiceCacheListener interface, but when the interface is fired, there's no way we could know which service has changed.

Please help !

Thank in advance.


Originally reported by [email protected], imported from: Newly added/Removed ServiceInstance should be passed to ServiceCacheListener#cacheChanged method
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2025-01-21

jira-importer avatar Jun 07 '18 09:06 jira-importer

randgalt:

You need to know what instances have changed? The ServiceCacheListener interface would need to change or we'd have to add a new type of listener for that. Please provide a PR with the new functionality so that we can review it.

jira-importer avatar Jun 07 '18 13:06 jira-importer

githubbot:

GitHub user JerryChin opened a pull request:

https://github.com/apache/curator/pull/265

Add new service cache listener to let users know what instances have …

This PR is for issue CURATOR-470(https://issues.apache.org/jira/projects/CURATOR/issues/CURATOR-470).

A new interface (`ServiceCacheEventListener`) is introduced to expose changed instances, while preserving backward compatibility.

Unit test has updated as well.

@Randgalt Please help to review it, thanks.

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

$ git pull https://github.com/JerryChin/curator CURATOR-470

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

https://github.com/apache/curator/pull/265.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 #265


commit 88e8d9a15d4f1690a6df1c1cabb355936f327aaa
Author: Qin Meijie
Date: 2018-06-08T05:06:15Z

Add new service cache listener to let users know what instances have changed, while preserving backward compatibility.


jira-importer avatar Jun 08 '18 05:06 jira-importer

githubbot:

GitHub user Randgalt opened a pull request:

https://github.com/apache/curator/pull/268

CURATOR-470 Add new service cache listener to let users know what instances have changed

Built off of #265

> A new interface (ServiceCacheEventListener) is introduced to expose changed instances, while preserving backward compatibility.

> Unit test has updated as well.

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

$ git pull https://github.com/apache/curator CURATOR-470

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

https://github.com/apache/curator/pull/268.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 #268


commit 88e8d9a15d4f1690a6df1c1cabb355936f327aaa
Author: Qin Meijie
Date: 2018-06-08T05:06:15Z

Add new service cache listener to let users know what instances have changed, while preserving backward compatibility.

commit 6b1522c5f2892451be45df89e6537799f146ab51
Author: randgalt
Date: 2018-06-24T14:26:35Z

Merge branch 'CURATOR-470' of github.com:JerryChin/curator into CURATOR-470

commit 2ebd456930d5970380d68af9c6b7150a2cf24abf
Author: randgalt
Date: 2018-06-24T15:21:04Z

wip

commit c0c0ecad59af4ca20c277790bb0e877cfb3fb5bd
Author: randgalt
Date: 2018-06-24T15:48:36Z

CURATOR-470

Introduces an alternate cache listener, ServiceCacheEventListener, that gives more detail about changes to the cache as opposed to the original version which merely denotes a change.


jira-importer avatar Jun 24 '18 15:06 jira-importer

githubbot:

Github user asfgit closed the pull request at:

https://github.com/apache/curator/pull/265

jira-importer avatar Jun 24 '18 15:06 jira-importer