classResourceGroupRule
final class ResourceGroupRule
Lowers the resource group statements (8.0+).
Rule: MYSQL-ACCOUNT-RESOURCE-GROUP-001. Scope: create_resource_group_stmt, alter_resource_group_stmt, drop_resource_group_stmt, set_resource_group_stmt, resource_group_types, opt_resource_group_vcpu_list, vcpu_range_spec_list, vcpu_num_or_range, opt_resource_group_priority, signed_num, opt_resource_group_enable_disable, opt_force, thread_id_list, thread_id_list_options. Numbers keep their exact text; the optional = and commas carry no meaning. Constructs: CreateResourceGroup, AlterResourceGroup, DropResourceGroup, SetResourceGroup, CpuRange, ThreadPriority. Terminates: the lists are flattened iteratively; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/resource-groups.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a resource group statement.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 11
- method-call ResourceGroupRule::create() line 59
- new AlterResourceGroup line 60
- method-call Form::node() line 61
- method-call ResourceGroupRule::cpus() line 62
- method-call ResourceGroupRule::priority() line 63
- method-call ResourceGroupRule::enabled() line 64
- method-call ResourceGroupRule::force() line 65
- new DropResourceGroup line 67
- new SetResourceGroup line 68
- method-call ResourceGroupRule::threads() line 69
- static-call ImplementationGap::production() line 70
public function create(Form $form): CreateResourceGroupLowers CREATE RESOURCE GROUP.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 9
- method-call Form::node() line 81
- method-call Lowering::form() line 83
- class-const ResourceGroupKind::User() line 85
- class-const ResourceGroupKind::System() line 86
- static-call ImplementationGap::production() line 87
- new CreateResourceGroup line 90
- method-call ResourceGroupRule::cpus() line 90
- method-call ResourceGroupRule::priority() line 90
- method-call ResourceGroupRule::enabled() line 90
Lowers an opt_resource_group_vcpu_list; an absent option is empty.
Parameters
$option | Node |
Returns
list<CpuRange>Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:62
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::create() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:90
Calls 6
- method-call Lowering::form() line 101
- static-call ImplementationGap::production() line 106
- method-call ResourceGroupRule::claimed() line 110
- method-call Lists::items() line 112
- new Lists line 112
- method-call ResourceGroupRule::range() line 117
Lowers a vcpu_num_or_range.
Parameters
$range | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 130
- new CpuRange line 133
- method-call ResourceGroupRule::number() line 133
- static-call ImplementationGap::production() line 135
public function priority(Node $option): ?ThreadPriorityLowers an opt_resource_group_priority; an absent option is null.
Parameters
$option | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:63
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::create() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:90
Calls 4
- method-call Lowering::form() line 146
- static-call ImplementationGap::production() line 151
- new ThreadPriority line 157
- method-call ResourceGroupRule::number() line 157
public function enabled(Node $option): ?boolLowers an opt_resource_group_enable_disable: true for ENABLE, false for DISABLE, null when absent.
Parameters
$option | Node |
Returns
?boolThrows
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:64
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::create() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:90
Calls 2
- method-call Lowering::form() line 170
- static-call ImplementationGap::production() line 176
public function force(Node $option): boolLowers an opt_force.
Parameters
$option | Node |
Returns
boolThrows
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:65
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:67
Calls 2
- method-call Lowering::form() line 187
- static-call ImplementationGap::production() line 192
Lowers the thread ids of SET RESOURCE GROUP … FOR.
Parameters
$options | Node |
Returns
list<Numeral>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call ResourceGroupRule::claimed() line 204
- method-call Lowering::form() line 205
- method-call Lists::items() line 208
- new Lists line 208
Lowers the number token at a position.
Parameters
$form | Form | |
$position | int |
Returns
Called from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::range() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:133
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::range() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:134
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::priority() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:157
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::priority() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:158
Calls 1
- method-call Form::token() line 224
public function claimed(Node $node, list<string> $signatures): voidConfirms that a node is one of the given productions.
Parameters
$node | Node | |
$signatures | list<string> |
Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::cpus() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:110
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::threads() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:204
- method-call SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule::threads() packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:206
Calls 3
- method-call Lowering::form() line 235
- function-call
in_arrayline 236 - static-call ImplementationGap::production() line 237
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ResourceGroupRuleTestcalls