cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] ifesdjeen commented on a change in pull request #428: CASSANDRA-15505
Date Thu, 30 Jan 2020 10:45:56 GMT
ifesdjeen commented on a change in pull request #428: CASSANDRA-15505 
URL: https://github.com/apache/cassandra/pull/428#discussion_r372877592
 
 

 ##########
 File path: test/distributed/org/apache/cassandra/distributed/impl/MessageFilters.java
 ##########
 @@ -87,70 +86,80 @@ public boolean equals(Object that)
         public boolean equals(Filter that)
         {
             return Arrays.equals(from, that.from)
-                    && Arrays.equals(to, that.to)
-                    && Arrays.equals(verbs, that.verbs);
-        }
-
-        public boolean matches(int from, int to, int verb)
-        {
-            return (this.from == null || Arrays.binarySearch(this.from, from) >= 0)
-                    && (this.to == null || Arrays.binarySearch(this.to, to) >=
0)
-                    && (this.verbs == null || Arrays.binarySearch(this.verbs, verb)
>= 0);
+                   && Arrays.equals(to, that.to)
+                   && Arrays.equals(verbs, that.verbs);
         }
 
-        public Filter restore()
+        public Filter off()
         {
             filters.remove(this);
             return this;
         }
 
-        public Filter drop()
+        public Filter on()
         {
             filters.add(this);
             return this;
         }
+
+        public boolean matches(int from, int to, IMessage msg)
+        {
+            return (this.from == null || Arrays.binarySearch(this.from, from) >= 0)
+                   && (this.to == null || Arrays.binarySearch(this.to, to) >=
0)
+                   && (this.verbs == null || Arrays.binarySearch(this.verbs, msg.verb())
>= 0)
+                   && (this.matcher == null || this.matcher.matches(from, to, msg));
+        }
     }
 
     public class Builder implements IMessageFilters.Builder
     {
         int[] from;
         int[] to;
         int[] verbs;
+        Matcher onInstance;
 
 Review comment:
   +1

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message