You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/02/02 08:51:23 UTC
[shardingsphere] branch master updated: Remove useless toString for JobRateLimitAlgorithm impls (#23921)
This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new d65869f4aad Remove useless toString for JobRateLimitAlgorithm impls (#23921)
d65869f4aad is described below
commit d65869f4aad1f80b8b22e6eb49de7c17f1ce3930
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Feb 2 16:51:15 2023 +0800
Remove useless toString for JobRateLimitAlgorithm impls (#23921)
---
.../data/pipeline/core/ratelimit/QPSJobRateLimitAlgorithm.java | 10 +---------
.../data/pipeline/core/ratelimit/TPSJobRateLimitAlgorithm.java | 10 +---------
2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/QPSJobRateLimitAlgorithm.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/QPSJobRateLimitAlgorithm.java
index 0565340017c..57df2c5df9d 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/QPSJobRateLimitAlgorithm.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/QPSJobRateLimitAlgorithm.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.data.pipeline.spi.ratelimit.JobRateLimitAlgorit
import java.util.Properties;
/**
- * QPS job rate limit algorithm for SPI.
+ * QPS job rate limit algorithm.
*/
public final class QPSJobRateLimitAlgorithm implements JobRateLimitAlgorithm {
@@ -35,11 +35,8 @@ public final class QPSJobRateLimitAlgorithm implements JobRateLimitAlgorithm {
private RateLimiter rateLimiter;
- private Properties props = new Properties();
-
@Override
public void init(final Properties props) {
- this.props = props;
String qpsValue = props.getProperty(QPS_KEY);
if (!Strings.isNullOrEmpty(qpsValue)) {
qps = Integer.parseInt(qpsValue);
@@ -59,9 +56,4 @@ public final class QPSJobRateLimitAlgorithm implements JobRateLimitAlgorithm {
}
rateLimiter.acquire(null != data ? data.intValue() : 1);
}
-
- @Override
- public String toString() {
- return "QPSJobRateLimitAlgorithm{" + "props=" + props + '}';
- }
}
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/TPSJobRateLimitAlgorithm.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/TPSJobRateLimitAlgorithm.java
index a95392df08d..a43ed28bd23 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/TPSJobRateLimitAlgorithm.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ratelimit/TPSJobRateLimitAlgorithm.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.data.pipeline.spi.ratelimit.JobRateLimitAlgorit
import java.util.Properties;
/**
- * TPS job rate limit algorithm for SPI.
+ * TPS job rate limit algorithm.
*/
public final class TPSJobRateLimitAlgorithm implements JobRateLimitAlgorithm {
@@ -35,11 +35,8 @@ public final class TPSJobRateLimitAlgorithm implements JobRateLimitAlgorithm {
private RateLimiter rateLimiter;
- private Properties props = new Properties();
-
@Override
public void init(final Properties props) {
- this.props = props;
String tpsValue = props.getProperty(TPS_KEY);
if (!Strings.isNullOrEmpty(tpsValue)) {
tps = Integer.parseInt(tpsValue);
@@ -63,9 +60,4 @@ public final class TPSJobRateLimitAlgorithm implements JobRateLimitAlgorithm {
default:
}
}
-
- @Override
- public String toString() {
- return "TPSJobRateLimitAlgorithm{" + "props=" + props + '}';
- }
}