incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1201454 - in /incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces: FilterRelationship.java SubqueryFilter.java WHFilter.java WHTable.java
Date Sun, 13 Nov 2011 16:35:20 GMT
Author: kwright
Date: Sun Nov 13 16:35:20 2011
New Revision: 1201454

URL: http://svn.apache.org/viewvc?rev=1201454&view=rev
Log:
Flesh out filtering to use a dedicated interface

Added:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
  (with props)
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
  (with props)
Modified:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java?rev=1201454&r1=1201453&r2=1201454&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationship.java
Sun Nov 13 16:35:20 2011
@@ -24,11 +24,13 @@ package org.apache.warthog.interfaces;
 public class FilterRelationship implements WHRelationship
 {
   protected WHRelationship relationshipToFilter;
+  protected WHFilter filterer;
   
   /** Constructor */
-  public FilterRelationship(WHRelationship relationshipToFilter)
+  public FilterRelationship(WHRelationship relationshipToFilter, WHFilter filterer)
   {
     this.relationshipToFilter = relationshipToFilter;
+    this.filterer = filterer;
   }
   
   /** Get the column names represented by the relationship. */
@@ -60,7 +62,7 @@ public class FilterRelationship implemen
   protected boolean isUnfiltered(int rowNumber)
     throws WHException
   {
-    return true;
+    return filterer.isUnfiltered(this,rowNumber);
   }
   
   /** Accessor class that performs generic filtering.

Added: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java?rev=1201454&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
(added)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
Sun Nov 13 16:35:20 2011
@@ -0,0 +1,43 @@
+/* $Id$ */
+
+/**
+* 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.warthog.interfaces;
+
+/** Filter using a secondary relationship "joined" using specified criteria.
+*/
+public class SubqueryFilter implements WHFilter
+{
+  protected WHRelationship subqueryRelationship;
+  
+  /** Constructor */
+  public SubqueryFilter(WHRelationship subqueryRelationship)
+  {
+    // MHL
+  }
+  
+  /** Check if a row should be filtered or not.
+  */
+  public boolean isUnfiltered(WHRelationship relationship, int rowNumber)
+    throws WHException
+  {
+    // MHL
+    return true;
+  }
+
+}
\ No newline at end of file

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java?rev=1201454&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
(added)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
Sun Nov 13 16:35:20 2011
@@ -0,0 +1,31 @@
+/* $Id$ */
+
+/**
+* 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.warthog.interfaces;
+
+/** This relationship type applies filtering criteria on top of another relationship.
+*/
+public interface WHFilter
+{
+  /** Check if a row should be filtered or not.
+  */
+  public boolean isUnfiltered(WHRelationship relationship, int rowNumber)
+    throws WHException;
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java?rev=1201454&r1=1201453&r2=1201454&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTable.java
Sun Nov 13 16:35:20 2011
@@ -41,11 +41,11 @@ public interface WHTable
   
   /** Update row(s) */
   public void updateRows(String[] columns, WHValue[] values,
-    WHAccessor accessor)
+    WHAccessor accessor, WHFilter filter)
     throws WHException;
     
   /** Delete row(s) */
-  public void deleteRows(WHAccessor accessor)
+  public void deleteRows(WHAccessor accessor, WHFilter filter)
     throws WHException;
   
   // Below this point is the 'non-public' part of the API, which may eventually be moved
into implementation classes.



Mime
View raw message