applyToNodes() is superfluous now that we have getNodeObjects().

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5869 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2009-07-13 00:59:32 +00:00
parent 047dd3b871
commit 231edfa66e
3 changed files with 13 additions and 30 deletions
@@ -114,15 +114,12 @@ public class EHCachePeerCoordinator extends CacheManagerPeerProviderFactory
// list the current whirled peers
final List<CachePeer> result = Lists.newArrayList();
final Set<String> nodes = Sets.newHashSet();
_peerMan.applyToNodes(new Function<NodeObject, Void>() {
public Void apply (NodeObject node) {
if (node != _peerMan.getNodeObject()) {
addCachesForNode(result, node.nodeName);
nodes.add(node.nodeName);
}
return null;
for (NodeObject node : _peerMan.getNodeObjects()) {
if (node != _peerMan.getNodeObject()) {
addCachesForNode(result, node.nodeName);
nodes.add(node.nodeName);
}
});
}
// if any previously known peer is no longer with us, clear out the cache
Set<Tuple<String, String>> toRemove = Sets.newHashSet();
@@ -323,16 +323,6 @@ public abstract class PeerManager
return null;
}
/**
* Applies the supplied function to all {@link NodeObject}s. The operation should not modify
* the objects unless you really know what you're doing. More likely it will summarize
* information contained therein.
*/
public <T> Iterable<T> applyToNodes (Function<NodeObject,T> op)
{
return Iterables.transform(getNodeObjects(), op);
}
/**
* Invokes the supplied function on <em>all</em> node objects (except the local node). A caller
* that needs to call an invocation service method on a remote node should use this mechanism