| This component advertises the
EnsureIsFoundService , which
allows servers to ensures that their peers are reachable.
This implementation maintains the
Set of ensured names
and, if non-empty, continually polls (non-blocking) the
local
WhitePagesService to make sure the
WhitePagesService.getAll(Stringlong) s return non-empty data,
otherwise it starts the
BootstrapService until the
data is found.
This is slightly inefficient for a couple reasons:
-
We're polling our cache even if the names are not necessary at all
times (e.g. the MTS is still using the data if found a long time
ago)
-
We're restarting the full bootstrap instead of indicating which
specific name(s) we're looking for (e.g. a discoverer just for
agent "A" can't help us find agent "B").
-
We wait until the next poll cycle to stop our search instead
of stopping when the cache finds the data.
However, this code only runs on nodes containing servers, and
the data is typically in the cache, so this shouldn't be a real
problem.
|