This is an automated email from the ASF dual-hosted git repository.

gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 2bbf89d  Remove FalseVectorMatcher, TrueVectorMatcher in favor of 
BooleanVectorValueMatcher. (#10757)
2bbf89d is described below

commit 2bbf89db81ee527ba4c080c7f0b3a1bc7a77997a
Author: Gian Merlino <gianmerl...@gmail.com>
AuthorDate: Thu Jan 14 18:28:25 2021 -0800

    Remove FalseVectorMatcher, TrueVectorMatcher in favor of 
BooleanVectorValueMatcher. (#10757)
---
 .../query/filter/vector/FalseVectorMatcher.java    | 50 ---------------------
 .../query/filter/vector/TrueVectorMatcher.java     | 51 ----------------------
 .../apache/druid/segment/filter/FalseFilter.java   |  4 +-
 .../apache/druid/segment/filter/TrueFilter.java    |  7 +--
 4 files changed, 6 insertions(+), 106 deletions(-)

diff --git 
a/processing/src/main/java/org/apache/druid/query/filter/vector/FalseVectorMatcher.java
 
b/processing/src/main/java/org/apache/druid/query/filter/vector/FalseVectorMatcher.java
deleted file mode 100644
index 9d20c1d..0000000
--- 
a/processing/src/main/java/org/apache/druid/query/filter/vector/FalseVectorMatcher.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.druid.query.filter.vector;
-
-import org.apache.druid.segment.vector.VectorSizeInspector;
-
-public class FalseVectorMatcher implements VectorValueMatcher
-{
-  private final VectorSizeInspector vectorSizeInspector;
-
-  public FalseVectorMatcher(VectorSizeInspector vectorSizeInspector)
-  {
-    this.vectorSizeInspector = vectorSizeInspector;
-  }
-
-  @Override
-  public ReadableVectorMatch match(ReadableVectorMatch mask)
-  {
-    return VectorMatch.allFalse();
-  }
-
-  @Override
-  public int getMaxVectorSize()
-  {
-    return vectorSizeInspector.getMaxVectorSize();
-  }
-
-  @Override
-  public int getCurrentVectorSize()
-  {
-    return vectorSizeInspector.getCurrentVectorSize();
-  }
-}
diff --git 
a/processing/src/main/java/org/apache/druid/query/filter/vector/TrueVectorMatcher.java
 
b/processing/src/main/java/org/apache/druid/query/filter/vector/TrueVectorMatcher.java
deleted file mode 100644
index 24b2b27..0000000
--- 
a/processing/src/main/java/org/apache/druid/query/filter/vector/TrueVectorMatcher.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.druid.query.filter.vector;
-
-import org.apache.druid.segment.vector.VectorSizeInspector;
-
-public class TrueVectorMatcher implements VectorValueMatcher
-{
-  private final VectorSizeInspector vectorSizeInspector;
-
-  public TrueVectorMatcher(VectorSizeInspector vectorSizeInspector)
-  {
-    this.vectorSizeInspector = vectorSizeInspector;
-  }
-
-  @Override
-  public ReadableVectorMatch match(ReadableVectorMatch mask)
-  {
-    // The given mask is all true for its valid selections.
-    return mask;
-  }
-
-  @Override
-  public int getMaxVectorSize()
-  {
-    return vectorSizeInspector.getMaxVectorSize();
-  }
-
-  @Override
-  public int getCurrentVectorSize()
-  {
-    return vectorSizeInspector.getCurrentVectorSize();
-  }
-}
diff --git 
a/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java 
b/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java
index f5b0397..27223d9 100644
--- a/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java
+++ b/processing/src/main/java/org/apache/druid/segment/filter/FalseFilter.java
@@ -23,7 +23,7 @@ import org.apache.druid.query.BitmapResultFactory;
 import org.apache.druid.query.filter.BitmapIndexSelector;
 import org.apache.druid.query.filter.Filter;
 import org.apache.druid.query.filter.ValueMatcher;
-import org.apache.druid.query.filter.vector.FalseVectorMatcher;
+import org.apache.druid.query.filter.vector.BooleanVectorValueMatcher;
 import org.apache.druid.query.filter.vector.VectorValueMatcher;
 import org.apache.druid.segment.ColumnSelector;
 import org.apache.druid.segment.ColumnSelectorFactory;
@@ -67,7 +67,7 @@ public class FalseFilter implements Filter
   @Override
   public VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory 
factory)
   {
-    return new FalseVectorMatcher(factory.getReadableVectorInspector());
+    return BooleanVectorValueMatcher.of(factory.getReadableVectorInspector(), 
false);
   }
 
   @Override
diff --git 
a/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java 
b/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java
index f6fb4ee..40f4923 100644
--- a/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java
+++ b/processing/src/main/java/org/apache/druid/segment/filter/TrueFilter.java
@@ -23,7 +23,7 @@ import org.apache.druid.query.BitmapResultFactory;
 import org.apache.druid.query.filter.BitmapIndexSelector;
 import org.apache.druid.query.filter.Filter;
 import org.apache.druid.query.filter.ValueMatcher;
-import org.apache.druid.query.filter.vector.TrueVectorMatcher;
+import org.apache.druid.query.filter.vector.BooleanVectorValueMatcher;
 import org.apache.druid.query.filter.vector.VectorValueMatcher;
 import org.apache.druid.segment.ColumnSelector;
 import org.apache.druid.segment.ColumnSelectorFactory;
@@ -34,6 +34,7 @@ import java.util.Map;
 import java.util.Set;
 
 /**
+ *
  */
 public class TrueFilter implements Filter
 {
@@ -57,13 +58,13 @@ public class TrueFilter implements Filter
   @Override
   public ValueMatcher makeMatcher(ColumnSelectorFactory factory)
   {
-    return TrueValueMatcher.instance();
+    return BooleanValueMatcher.of(true);
   }
 
   @Override
   public VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory 
factory)
   {
-    return new TrueVectorMatcher(factory.getReadableVectorInspector());
+    return BooleanVectorValueMatcher.of(factory.getReadableVectorInspector(), 
true);
   }
 
   @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to