Skip to content

Commit e5eeb03

Browse files
improve document
1 parent 90daef3 commit e5eeb03

File tree

4 files changed

+258
-299
lines changed

4 files changed

+258
-299
lines changed
Lines changed: 0 additions & 249 deletions
Original file line numberDiff line numberDiff line change
@@ -406,252 +406,3 @@ WITH (
406406
- Only continuous refresh mode is supported
407407
- Schema is automatically derived from the query
408408
- Materialized tables are stored as regular Fluss tables with special metadata
409-
410-
## Procedures
411-
412-
Fluss provides stored procedures to perform administrative and management operations through Flink SQL. All procedures are located in the `sys` namespace and can be invoked using the `CALL` statement.
413-
414-
### Available Procedures
415-
416-
You can list all available procedures using:
417-
418-
```sql title="Flink SQL"
419-
SHOW PROCEDURES;
420-
```
421-
422-
### Access Control Procedures
423-
424-
Fluss provides procedures to manage Access Control Lists (ACLs) for security and authorization.
425-
426-
#### add_acl
427-
428-
Add an ACL entry to grant permissions to a principal.
429-
430-
**Syntax:**
431-
432-
```sql
433-
CALL [catalog_name.]sys.add_acl(
434-
resource => 'STRING',
435-
permission => 'STRING',
436-
principal => 'STRING',
437-
operation => 'STRING',
438-
host => 'STRING' -- optional, defaults to '*'
439-
)
440-
```
441-
442-
**Parameters:**
443-
444-
- `resource` (required): The resource to grant permissions on. Can be `'CLUSTER'` for cluster-level permissions or a specific resource name (e.g., database or table name).
445-
- `permission` (required): The permission type to grant. Valid values are `'ALLOW'` or `'DENY'`.
446-
- `principal` (required): The principal to grant permissions to, in the format `'Type:Name'` (e.g., `'User:Alice'`).
447-
- `operation` (required): The operation type to grant. Valid values include `'READ'`, `'WRITE'`, `'CREATE'`, `'DELETE'`, `'ALTER'`, `'DESCRIBE'`, `'CLUSTER_ACTION'`, `'IDEMPOTENT_WRITE'`.
448-
- `host` (optional): The host from which the principal can access the resource. Defaults to `'*'` (all hosts).
449-
450-
**Example:**
451-
452-
```sql title="Flink SQL"
453-
-- Use the Fluss catalog (replace 'fluss_catalog' with your catalog name if different)
454-
USE fluss_catalog;
455-
456-
-- Grant read permission to user Alice from any host
457-
CALL sys.add_acl(
458-
resource => 'CLUSTER',
459-
permission => 'ALLOW',
460-
principal => 'User:Alice',
461-
operation => 'READ',
462-
host => '*'
463-
);
464-
465-
-- Grant write permission to user Bob from a specific host
466-
CALL sys.add_acl(
467-
resource => 'my_database.my_table',
468-
permission => 'ALLOW',
469-
principal => 'User:Bob',
470-
operation => 'WRITE',
471-
host => '192.168.1.100'
472-
);
473-
```
474-
475-
#### drop_acl
476-
477-
Remove an ACL entry to revoke permissions.
478-
479-
**Syntax:**
480-
481-
```sql
482-
CALL [catalog_name.]sys.drop_acl(
483-
resource => 'STRING',
484-
permission => 'STRING',
485-
principal => 'STRING',
486-
operation => 'STRING',
487-
host => 'STRING' -- optional, defaults to '*'
488-
)
489-
```
490-
491-
**Parameters:**
492-
493-
All parameters accept the same values as `add_acl`. You can use `'ANY'` as a wildcard value to match multiple entries for batch deletion.
494-
495-
**Example:**
496-
497-
```sql title="Flink SQL"
498-
-- Use the Fluss catalog (replace 'fluss_catalog' with your catalog name if different)
499-
USE fluss_catalog;
500-
501-
-- Remove a specific ACL entry
502-
CALL sys.drop_acl(
503-
resource => 'CLUSTER',
504-
permission => 'ALLOW',
505-
principal => 'User:Alice',
506-
operation => 'READ',
507-
host => '*'
508-
);
509-
510-
-- Remove all ACL entries for a specific user
511-
CALL sys.drop_acl(
512-
resource => 'ANY',
513-
permission => 'ANY',
514-
principal => 'User:Alice',
515-
operation => 'ANY',
516-
host => 'ANY'
517-
);
518-
```
519-
520-
#### list_acl
521-
522-
List ACL entries matching the specified filters.
523-
524-
**Syntax:**
525-
526-
```sql
527-
CALL [catalog_name.]sys.list_acl(
528-
resource => 'STRING',
529-
permission => 'STRING', -- optional, defaults to 'ANY'
530-
principal => 'STRING', -- optional, defaults to 'ANY'
531-
operation => 'STRING', -- optional, defaults to 'ANY'
532-
host => 'STRING' -- optional, defaults to 'ANY'
533-
)
534-
```
535-
536-
**Parameters:**
537-
538-
All parameters accept the same values as `add_acl`. Use `'ANY'` as a wildcard to match all values for that parameter.
539-
540-
**Returns:** An array of strings, each representing an ACL entry in the format: `resource="...";permission="...";principal="...";operation="...";host="..."`
541-
542-
**Example:**
543-
544-
```sql title="Flink SQL"
545-
-- Use the Fluss catalog (replace 'fluss_catalog' with your catalog name if different)
546-
USE fluss_catalog;
547-
548-
-- List all ACL entries
549-
CALL sys.list_acl(resource => 'ANY');
550-
551-
-- List all ACL entries for a specific user
552-
CALL sys.list_acl(
553-
resource => 'ANY',
554-
principal => 'User:Alice'
555-
);
556-
557-
-- List all read permissions
558-
CALL sys.list_acl(
559-
resource => 'ANY',
560-
operation => 'READ'
561-
);
562-
```
563-
564-
### Cluster Configuration Procedures
565-
566-
Fluss provides procedures to dynamically manage cluster configurations without requiring a server restart.
567-
568-
#### get_cluster_config
569-
570-
Retrieve cluster configuration values.
571-
572-
**Syntax:**
573-
574-
```sql
575-
-- Get a specific configuration
576-
CALL [catalog_name.]sys.get_cluster_config(config_key => 'STRING')
577-
578-
-- Get all cluster configurations
579-
CALL [catalog_name.]sys.get_cluster_config()
580-
```
581-
582-
**Parameters:**
583-
584-
- `config_key` (optional): The configuration key to retrieve. If omitted, returns all cluster configurations.
585-
586-
**Returns:** A table with columns:
587-
- `config_key`: The configuration key name
588-
- `config_value`: The current value
589-
- `config_source`: The source of the configuration (e.g., `DYNAMIC_CONFIG`, `STATIC_CONFIG`)
590-
591-
**Example:**
592-
593-
```sql title="Flink SQL"
594-
-- Use the Fluss catalog (replace 'fluss_catalog' with your catalog name if different)
595-
USE fluss_catalog;
596-
597-
-- Get a specific configuration
598-
CALL sys.get_cluster_config(
599-
config_key => 'kv.rocksdb.shared-rate-limiter.bytes-per-sec'
600-
);
601-
602-
-- Get all cluster configurations
603-
CALL sys.get_cluster_config();
604-
```
605-
606-
#### set_cluster_config
607-
608-
Set or delete a cluster configuration dynamically.
609-
610-
**Syntax:**
611-
612-
```sql
613-
-- Set a configuration value
614-
CALL [catalog_name.]sys.set_cluster_config(
615-
config_key => 'STRING',
616-
config_value => 'STRING'
617-
)
618-
619-
-- Delete a configuration (reset to default)
620-
CALL [catalog_name.]sys.set_cluster_config(config_key => 'STRING')
621-
```
622-
623-
**Parameters:**
624-
625-
- `config_key` (required): The configuration key to modify.
626-
- `config_value` (optional): The new value to set. If omitted or empty, the configuration is deleted (reset to default).
627-
628-
**Important Notes:**
629-
630-
- Changes are validated before being applied and persisted in ZooKeeper
631-
- Changes are automatically applied to all servers (Coordinator and TabletServers)
632-
- Changes survive server restarts
633-
- Not all configurations support dynamic changes. The server will reject invalid modifications
634-
635-
**Example:**
636-
637-
```sql title="Flink SQL"
638-
-- Use the Fluss catalog (replace 'fluss_catalog' with your catalog name if different)
639-
USE fluss_catalog;
640-
641-
-- Set RocksDB rate limiter
642-
CALL sys.set_cluster_config(
643-
config_key => 'kv.rocksdb.shared-rate-limiter.bytes-per-sec',
644-
config_value => '200MB'
645-
);
646-
647-
-- Set datalake format
648-
CALL sys.set_cluster_config(
649-
config_key => 'datalake.format',
650-
config_value => 'paimon'
651-
);
652-
653-
-- Delete a configuration (reset to default)
654-
CALL sys.set_cluster_config(
655-
config_key => 'kv.rocksdb.shared-rate-limiter.bytes-per-sec'
656-
);
657-
```

0 commit comments

Comments
 (0)