classCreateResourceGroup
final class CreateResourceGroup
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.CREATE RESOURCE GROUP name TYPE = USER|SYSTEM [VCPU = …] [THREAD_PRIORITY = n] [ENABLE|DISABLE] (8.0+).
Mirrors PT_create_resource_group. Rule: MYSQL-RESOURCE-GROUP-001. A priority outside -20 to 0 for a system group or 0 to 19 for a user group is PriorityOutOfRange. The = signs are optional words. Source: https://dev.mysql.com/doc/refman/8.4/en/create-resource-group.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('create resource group batch type user vcpu 2-3 thread_priority 10 disable')->toString() // => 'CREATE RESOURCE GROUP batch TYPE = USER VCPU = 2 - 3 THREAD_PRIORITY = 10 DISABLE'Properties§
public list<CpuRange> $cpuspublic Name $namepublic ResourceGroupKind $kindpublic ThreadPriority|null $priority = nullpublic bool|null $enabled = nullMethods§
public function __construct(
public Name $name,
public ResourceGroupKind $kind,
list<CpuRange> $cpus = [],
public ThreadPriority|null $priority = null,
public bool|null $enabled = null,
)Parameters
$name | Name | The group name |
$kind | ResourceGroupKind | The group type |
$cpus | list<CpuRange> | The CPUs of VCPU; none when the option is absent |
$priority | ThreadPriority|null | The THREAD_PRIORITY, when written |
$enabled | bool|null | ENABLE (true) or DISABLE (false), when written |
Calls 2
- static-call Check::listOf() line 47
- class-const CpuRange::class() line 47
public function deriveStatement(Derivation $derivation): voidReports a priority outside the range of the group's type.
Parameters
$derivation | Derivation |
Calls 6
- method-call NumberChecks::value() line 58
- new NumberChecks line 58
- class-const ResourceGroupKind::System() line 60
- method-call NumberChecks::compare() line 61
- method-call Derivation::report() line 64
- new PriorityOutOfRange line 64
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 73
- class-const NameUse::Label() line 73
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateResourceGroupTestcalls