问题
The documentation for Curator (http://curator.apache.org/curator-x-discovery/index.html) says:
If a particular instance has an I/O error, etc. you should call ServiceProvider.noteError() passing in the instance.
I am using a ServiceCache
to get my instances, rather than a ServiceProvider
(see Using selection strategies with a cache in Curator).
Where can I find the noteError()
method here? I can't find it on the cache object
回答1:
There is no noteError()
on a ServiceCache, however as @Randgalt notes (https://stackoverflow.com/a/57059811/2048051) the best way is to not use a ServiceCache
but rather just use ServiceProvider
, because in the background that uses a cache anyway, and it has the noteError()
method available.
https://issues.apache.org/jira/browse/CURATOR-531 has been raised to make the documentation clearer
来源:https://stackoverflow.com/questions/57058817/notifying-an-instance-as-down-using-a-servicecache-in-curator