AngersZhuuuu commented on code in PR #2336:
URL: 
https://github.com/apache/incubator-celeborn/pull/2336#discussion_r1505231039


##########
docs/developers/configuration.md:
##########
@@ -0,0 +1,173 @@
+---
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+# Configuration
+Celeborn configuration is separated into static and dynamic configuration. 
Static configuration `CelebornConf` is specified in 
+default configuration file `$CELEBORN_HOME/conf/celeborn-defaults.conf`. 
Meanwhile, the dynamic configuration overrides 
+the static configuration at runtime of `Master` and `Worker`.
+
+## Dynamic Configuration
+Dynamic configuration is a type of configuration that can be changed 
dynamically at runtime as needed, which supports various 
+config levels including:
+
+- `SYSTEM`: The system configurations.
+- `TENANT`: The dynamic configurations of tenant id.
+- `TENANT_USER`: The dynamic configurations of tenant id and username.
+
+When applying dynamic configuration, the priority order of config levels is as 
follows: 
+
+- `SYSTEM` level configuration overrides the static configuration, which in 
turn overrides the configuration of `CelebornConf`. 
+When the system level configuration is missing, fallback to the static 
configuration of `CelebornConf`.
+- `TENANT` level configuration overrides `SYSTEM` level, which result in that 
a configuration of certain tenant id overrides the configuration at system 
level. 
+When the tenant level configuration is missing, fallback to the configuration 
at system level.
+- `TENANT_USER` level configuration overrides `TENANT` level, which result in 
a configuration of certain tenant id and username overrides the configuration 
at tenant level. 
+When the tenant user level configuration is missing, fallback to the 
configuration at tenant level.
+
+## Config Service
+Config service provides the configuration management service with local cache 
for the static and dynamic configuration. 
+Meanwhile, `ConfigService` is a pluggable service interface of which 
implementation is based on various store backend. 
+The store backend of `ConfigService` is configured with 
`celeborn.dynamicConfig.store.backend`, which supports filesystem 
+and database store backend at present. If the store backend is not provided, 
it means that config service is disabled. 
+
+### FileSystem Config Service
+Filesystem config service supports the configuration specified in the dynamic 
configuration file. The dynamic configuration 
+file is configured with `celeborn.quota.configuration.path`, of which default 
path is `$CELEBORN_HOME/conf/dynamicConfig.yaml`. 

Review Comment:
   Need change



