public class PeerProxyMap<PROXY extends Closeable> extends Object implements RaftPeer.Add, Closeable
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
PeerProxyMap(String name) |
PeerProxyMap(String name,
CheckedFunction<RaftPeer,PROXY,IOException> createProxy) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRaftPeers(Collection<RaftPeer> newPeers)
Add the given peers.
|
void |
close() |
CheckedSupplier<PROXY,IOException> |
computeIfAbsent(RaftPeer peer)
This method is similar to
Map.computeIfAbsent(Object, java.util.function.Function)
except that this method does not require a mapping function. |
PROXY |
createProxyImpl(RaftPeer peer) |
String |
getName() |
PROXY |
getProxy(RaftPeerId id) |
boolean |
handleException(RaftPeerId serverId,
Throwable e,
boolean reconnect) |
void |
resetProxy(RaftPeerId id) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddRaftPeerspublic PeerProxyMap(String name, CheckedFunction<RaftPeer,PROXY,IOException> createProxy)
public PeerProxyMap(String name)
public String getName()
public PROXY getProxy(RaftPeerId id) throws IOException
IOExceptionpublic void addRaftPeers(Collection<RaftPeer> newPeers)
RaftPeer.AddaddRaftPeers in interface RaftPeer.Addpublic CheckedSupplier<PROXY,IOException> computeIfAbsent(RaftPeer peer)
Map.computeIfAbsent(Object, java.util.function.Function)
except that this method does not require a mapping function.peer - the peer for retrieving/building a proxy.public void resetProxy(RaftPeerId id)
public boolean handleException(RaftPeerId serverId, Throwable e, boolean reconnect)
public PROXY createProxyImpl(RaftPeer peer) throws IOException
IOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2017–2022 The Apache Software Foundation. All rights reserved.