public class ReplicationExecutor extends Object implements ResponsibilityListener, Runnable
| Modifier and Type | Class and Description |
|---|---|
static class |
ReplicationExecutor.DefaultReplicationSender |
| Constructor and Description |
|---|
ReplicationExecutor(Peer peer,
ReplicationFactor replicationFactor,
ReplicationSender replicationSender,
Random random,
ScheduledExecutorService timer,
int delayMillis)
Constructor for the default indirect replication.
|
| Modifier and Type | Method and Description |
|---|---|
void |
init(int intervalMillis) |
void |
meResponsible(Number160 locationKey)
The responsibilty changed to our peer.
|
void |
otherResponsible(Number160 locationKey,
PeerAddress other,
boolean delayed)
Here an other peer is responsible and we need to transfer data.
|
void |
run() |
protected List<PeerAddress> |
send(Number160 locationKey,
Map<Number640,Data> dataMapConverted)
If my peer is responsible, I'll issue a put if absent to make sure all replicas are stored.
|
void |
shutdown() |
public ReplicationExecutor(Peer peer, ReplicationFactor replicationFactor, ReplicationSender replicationSender, Random random, ScheduledExecutorService timer, int delayMillis)
peer - The peerpublic void init(int intervalMillis)
public void otherResponsible(Number160 locationKey, PeerAddress other, boolean delayed)
ResponsibilityListenerotherResponsible in interface ResponsibilityListenerlocationKey - The location keyother - The other peer that is responsible for locationKeydelayed - Indicates if the other peer should get notified immediately or delayed. The case for delayed is that
multiple non responsible peers may call this and a delayed call in that case may be better.public void meResponsible(Number160 locationKey)
ResponsibilityListenermeResponsible in interface ResponsibilityListenerlocationKey - The location keyprotected List<PeerAddress> send(Number160 locationKey, Map<Number640,Data> dataMapConverted)
locationKey - The location keydomainKey - The domain keydataMapConverted - The data to storepublic void shutdown()
Copyright © 2014. All rights reserved.