public class ReparingListPropertyCommandExecutor extends Object implements ListPropertyCommandExecutor
Incoming remote commands need to be repaired if other changes where made on the local list. This class initiates repairing of these command before executing them. Remote commands that do not need repair are executed directly.
When a remote command appears while unconfirmed local commands exists, other peers will drop all these local commands. They therefore have to be repaired as well to be based on the list version the remote command produced and re-send to the other peers.
A local command gets confirmed when it is the same as a received remote command and if it is the oldest unconfirmed command.
| Constructor and Description |
|---|
ReparingListPropertyCommandExecutor(ListPropertyMetaDataStore listMetaDataStore,
ListCommandIndexRepairer indexRepairer,
ListCommandVersionRepairer versionRepairer,
SimpleListPropertyCommandExecutor simpleExecutor,
TopologyLayerCallback topologyLayerCallback)
Initializes an instance with all its dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(AddToList command)
Executes an command that was received from an other peer if appropriate.
|
void |
execute(RemoveFromList command)
Executes an command that was received from an other peer if appropriate.
|
void |
execute(ReplaceInList command)
Executes an command that was received from an other peer if appropriate.
|
void |
logLocalCommand(ListCommand localCommand)
Logs a command that was locally generated and send to other peers.
|
public ReparingListPropertyCommandExecutor(ListPropertyMetaDataStore listMetaDataStore, ListCommandIndexRepairer indexRepairer, ListCommandVersionRepairer versionRepairer, SimpleListPropertyCommandExecutor simpleExecutor, TopologyLayerCallback topologyLayerCallback)
listMetaDataStore - Used to read and update versions of Lists.indexRepairer - Used to repair the indices of remote and local commands.versionRepairer - Used to repair the version of remote and local commands.simpleExecutor - Used to execute changes on Lists.topologyLayerCallback - Used to re-send repaired local commands.public void execute(AddToList command)
ListPropertyCommandExecutorexecute in interface ListPropertyCommandExecutorcommand - The received command.public void execute(RemoveFromList command)
ListPropertyCommandExecutorexecute in interface ListPropertyCommandExecutorcommand - The received command.public void execute(ReplaceInList command)
ListPropertyCommandExecutorexecute in interface ListPropertyCommandExecutorcommand - The received command.public void logLocalCommand(ListCommand localCommand)
localCommand - The command to logCopyright © 2016 Saxonia Systems AG. All Rights Reserved.