public class TrackerStorage extends Object implements PeerStatusListener, Digest, ReplicationStorage
| Modifier and Type | Class and Description |
|---|---|
static class |
TrackerStorage.ReferrerType |
PeerStatusListener.FailReason| Modifier and Type | Field and Description |
|---|---|
static int |
TRACKER_CACHE_SIZE |
static int |
TRACKER_SIZE |
| Constructor and Description |
|---|
TrackerStorage(IdentityManagement identityManagement,
int trackerTimoutSeconds,
Replication replication,
Maintenance maintenance) |
| Modifier and Type | Method and Description |
|---|---|
TrackerData |
activePeers(Number160 locationKey,
Number160 domainKey) |
void |
addActive(Number160 locationKey,
Number160 domainKey,
PeerAddress remotePeer,
Data attachement) |
DigestInfo |
digest(Number160 locationKey,
Number160 domainKey,
Number160 contentKey) |
DigestInfo |
digest(Number320 key,
SimpleBloomFilter<Number160> keyBloomFilter,
SimpleBloomFilter<Number160> contentBloomFilter)
Calculates a digest over a specific location and domain.
|
DigestInfo |
digest(Number640 from,
Number640 to)
Calculates a digest over a specific location and domain.
|
Collection<Number160> |
findContentForResponsiblePeerID(Number160 peerID) |
Number160 |
findPeerIDForResponsibleContent(Number160 locationKey) |
int |
getPrimanyFactor() |
int |
getSecondaryFactor() |
int |
getTrackerTimoutSeconds() |
boolean |
isFillPrimaryStorageFast() |
boolean |
isSecondaryTracker(Number160 locationKey,
Number160 domainKey)
A peer is a secondary tracker if the peers stores itself on the tracker as well.
|
TrackerData |
meshPeers(Number160 locationKey,
Number160 domainKey) |
boolean |
moveFromSecondaryToMesh(PeerAddress peerAddress,
PeerAddress referrer,
Number160 locationKey,
Number160 domainKey,
PublicKey publicKey) |
boolean |
peerFailed(PeerAddress remotePeer,
PeerStatusListener.FailReason reason)
Called if the peer does not send answer in time.
|
boolean |
peerFound(PeerAddress remotePeer,
PeerAddress referrer)
Called if the peer is online and who reported it.
|
boolean |
put(Number160 locationKey,
Number160 domainKey,
PeerAddress peerAddress,
PublicKey publicKey,
Data attachement) |
boolean |
putReferred(Number160 locationKey,
Number160 domainKey,
PeerAddress peerAddress,
PeerAddress referrer,
Data attachement,
TrackerStorage.ReferrerType type) |
boolean |
removeActive(Number160 locationKey,
Number160 domainKey,
Number160 remotePeerId) |
void |
removeReferred(Number160 locationKey,
Number160 domainKey,
Number160 key,
PeerAddress referrer) |
void |
removeResponsibility(Number160 locationKey) |
Collection<Number160> |
responsibleDomains(Number160 locationKey) |
TrackerData |
secondaryPeers(Number160 locationKey,
Number160 domainKey) |
void |
setFillPrimaryStorageFast(boolean fillPrimaryStorageFast) |
void |
setPrimanyFactor(int primanyFactor) |
void |
setSecondaryFactor(int secondaryFactor) |
int |
sizePrimary(Number160 locationKey,
Number160 domainKey) |
int |
sizeSecondary(Number160 locationKey,
Number160 domainKey) |
boolean |
updateResponsibilities(Number160 locationKey,
Number160 peerId) |
public static final int TRACKER_SIZE
public static final int TRACKER_CACHE_SIZE
public TrackerStorage(IdentityManagement identityManagement, int trackerTimoutSeconds, Replication replication, Maintenance maintenance)
public TrackerData activePeers(Number160 locationKey, Number160 domainKey)
public TrackerData meshPeers(Number160 locationKey, Number160 domainKey)
public TrackerData secondaryPeers(Number160 locationKey, Number160 domainKey)
public void addActive(Number160 locationKey, Number160 domainKey, PeerAddress remotePeer, Data attachement)
public boolean removeActive(Number160 locationKey, Number160 domainKey, Number160 remotePeerId)
public boolean put(Number160 locationKey, Number160 domainKey, PeerAddress peerAddress, PublicKey publicKey, Data attachement)
public boolean putReferred(Number160 locationKey, Number160 domainKey, PeerAddress peerAddress, PeerAddress referrer, Data attachement, TrackerStorage.ReferrerType type)
public boolean moveFromSecondaryToMesh(PeerAddress peerAddress, PeerAddress referrer, Number160 locationKey, Number160 domainKey, PublicKey publicKey)
public void setSecondaryFactor(int secondaryFactor)
public int getSecondaryFactor()
public void setPrimanyFactor(int primanyFactor)
public int getPrimanyFactor()
public boolean peerFailed(PeerAddress remotePeer, PeerStatusListener.FailReason reason)
PeerStatusListenerpeerFailed in interface PeerStatusListenerremotePeer - The address of the peer that failedpublic boolean peerFound(PeerAddress remotePeer, PeerAddress referrer)
PeerStatusListenerpeerFound in interface PeerStatusListenerremotePeer - The address of the peer that is online.referrer - the peer that reported the availability of peerAddresspublic DigestInfo digest(Number160 locationKey, Number160 domainKey, Number160 contentKey)
public void removeReferred(Number160 locationKey, Number160 domainKey, Number160 key, PeerAddress referrer)
public void setFillPrimaryStorageFast(boolean fillPrimaryStorageFast)
public boolean isFillPrimaryStorageFast()
public int getTrackerTimoutSeconds()
public boolean isSecondaryTracker(Number160 locationKey, Number160 domainKey)
locationKey - domainKey - public Collection<Number160> responsibleDomains(Number160 locationKey)
public Number160 findPeerIDForResponsibleContent(Number160 locationKey)
findPeerIDForResponsibleContent in interface ReplicationStoragepublic Collection<Number160> findContentForResponsiblePeerID(Number160 peerID)
findContentForResponsiblePeerID in interface ReplicationStoragepublic boolean updateResponsibilities(Number160 locationKey, Number160 peerId)
updateResponsibilities in interface ReplicationStoragepublic void removeResponsibility(Number160 locationKey)
removeResponsibility in interface ReplicationStoragepublic DigestInfo digest(Number640 from, Number640 to)
Digestpublic DigestInfo digest(Number320 key, SimpleBloomFilter<Number160> keyBloomFilter, SimpleBloomFilter<Number160> contentBloomFilter)
Digestdigest in interface Digestkey - The location and domain keykeyBloomFilter - The bloomFilter of those key elements we want the digest. Please not that there might be false
positive, e.g., a Number160 that is included in the digest but not stored on disk/memory.contentBloomFilter - The bloomFilter of those data elements we want the digest. Please not that there might be false
positive, e.g., a Number160 that is included in the digest but not stored on disk/memory.Copyright © 2014. All rights reserved.