| Constructor and Description |
|---|
PeerMapConfiguration(Number160 self)
Constructor with reasonable defaults.
|
public PeerMapConfiguration(Number160 self)
self - The peer ID of this peerpublic Number160 self()
public int getVerifiedBagSize(int bag)
bag - The bit distance with 0 being the closest, 159 being the most distantpublic int[] getVerifiedBagSizes()
public PeerMapConfiguration setFixedVerifiedBagSizes(int fixedVerifiedBagSize)
fixedVerifiedBagSize - The size for each bag to be setpublic PeerMapConfiguration setDoublingVerifiedBagSizes()
public PeerMapConfiguration setBagSizesVerified(int[] bagSizesVerified)
bagSizesVerified - Array of length Number160.BITS, specifying the size
for each bag. bagSizesVerified[0] is the closest bag,
bagSizesVerified[159] is the most distant bag.public int getOverflowBagSize(int bag)
bag - The bit distance with 0 being the closest, 159 being the most distantpublic int[] getOverflowBagSizes()
public PeerMapConfiguration setFixedOverflowBagSizes(int fixedOverflowBagSize)
fixedOverflowBagSize - The size for each bag to be setpublic PeerMapConfiguration setDoublingOverflowBagSizes()
public PeerMapConfiguration setBagSizesOverflow(int[] bagSizesOverflow)
bagSizesOverflow - Array of length Number160.BITS, specifying the size
for each bag. bagSizesOverflow[0] is the closest bag,
bagSizesOverflow[159] is the most distant bag.public int offlineTimeout()
public PeerMapConfiguration offlineTimeout(int offlineTimeout)
offlineTimeout - The time a peer is considered offline in seconds. This is important, since we see that a peer is
offline and an other peer reports this peer, we don't want to add it into our map. Thus, there is a
map that keeps track of such peers. This also means that a fast reconnect is not possible and a peer
has to wait until the timeout to rejoinpublic int offlineCount()
public PeerMapConfiguration offlineCount(int offlineCount)
offlineCount - The number of times that the peer is not reachabel. After that the peer is considered offlinepublic Collection<PeerMapFilter> peerMapFilters()
public PeerMapConfiguration addMapPeerFilter(PeerMapFilter peerMapFilter)
peerMapFilter - This filter can be set to not accept certain peerspublic Maintenance maintenance()
public PeerMapConfiguration maintenance(Maintenance maintenance)
maintenance - The class that is responsible for maintenancepublic int shutdownTimeout()
public PeerMapConfiguration shutdownTimeout(int shutdownTimeout)
shutdownTimeout - The time a peer is considered offline (shutdown) in seconds. This is important, since we see that a peer is
offline and an other peer reports this peer, we don't want to add it into our map. Thus, there is a
map that keeps track of such peers. This also means that a fast reconnect is not possible and a peer
has to wait until the timeout to rejoinpublic int exceptionTimeout()
public PeerMapConfiguration exceptionTimeout(int exceptionTimeout)
exceptionTimeout - The time a peer is considered offline (exception) in seconds. This is important, since we see that a peer is
offline and an other peer reports this peer, we don't want to add it into our map. Thus, there is a
map that keeps track of such peers. This also means that a fast reconnect is not possible and a peer
has to wait until the timeout to rejoinpublic boolean isPeerVerification()
public PeerMapConfiguration peerNoVerification()
public PeerMapConfiguration peerVerification(boolean reerVerification)
public PeerStatisticComparator getPeerStatisticComparator()
public PeerMapConfiguration setPeerStatisticComparator(PeerStatisticComparator peerStatisticComparator)
Copyright © 2015. All rights reserved.