You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2020/02/25 22:55:40 UTC
[flink] 01/07: [FLINK-16178][refactor] Avoid costly eager error
message construction in OperatorState.
This is an automated email from the ASF dual-hosted git repository.
sewen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 29d52cb5128d695613d165eb2e5eed80ec834d19
Author: Stephan Ewen <se...@apache.org>
AuthorDate: Wed Feb 19 17:22:14 2020 +0100
[FLINK-16178][refactor] Avoid costly eager error message construction in OperatorState.
---
.../java/org/apache/flink/runtime/checkpoint/OperatorState.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/OperatorState.java b/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/OperatorState.java
index 33eccf7..de011c1 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/OperatorState.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/OperatorState.java
@@ -50,9 +50,10 @@ public class OperatorState implements CompositeStateHandle {
private final int maxParallelism;
public OperatorState(OperatorID operatorID, int parallelism, int maxParallelism) {
- Preconditions.checkArgument(
- parallelism <= maxParallelism,
- "Parallelism " + parallelism + " is not smaller or equal to max parallelism " + maxParallelism + ".");
+ if (parallelism > maxParallelism) {
+ throw new IllegalArgumentException(String.format(
+ "Parallelism %s is not smaller or equal to max parallelism %s.", parallelism, maxParallelism));
+ }
this.operatorID = operatorID;