Skip to content

Command Tasks

These are sub-tasks that command planners can produce and wrap into either a SequentialExecutor or a ParallelExecutor implementations.

amsdal_glue.tasks.SchemaCommandTask dataclass

Bases: Task

SchemaCommandTask is responsible for executing schema command tasks. It extends the Task class.

Attributes:

Name Type Description
command_node SchemaCommandNode

The schema command node to be executed.

execute

execute(transaction_id, lock_id)

Executes the schema command task.

Parameters:

Name Type Description Default
transaction_id str | None

The ID of the transaction.

required
lock_id str | None

The ID of the lock.

required

item property

item

Returns the schema command.

Returns:

Name Type Description
Any Any

The schema command.

result property

result

Returns the result of the schema command.

Returns:

Type Description
list[Any] | None

list[Any] | None: The result of the schema command.

amsdal_glue.tasks.FinalSchemaCommandTask dataclass

Bases: Task

FinalSchemaCommandTask processes and aggregates the results of previously executed tasks. It extends the Task class.

Attributes:

Name Type Description
tasks list[SchemaCommandTask]

The list of schema command tasks to be executed.

execute

execute(transaction_id, lock_id)

Runs aggregation of the results of the schema command tasks.

Parameters:

Name Type Description Default
transaction_id str | None

The ID of the transaction.

required
lock_id str | None

The ID of the lock.

required

item property

item

Returns the list of schema command items.

Returns:

Name Type Description
Any Any

The list of schema command items.

result property

result

Returns the result of the schema command tasks.

Returns:

Type Description
list[Any] | None

list[Any] | None: The result of the schema command tasks.

amsdal_glue.tasks.DataMutationTask dataclass

Bases: Task

DataMutationTask is responsible for executing data mutation tasks. It extends the Task class.

execute

execute(transaction_id, lock_id)

Executes the data mutation task.

Parameters:

Name Type Description Default
transaction_id str | None

The ID of the transaction.

required
lock_id str | None

The ID of the lock.

required

item property

item

Returns the data mutation node.

Returns:

Name Type Description
Any Any

The data mutation node.

result property

result

Returns the result of the data mutation.

Returns:

Name Type Description
Any Any

The result of the data mutation.

amsdal_glue.tasks.TransactionCommandTask dataclass

Bases: Task

TransactionCommandTask is responsible for executing transaction command tasks. It extends the Task class.

Attributes:

Name Type Description
transaction_command ExecutionTransactionCommandNode

The transaction command to be executed.

execute

execute(transaction_id, lock_id)

Executes the transaction command task.

Parameters:

Name Type Description Default
transaction_id str | None

The ID of the transaction.

required
lock_id str | None

The ID of the lock.

required

item property

item

Returns the transaction command.

Returns:

Name Type Description
Any Any

The transaction command.

result property

result

Returns the result of the transaction command.

Returns:

Name Type Description
Any Any

The result of the transaction command.

amsdal_glue.tasks.LockCommandTask dataclass

Bases: Task

LockCommandTask is responsible for executing lock command tasks. It extends the Task class.

Attributes:

Name Type Description
lock_command ExecutionLockCommand

The lock command to be executed.

execute

execute(transaction_id, lock_id)

Executes the lock command task.

Parameters:

Name Type Description Default
transaction_id str | None

The ID of the transaction.

required
lock_id str | None

The ID of the lock.

required

item property

item

Returns the lock command.

Returns:

Name Type Description
Any Any

The lock command.

result property

result

Returns the result of the lock command.

Returns:

Name Type Description
Any Any

The result of the lock command.