swuferhong commented on code in PR #2178: URL: https://github.com/apache/fluss/pull/2178#discussion_r2621885125
########## fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/procedure/GetSharedRocksDBRateLimiterProcedure.java: ########## @@ -0,0 +1,86 @@ +/* + * 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 + * + * http://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. + */ + +package org.apache.fluss.flink.procedure; + +import org.apache.fluss.config.ConfigOptions; +import org.apache.fluss.config.MemorySize; +import org.apache.fluss.config.cluster.ConfigEntry; + +import org.apache.flink.table.annotation.ProcedureHint; +import org.apache.flink.table.procedure.ProcedureContext; + +import java.util.Collection; + +/** + * Procedure to get current RocksDB rate limiter configuration from cluster config. + * + * <p>Usage: + * + * <pre> + * CALL sys.get_shared_rocksdb_rate_limiter(); + * </pre> + */ +public class GetSharedRocksDBRateLimiterProcedure extends ProcedureBase { Review Comment: Why need this? In my side, this parameter is only useful to cluster administrators. If it's really necessary to introduce it, I personally think it should also be abstracted into a "describe config" (i.e., show all configs) operation. ########## fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/procedure/SetSharedRocksDBRateLimiterProcedure.java: ########## @@ -0,0 +1,108 @@ +/* + * 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 + * + * http://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. + */ + +package org.apache.fluss.flink.procedure; + +import org.apache.fluss.config.ConfigOptions; +import org.apache.fluss.config.MemorySize; +import org.apache.fluss.config.cluster.AlterConfig; +import org.apache.fluss.config.cluster.AlterConfigOpType; +import org.apache.fluss.config.cluster.ConfigEntry; + +import org.apache.flink.table.annotation.ArgumentHint; +import org.apache.flink.table.annotation.DataTypeHint; +import org.apache.flink.table.annotation.ProcedureHint; +import org.apache.flink.table.procedure.ProcedureContext; + +import java.util.Collection; +import java.util.Collections; + +/** + * Procedure to set RocksDB rate limiter dynamically via cluster configuration. The configuration + * will be persisted in ZooKeeper and applied to all TabletServers. + * + * <p>Usage examples: + * + * <pre> + * -- Set rate limiter to 200MB/s + * CALL sys.set_shared_rocksdb_rate_limiter('200MB'); + * + * -- Set rate limiter to 1GB/s + * CALL sys.set_shared_rocksdb_rate_limiter('1GB'); + * </pre> + */ +public class SetSharedRocksDBRateLimiterProcedure extends ProcedureBase { Review Comment: It can be abstracted into an `AlterConfigProcedure`, which can then be reused for modifying other cluster parameter. -- 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]