##########
docs/developers/configuration.md:
##########
@@ -0,0 +1,171 @@
+---
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+# Configuration
+Celeborn configuration is separated into static and dynamic configuration, of 
which details refer to [Configuration Guide](../configuration/index.md).
+
+## Static Configuration
+Static configuration `CelebornConf` loads configurations from default 
configuration file `$CELEBORN_HOME/conf/celeborn-defaults.conf`. 
+
+## Dynamic Configuration
+Dynamic configuration is a type of configuration that can be changed 
dynamically at runtime as needed, which overrides corresponding static 
+configuration at runtime of Celeborn `Master` and `Worker`. The `isDynamic` 
property represents whether the configuration key is dynamic 
+in [All Configurations](../configuration/index.md#all-configurations). It 
means that the configurations with dynamic property support dynamic 
+configuration and refresh at runtime.
+
+### Config Level
+At present dynamic configuration supports various config levels including:
+
+- `SYSTEM`: The system configurations.
+- `TENANT`: The dynamic configurations of tenant id.
+- `TENANT_USER`: The dynamic configurations of tenant id and username.
+
+When applying dynamic configuration, the priority order of config levels is as 
follows: 
+
+- `SYSTEM` level configuration overrides the static configuration, which in 
turn overrides the configuration of `CelebornConf`. 
+When the system level configuration is missing, fallback to the static 
configuration of `CelebornConf`.
+- `TENANT` level configuration overrides `SYSTEM` level, which result in that 
a configuration of certain tenant id overrides the configuration at system 
level. 
+When the tenant level configuration is missing, fallback to the dynamic 
configuration at system level.
+- `TENANT_USER` level configuration overrides `TENANT` level, which result in 
a configuration of certain tenant id and username overrides the configuration 
at tenant level. 
+When the tenant user level configuration is missing, fallback to the dynamic 
configuration at tenant level.
+
+## Config Service
+Config service provides the configuration management service with local cache 
for the static and dynamic configuration. 
+Meanwhile, `ConfigService` is a pluggable service interface of which 
implementation is based on various store backend. 
+The store backend of `ConfigService` is configured via 
`celeborn.dynamicConfig.store.backend`, which supports filesystem(`FS`) 
+and database(`DB`) store backend. If the store backend is not provided, it 
means that config service is disabled. 
+
+### FileSystem Config Service
+Filesystem config service supports the configurations stored in the dynamic 
configuration file, of which path is configured 
+via `celeborn.dynamicConfig.store.fs.path`. The template of the dynamic 
configuration is as follows:
+
+```yaml
+# SYSTEM level configuration
+- level: SYSTEM
+  config:
+    [config_key]: [config_val]
+    ...
+
+# TENANT level configuration
+- tenantId: [tenant_id]
+  level: TENANT
+  config:
+    [config_key]: [config_val]
+    ...
+  users:
+    # TENANT_USER level configuration
+      - name: [name]
+      config:
+        [config_key]: [config_val]
+        ...

Review Comment:
   ```
   # TENANT level configuration
   - tenantId: [tenant_id]
     level: TENANT
     config:
       [config_key]: [config_val]
       ...
     users:
         # TENANT_USER level configuration
         - name: [name]
         config:
           [config_key]: [config_val]
           ...
   ```



##########
docs/developers/configuration.md:
##########
@@ -0,0 +1,171 @@
+---
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+# Configuration
+Celeborn configuration is separated into static and dynamic configuration, of 
which details refer to [Configuration Guide](../configuration/index.md).
+
+## Static Configuration
+Static configuration `CelebornConf` loads configurations from default 
configuration file `$CELEBORN_HOME/conf/celeborn-defaults.conf`. 
+
+## Dynamic Configuration
+Dynamic configuration is a type of configuration that can be changed 
dynamically at runtime as needed, which overrides corresponding static 
+configuration at runtime of Celeborn `Master` and `Worker`. The `isDynamic` 
property represents whether the configuration key is dynamic 
+in [All Configurations](../configuration/index.md#all-configurations). It 
means that the configurations with dynamic property support dynamic 
+configuration and refresh at runtime.
+
+### Config Level
+At present dynamic configuration supports various config levels including:
+
+- `SYSTEM`: The system configurations.
+- `TENANT`: The dynamic configurations of tenant id.
+- `TENANT_USER`: The dynamic configurations of tenant id and username.
+
+When applying dynamic configuration, the priority order of config levels is as 
follows: 
+
+- `SYSTEM` level configuration overrides the static configuration, which in 
turn overrides the configuration of `CelebornConf`. 
+When the system level configuration is missing, fallback to the static 
configuration of `CelebornConf`.
+- `TENANT` level configuration overrides `SYSTEM` level, which result in that 
a configuration of certain tenant id overrides the configuration at system 
level. 
+When the tenant level configuration is missing, fallback to the dynamic 
configuration at system level.
+- `TENANT_USER` level configuration overrides `TENANT` level, which result in 
a configuration of certain tenant id and username overrides the configuration 
at tenant level. 
+When the tenant user level configuration is missing, fallback to the dynamic 
configuration at tenant level.
+
+## Config Service
+Config service provides the configuration management service with local cache 
for the static and dynamic configuration. 
+Meanwhile, `ConfigService` is a pluggable service interface of which 
implementation is based on various store backend. 
+The store backend of `ConfigService` is configured via 
`celeborn.dynamicConfig.store.backend`, which supports filesystem(`FS`) 
+and database(`DB`) store backend. If the store backend is not provided, it 
means that config service is disabled. 
+
+### FileSystem Config Service
+Filesystem config service supports the configurations stored in the dynamic 
configuration file, of which path is configured 
+via `celeborn.dynamicConfig.store.fs.path`. The template of the dynamic 
configuration is as follows:
+
+```yaml
+# SYSTEM level configuration
+- level: SYSTEM
+  config:
+    [config_key]: [config_val]
+    ...
+
+# TENANT level configuration
+- tenantId: [tenant_id]
+  level: TENANT
+  config:
+    [config_key]: [config_val]
+    ...
+  users:
+    # TENANT_USER level configuration
+      - name: [name]
+      config:
+        [config_key]: [config_val]
+        ...
+```
+For example, a Celeborn worker has 10 storage directories or disks and the 
buffer size is set to 256 KiB. The tenantId1
+only uses half of the storage and sets the buffer size to 128 KiB. Meanwhile, 
the user1 needs to change the buffer size 
+to 96 KiB at runtime. The example configurations are as follows: 
+
+```yaml
+# SYSTEM level configuration
+- level: SYSTEM
+  config:
+    celeborn.worker.flusher.buffer.size: 256K # sets buffer size of worker to 
256 KiB
+
+# TENANT level configuration
+- tenantId: tenantId1
+  level: TENANT
+  config:
+    celeborn.worker.flusher.buffer.size: 128K # sets buffer size of tenantId1 
to 128 KiB
+  users:
+    # TENANT_USER level configuration
+    - name: user1
+      config:
+       celeborn.worker.flusher.buffer.size: 96K # sets buffer size of 
tenantId1 and user1 to 128 KiB
+```
+
+### Database Config Service
+Database config service refreshes the dynamic configuration stored in the 
database via JDBC way. The configurations of 
+database store backend are specified with `celeborn.dynamicConfig.store.db.*` 
series. The database of config store backend 
+needs to create the tables of the dynamic configuration for different config 
levels.  The template of MySQL configuration 
+tables is as follows:
+
+```sql
+CREATE TABLE IF NOT EXISTS celeborn_cluster_info
+(
+    id         int          NOT NULL AUTO_INCREMENT,
+    name       varchar(255) NOT NULL COMMENT 'celeborn cluster name',
+    namespace  varchar(255) DEFAULT NULL COMMENT 'celeborn cluster namespace',
+    endpoint   varchar(255) DEFAULT NULL COMMENT 'celeborn cluster endpoint',
+    gmt_create timestamp NOT NULL,
+    gmt_modify timestamp NOT NULL,
+    PRIMARY KEY (id),
+    UNIQUE KEY `index_cluster_unique_name` (`name`)
+);
+
+# SYSTEM level configuration
+CREATE TABLE IF NOT EXISTS celeborn_cluster_system_config
+(
+    id           int NOT NULL AUTO_INCREMENT,
+    cluster_id   int NOT NULL,
+    config_key   varchar(255) NOT NULL,
+    config_value varchar(255) NOT NULL,
+    type         varchar(255) DEFAULT NULL COMMENT 'conf categories, such as 
quota',
+    gmt_create   timestamp NOT NULL,
+    gmt_modify   timestamp NOT NULL,
+    PRIMARY KEY (id),
+    UNIQUE KEY `index_unique_system_config_key` (`cluster_id`, `config_key`)
+);
+
+# TENANT/TENANT_USER level configuration
+CREATE TABLE IF NOT EXISTS celeborn_cluster_tenant_config
+(
+    id           int          NOT NULL AUTO_INCREMENT,
+    cluster_id   int          NOT NULL,
+    tenant_id    varchar(255) NOT NULL,
+    level        varchar(255) NOT NULL COMMENT 'config level, valid level is 
TENANT,USER',
+    user         varchar(255) DEFAULT NULL COMMENT 'tenant sub user',

Review Comment:
   have change to name?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to