Repository: flink
Updated Branches:
  refs/heads/master ae3d547af -> 75b8398b5


[hotfix] Remove costly checkState() statements from CEP SharedBuffer


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/75b8398b
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/75b8398b
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/75b8398b

Branch: refs/heads/master
Commit: 75b8398b58e6a7d0ea2c86e85d6c36de6f26537e
Parents: ae3d547
Author: Aljoscha Krettek <aljoscha.kret...@gmail.com>
Authored: Wed Feb 14 17:52:35 2018 +0100
Committer: Aljoscha Krettek <aljoscha.kret...@gmail.com>
Committed: Wed Feb 14 17:52:59 2018 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java | 8 --------
 1 file changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/75b8398b/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
----------------------------------------------------------------------
diff --git 
a/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
 
b/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
index 5f766e2..161d394 100644
--- 
a/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
+++ 
b/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
@@ -928,15 +928,11 @@ public class SharedBuffer<K extends Serializable, V> 
implements Serializable {
                                        // the ids of the source and target 
SharedBufferEntry
 
                                        int sourceId = sharedBuffer.entryId;
-                                       Preconditions.checkState(sourceId != -1,
-                                                       "Could not find id for 
entry: " + sharedBuffer);
 
                                        for (SharedBufferEdge<K, V> edge: 
sharedBuffer.edges) {
                                                int targetId = -1;
                                                if (edge.getTarget() != null) {
                                                        targetId = 
edge.getTarget().entryId;
-                                                       
Preconditions.checkState(targetId != -1,
-                                                                       "Could 
not find id for entry: " + edge.getTarget());
                                                }
 
                                                target.writeInt(sourceId);
@@ -978,12 +974,8 @@ public class SharedBuffer<K extends Serializable, V> 
implements Serializable {
 
                        for (int j = 0; j < totalEdges; j++) {
                                int sourceIdx = source.readInt();
-                               Preconditions.checkState(sourceIdx < 
entryList.size() && sourceIdx >= 0,
-                                               "Could not find source entry 
with index " + sourceIdx +         ". This indicates a corrupted state.");
 
                                int targetIdx = source.readInt();
-                               Preconditions.checkState(targetIdx < 
entryList.size(),
-                                               "Could not find target entry 
with index " + sourceIdx +         ". This indicates a corrupted state.");
 
                                DeweyNumber version = 
versionSerializer.deserialize(source);
 

Reply via email to