You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vyacheslav Koptilin (Jira)" <ji...@apache.org> on 2025/02/20 09:31:00 UTC
[jira] [Created] (IGNITE-24573) Introduce a new common interface for raft command handlers
Vyacheslav Koptilin created IGNITE-24573:
--------------------------------------------
Summary: Introduce a new common interface for raft command handlers
Key: IGNITE-24573
URL: https://issues.apache.org/jira/browse/IGNITE-24573
Project: Ignite
Issue Type: Improvement
Environment: It is worth introducing a common interface for raft command handlers used by `PartitionListener` and `ZonePartitionListener` classes.
That will allow us to remove the following ugly code:
{noformat}
if (command instanceof UpdateCommand) {
result = handleUpdateCommand((UpdateCommand) command, commandIndex, commandTerm, safeTimestamp);
} else if (command instanceof UpdateAllCommand) {
result = handleUpdateAllCommand((UpdateAllCommand) command, commandIndex, commandTerm, safeTimestamp);
} else if (command instanceof FinishTxCommand) {
result = finishTxCommandHandler.handle((FinishTxCommand) command, commandIndex, commandTerm);
} else if (command instanceof WriteIntentSwitchCommand) {
result = handleWriteIntentSwitchCommand((WriteIntentSwitchCommand) command, commandIndex, commandTerm);
} else if (command instanceof SafeTimeSyncCommand) {
result = handleSafeTimeSyncCommand((SafeTimeSyncCommand) command, commandIndex, commandTerm);
} else if (command instanceof BuildIndexCommand) {
result = handleBuildIndexCommand((BuildIndexCommand) command, commandIndex, commandTerm);
} else if (command instanceof PrimaryReplicaChangeCommand) {
result = handlePrimaryReplicaChangeCommand((PrimaryReplicaChangeCommand) command, commandIndex, commandTerm);
} else if (command instanceof VacuumTxStatesCommand) {
result = handleVacuumTxStatesCommand((VacuumTxStatesCommand) command, commandIndex, commandTerm);
} else if (command instanceof UpdateMinimumActiveTxBeginTimeCommand) {
result = minimumActiveTxTimeCommandHandler.handle((UpdateMinimumActiveTxBeginTimeCommand) command, commandIndex);
} else {
throw new AssertionError("Unknown command type [command=" + command.toStringForLightLogging() + ']');
}
{noformat}
Reporter: Vyacheslav Koptilin
Assignee: Vyacheslav Koptilin
--
This message was sent by Atlassian Jira
(v8.20.10#820010)