You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/12/10 16:26:18 UTC
svn commit: r1212814 - in /incubator/lcf/branches/CONNECTORS-286/warthog/src:
main/java/org/apache/warthog/common/ main/java/org/apache/warthog/interfaces/
test/java/org/apache/warthog/tests/
Author: kwright
Date: Sat Dec 10 15:26:17 2011
New Revision: 1212814
URL: http://svn.apache.org/viewvc?rev=1212814&view=rev
Log:
Finish joins.
Added:
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexAfter.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaAfter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBefore.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBefore.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBetween.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBetween.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEquals.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEquals.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsMultiple.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsMultiple.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrAfter.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrAfter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrBefore.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrBefore.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterCriteria.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java (with props)
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterSubquery.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java (with props)
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java (with props)
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationshipBuilder.java
- copied, changed from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java
Removed:
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaAfter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBefore.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBetween.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEquals.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsMultiple.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrAfter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrBefore.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java
Modified:
incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterAccessor.java
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/JoinRelationship.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/MultiThreadTest.java
incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/SanityTest.java
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexAfter.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaAfter.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexAfter.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexAfter.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaAfter.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaAfter.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexAfter.java Sat Dec 10 15:26:17 2011
@@ -24,12 +24,12 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate matches that follow
* a specific WHValue.
*/
-public class CriteriaAfter extends IndexCriteria
+public class IndexAfter extends IndexCriteria
{
protected WHValue value;
/** Constructor */
- public CriteriaAfter(WHValue value)
+ public IndexAfter(WHValue value)
{
super();
this.value = value;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBefore.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBefore.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBefore.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBefore.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBefore.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBefore.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBefore.java Sat Dec 10 15:26:17 2011
@@ -24,12 +24,12 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate matches that precede
* a specific WHValue.
*/
-public class CriteriaBefore extends IndexCriteria
+public class IndexBefore extends IndexCriteria
{
protected WHValue value;
/** Constructor */
- public CriteriaBefore(WHValue value)
+ public IndexBefore(WHValue value)
{
super();
this.value = value;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBetween.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBetween.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBetween.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBetween.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBetween.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaBetween.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexBetween.java Sat Dec 10 15:26:17 2011
@@ -24,13 +24,13 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate matches that follow
* a specific WHValue, but precede a second WHValue, non-inclusive.
*/
-public class CriteriaBetween extends IndexCriteria
+public class IndexBetween extends IndexCriteria
{
protected WHValue afterValue;
protected WHValue beforeValue;
/** Constructor */
- public CriteriaBetween(WHValue afterValue, WHValue beforeValue)
+ public IndexBetween(WHValue afterValue, WHValue beforeValue)
{
super();
this.afterValue = afterValue;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEquals.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEquals.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEquals.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEquals.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEquals.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEquals.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEquals.java Sat Dec 10 15:26:17 2011
@@ -24,12 +24,12 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate only exact matches against
* a specific WHValue.
*/
-public class CriteriaEquals extends IndexCriteria
+public class IndexEquals extends IndexCriteria
{
protected WHValue value;
/** Constructor */
- public CriteriaEquals(WHValue value)
+ public IndexEquals(WHValue value)
{
super();
this.value = value;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsMultiple.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsMultiple.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsMultiple.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsMultiple.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsMultiple.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsMultiple.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsMultiple.java Sat Dec 10 15:26:17 2011
@@ -24,12 +24,12 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate only exact matches against
* a specific set of WHValues.
*/
-public class CriteriaEqualsMultiple extends IndexCriteria
+public class IndexEqualsMultiple extends IndexCriteria
{
protected WHValue[] values;
/** Constructor */
- public CriteriaEqualsMultiple(WHValue[] values)
+ public IndexEqualsMultiple(WHValue[] values)
{
super();
this.values = values;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrAfter.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrAfter.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrAfter.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrAfter.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrAfter.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrAfter.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrAfter.java Sat Dec 10 15:26:17 2011
@@ -24,12 +24,12 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate matches that equal or come after
* a specific WHValue.
*/
-public class CriteriaEqualsOrAfter extends IndexCriteria
+public class IndexEqualsOrAfter extends IndexCriteria
{
protected WHValue value;
/** Constructor */
- public CriteriaEqualsOrAfter(WHValue value)
+ public IndexEqualsOrAfter(WHValue value)
{
super();
this.value = value;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrBefore.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrBefore.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrBefore.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrBefore.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrBefore.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/CriteriaEqualsOrBefore.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/common/IndexEqualsOrBefore.java Sat Dec 10 15:26:17 2011
@@ -24,12 +24,12 @@ import org.apache.warthog.interfaces.*;
/** This class represents index criteria designed to locate that precede or equal
* a specific WHValue.
*/
-public class CriteriaEqualsOrBefore extends IndexCriteria
+public class IndexEqualsOrBefore extends IndexCriteria
{
protected WHValue value;
/** Constructor */
- public CriteriaEqualsOrBefore(WHValue value)
+ public IndexEqualsOrBefore(WHValue value)
{
super();
this.value = value;
Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterAccessor.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterAccessor.java?rev=1212814&r1=1212813&r2=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterAccessor.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterAccessor.java Sat Dec 10 15:26:17 2011
@@ -23,11 +23,11 @@ package org.apache.warthog.interfaces;
*/
public class FilterAccessor implements WHAccessor
{
- protected WHFilter filter;
+ protected FilterCriteria filter;
protected WHAccessor baseAccessor;
protected WHRowID currentRowID;
- public FilterAccessor(WHAccessor baseAccessor, WHFilter filter)
+ public FilterAccessor(WHAccessor baseAccessor, FilterCriteria filter)
throws WHException
{
this.baseAccessor = baseAccessor;
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterCriteria.java (from r1212572, 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/FilterCriteria.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterCriteria.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHFilter.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterCriteria.java Sat Dec 10 15:26:17 2011
@@ -19,13 +19,20 @@
package org.apache.warthog.interfaces;
-/** This relationship type applies filtering criteria on top of another relationship.
+/** This base class specifies filtering that is applied on top of an accessor.
*/
-public interface WHFilter
+public class FilterCriteria
{
+ public FilterCriteria()
+ {
+ }
+
/** Check if a row should be filtered or not.
*/
public boolean include(WHAccessor accessor)
- throws WHException;
+ throws WHException
+ {
+ return true;
+ }
}
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=1212814&r1=1212813&r2=1212814&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 Sat Dec 10 15:26:17 2011
@@ -24,10 +24,10 @@ package org.apache.warthog.interfaces;
public class FilterRelationship implements WHRelationship
{
protected WHRelationship relationshipToFilter;
- protected WHFilter filterer;
+ protected FilterCriteria filterer;
/** Constructor */
- public FilterRelationship(WHRelationship relationshipToFilter, WHFilter filterer)
+ public FilterRelationship(WHRelationship relationshipToFilter, FilterCriteria filterer)
{
this.relationshipToFilter = relationshipToFilter;
this.filterer = filterer;
Added: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java?rev=1212814&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java (added)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java Sat Dec 10 15:26:17 2011
@@ -0,0 +1,100 @@
+/* $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;
+
+import java.lang.reflect.*;
+
+/** Build a relationship based on another WHRelationshipBuilder with an applied filter.
+*/
+public class FilterRelationshipBuilder implements WHRelationshipBuilder
+{
+ protected WHRelationshipBuilder baseRelationshipBuilder;
+ protected FilterCriteria filterer;
+ protected String columnToFilter;
+ protected String filterClassName;
+ protected String matchColumnName;
+ protected WHComparator comparator;
+
+ /** Constructor.
+ * Can be called on one of two ways. Either filterer is null and matchColumnName, columnToFilter, and filterClassName
+ * are set, or filterer is non-null. The class specified by filterClassName will be instantiated
+ * using the XXX(columnName, value) constructor.
+ */
+ public FilterRelationshipBuilder(WHRelationshipBuilder baseRelationshipBuilder,
+ FilterCriteria filterer, String matchColumnName, String filterClassName, String columnToFilter,
+ WHComparator comparator)
+ throws WHException
+ {
+ this.baseRelationshipBuilder = baseRelationshipBuilder;
+ this.filterer = filterer;
+ this.columnToFilter = columnToFilter;
+ this.filterClassName = filterClassName;
+ this.matchColumnName = matchColumnName;
+ this.comparator = comparator;
+ }
+
+ /** Construct a relationship based on the specified accessor row.
+ */
+ public WHRelationship createRelationship(WHAccessor accessor)
+ throws WHException
+ {
+ // Build the base accessor using the accessor builder we've been handed
+ WHRelationship baseRelationship = baseRelationshipBuilder.createRelationship(accessor);
+
+ if (matchColumnName != null && columnToFilter != null && filterClassName != null &&
+ comparator != null)
+ {
+ WHValue theMatchValue = accessor.getValue(matchColumnName);
+ try
+ {
+ Class classValue = Class.forName(filterClassName);
+ Constructor constructor = classValue.getConstructor(new Class[]{String.class,WHValue.class,WHComparator.class});
+ Object object = constructor.newInstance(new Object[]{columnToFilter,theMatchValue,comparator});
+ if (!(object instanceof FilterCriteria))
+ throw new WHException("Filter class '"+filterClassName+"' does not extend FilterCriteria");
+ filterer = (FilterCriteria)object;
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new WHException("Can't find filter class '"+filterClassName+"': "+e.getMessage(),e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new WHException("Filter class '"+filterClassName+"' does not have a constructor with (String,WHValue,WHComparator) arguments: "+e.getMessage(),e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new WHException("Constructor exception instantiating filter class '"+filterClassName+"': "+e.getMessage(),e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new WHException("Instantiation exception for filter class '"+filterClassName+"': "+e.getMessage(),e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new WHException("Filter class '"+filterClassName+"' (String,WHValue,WHComparator) constructor has protected access",e);
+ }
+ }
+
+ // Now build the filter relationship with it.
+ return new FilterRelationship(baseRelationship,filterer);
+ }
+
+}
\ No newline at end of file
Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterRelationshipBuilder.java
------------------------------------------------------------------------------
svn:keywords = Id
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterSubquery.java (from r1212572, 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/FilterSubquery.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterSubquery.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/SubqueryFilter.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/FilterSubquery.java Sat Dec 10 15:26:17 2011
@@ -26,27 +26,29 @@ package org.apache.warthog.interfaces;
* Note that there are a number of 'moving parts' needed to make this filter work.
* The accessor must be constructed on the fly, so there has to be some code that
* finds the right table or index accessor based on the join criteria. That's going to
-* be handled by a class implementing WHAccessorBuilder.
+* be handled by a class implementing WHRelationshipBuilder.
*/
-public class SubqueryFilter implements WHFilter
+public class FilterSubquery extends FilterCriteria
{
protected boolean isExists;
- protected WHAccessorBuilder builder;
+ protected WHRelationshipBuilder builder;
/** Constructor */
- public SubqueryFilter(boolean isExists, WHAccessorBuilder builder)
+ public FilterSubquery(boolean isExists, WHRelationshipBuilder builder)
{
+ super();
this.isExists = isExists;
this.builder = builder;
}
/** Check if a row should be filtered or not.
*/
+ @Override
public boolean include(WHAccessor accessor)
throws WHException
{
- WHAccessor checker = builder.createAccessor(accessor);
- return isExists ^ (checker.getCurrentRowID() == null);
+ WHRelationship checkerRelationship = builder.createRelationship(accessor);
+ return isExists ^ (checkerRelationship.buildAccessor().getCurrentRowID() == null);
}
}
\ No newline at end of file
Added: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java?rev=1212814&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java (added)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java Sat Dec 10 15:26:17 2011
@@ -0,0 +1,107 @@
+/* $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;
+
+import java.lang.reflect.*;
+
+/** Build an index relationship based on a row in an accessor.
+*/
+public class IndexRelationshipBuilder implements WHRelationshipBuilder
+{
+ protected WHIndex index;
+ protected IndexCriteria[] criteria;
+ protected String[] accessorColumn;
+ protected String[] criteriaClassName;
+ protected boolean[] orderReversed;
+
+ /** Constructor. The criteria passed to the index will include
+ * both criteria we specify in the constructor, and criteria based
+ * the accessor row we see. Thus the segregation of the incoming
+ * arguments.
+ * The way it works is that whenever the accessorColumn value is non-null, then
+ * the matching criteriaClass is instantiated (with a single WHValue argument).
+ * Otherwise, the criteria passed in the "criteria" argument is used.
+ */
+ public IndexRelationshipBuilder(WHIndex index,
+ IndexCriteria[] criteria,
+ String[] accessorColumn,
+ String[] criteriaClassName,
+ boolean[] orderReversed)
+ throws WHException
+ {
+ if (criteria.length != accessorColumn.length ||
+ criteria.length != criteriaClassName.length ||
+ criteria.length != orderReversed.length)
+ throw new WHException("Criteria, accessorColumn, criteriaClassName, and orderReversed all must be the same size");
+ this.index = index;
+ this.criteria = criteria;
+ this.orderReversed = orderReversed;
+ this.accessorColumn = accessorColumn;
+ this.criteriaClassName = criteriaClassName;
+ }
+
+ /** Construct a relationship based on the specified accessor row.
+ */
+ public WHRelationship createRelationship(WHAccessor accessor)
+ throws WHException
+ {
+ // Fill in the missing pieces from the current accessor.
+ for (int i = 0 ; i < criteria.length ; i++)
+ {
+ if (accessorColumn[i] != null && criteriaClassName[i] != null)
+ {
+ WHValue theMatchValue = accessor.getValue(accessorColumn[i]);
+ try
+ {
+ Class classValue = Class.forName(criteriaClassName[i]);
+ Constructor constructor = classValue.getConstructor(new Class[]{WHValue.class});
+ Object object = constructor.newInstance(new Object[]{theMatchValue});
+ if (!(object instanceof IndexCriteria))
+ throw new WHException("Criteria class '"+criteriaClassName[i]+"' does not extend IndexCriteria");
+ criteria[i] = (IndexCriteria)object;
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new WHException("Can't find criteria class '"+criteriaClassName[i]+"': "+e.getMessage(),e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new WHException("Criteria class '"+criteriaClassName[i]+"' does not have a constructor with a WHValue argument: "+e.getMessage(),e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new WHException("Constructor exception instantiating criteria class '"+criteriaClassName[i]+"': "+e.getMessage(),e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new WHException("Instantiation exception for criteria class '"+criteriaClassName[i]+"': "+e.getMessage(),e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new WHException("Criteria class '"+criteriaClassName[i]+"' WHValue constructor has protected access",e);
+ }
+ }
+ }
+
+ // Create an index relationship so we can get its accessor
+ return new IndexRelationship(index,criteria,orderReversed);
+ }
+
+}
\ No newline at end of file
Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/IndexRelationshipBuilder.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java?rev=1212814&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java (added)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java Sat Dec 10 15:26:17 2011
@@ -0,0 +1,118 @@
+/* $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;
+
+import java.util.*;
+
+/** Accessor class that returns a join of two tables.
+*/
+public class JoinAccessor implements WHAccessor
+{
+ protected WHAccessor primeAccessor;
+ protected WHRelationshipBuilder secondaryRelationshipBuilder;
+ protected Map<String,String> secondaryColumnMap;
+
+ protected WHAccessor currentSecondaryAccessor;
+ protected WHRowID currentRowID;
+
+ public JoinAccessor(WHAccessor primeAccessor, WHRelationshipBuilder secondaryRelationshipBuilder,
+ Map<String,String> secondaryColumnMap)
+ throws WHException
+ {
+ this.primeAccessor = primeAccessor;
+ this.secondaryRelationshipBuilder = secondaryRelationshipBuilder;
+ this.secondaryColumnMap = secondaryColumnMap;
+ goToNextLegalRow();
+ }
+
+ protected void goToNextLegalRow()
+ throws WHException
+ {
+ while (true)
+ {
+ WHRowID primeRowID = primeAccessor.getCurrentRowID();
+ if (primeRowID == null)
+ {
+ currentSecondaryAccessor = null;
+ currentRowID = null;
+ return;
+ }
+ if (currentSecondaryAccessor == null)
+ currentSecondaryAccessor = secondaryRelationshipBuilder.createRelationship(primeAccessor).buildAccessor();
+ WHRowID secondaryRowID = currentSecondaryAccessor.getCurrentRowID();
+ if (secondaryRowID == null)
+ {
+ // Done with secondary for this primary row, so advance primary
+ primeAccessor.advance();
+ // Since we haven't found a row yet, loop
+ continue;
+ }
+ // We've found a row! Construct a row ID
+ currentRowID = new JoinRowID(primeRowID,secondaryRowID);
+ break;
+ }
+ }
+
+ /** Advance to the next row.
+ */
+ public void advance()
+ throws WHException
+ {
+ if (currentRowID != null)
+ {
+ currentSecondaryAccessor.advance();
+ goToNextLegalRow();
+ }
+ }
+
+ /** Read the current relationship row ID, Null will be returned if we are
+ * at the end of the sequence.
+ */
+ public WHRowID getCurrentRowID()
+ throws WHException
+ {
+ return currentRowID;
+ }
+
+ /** Get the data for the current row and specified column.
+ */
+ public WHValue getValue(String columnName)
+ throws WHException
+ {
+ String secondaryKey = secondaryColumnMap.get(columnName);
+ if (secondaryKey == null)
+ return primeAccessor.getValue(columnName);
+ return currentSecondaryAccessor.getValue(secondaryKey);
+ }
+
+ /** This class represents a joined rowID */
+ protected static class JoinRowID implements WHRowID
+ {
+ protected WHRowID primaryRow;
+ protected WHRowID secondaryRow;
+
+ public JoinRowID(WHRowID primaryRow, WHRowID secondaryRow)
+ {
+ this.primaryRow = primaryRow;
+ this.secondaryRow = secondaryRow;
+ }
+ }
+
+}
Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinAccessor.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java?rev=1212814&r1=1212813&r2=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/JoinRelationship.java Sat Dec 10 15:26:17 2011
@@ -19,6 +19,8 @@
package org.apache.warthog.interfaces;
+import java.util.*;
+
/** This relationship type represents the joining of a primary relationship and a
* secondary relationship, plus a joining criteria, yielding a result with columns that
* includes the columns from both. To build a three-way join, just nest join
@@ -27,25 +29,22 @@ package org.apache.warthog.interfaces;
public class JoinRelationship implements WHRelationship
{
protected WHRelationship primeRelationship;
- protected String[] secondaryColumns;
- protected String[] secondaryReturnColumns;
- protected WHAccessorBuilder secondaryAccessorBuilder;
-
+ protected WHRelationshipBuilder secondaryRelationshipBuilder;
+
+ protected Map<String,String> secondaryColumnMap;
protected String[] returnColumns;
/** Constructor. */
public JoinRelationship(WHRelationship primeRelationship,
String[] secondaryColumns,
String[] secondaryReturnColumns,
- WHAccessorBuilder secondaryAccessorBuilder)
+ WHRelationshipBuilder secondaryRelationshipBuilder)
throws WHException
{
if (secondaryColumns.length != secondaryReturnColumns.length)
throw new WHException("Secondary columns and return columns must be the same number");
this.primeRelationship = primeRelationship;
- this.secondaryColumns = secondaryColumns;
- this.secondaryReturnColumns = secondaryReturnColumns;
- this.secondaryAccessorBuilder = secondaryAccessorBuilder;
+ this.secondaryRelationshipBuilder = secondaryRelationshipBuilder;
String[] primaryColumns = primeRelationship.getColumnNames();
returnColumns = new String[primaryColumns.length + secondaryReturnColumns.length];
int position = 0;
@@ -53,9 +52,11 @@ public class JoinRelationship implements
{
returnColumns[position++] = primaryColumns[i];
}
+ secondaryColumnMap = new HashMap<String,String>();
for (int i = 0 ; i < secondaryReturnColumns.length ; i++)
{
returnColumns[position++] = secondaryReturnColumns[i];
+ secondaryColumnMap.put(secondaryReturnColumns[i],secondaryColumns[i]);
}
}
@@ -73,8 +74,7 @@ public class JoinRelationship implements
public WHAccessor buildAccessor()
throws WHException
{
- // MHL
- return null;
+ return new JoinAccessor(primeRelationship.buildAccessor(),secondaryRelationshipBuilder,secondaryColumnMap);
}
}
\ No newline at end of file
Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationshipBuilder.java (from r1212572, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationshipBuilder.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationshipBuilder.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java&r1=1212572&r2=1212814&rev=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHAccessorBuilder.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHRelationshipBuilder.java Sat Dec 10 15:26:17 2011
@@ -19,15 +19,15 @@
package org.apache.warthog.interfaces;
-/** Classes that implement this interface construct WHAccessor objects based
-* on criteria they receive from a specific row in a relationship.
+/** Classes that implement this interface construct WHRelationship objects based
+* on criteria they receive from a specific row in another relationship.
*/
-public interface WHAccessorBuilder
+public interface WHRelationshipBuilder
{
- /** Construct an accessor based on the specified row of the specified
+ /** Construct a relationship based on the specified row of the specified
* relationship.
*/
- public WHAccessor createAccessor(WHAccessor accessor)
+ public WHRelationship createRelationship(WHAccessor accessor)
throws WHException;
}
\ No newline at end of file
Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/MultiThreadTest.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/MultiThreadTest.java?rev=1212814&r1=1212813&r2=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/MultiThreadTest.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/MultiThreadTest.java Sat Dec 10 15:26:17 2011
@@ -381,7 +381,7 @@ public class MultiThreadTest
{
WHIndex index = ts.lookupIndex("testindex1");
WHAccessor accessor = index.buildAccessor(new IndexCriteria[]{
- new CriteriaBetween(new StringValue("1"),new StringValue("2")),
+ new IndexBetween(new StringValue("1"),new StringValue("2")),
null},null);
while (true)
{
@@ -411,7 +411,7 @@ public class MultiThreadTest
{
WHIndex index = ts.lookupIndex("testindex2");
WHAccessor accessor = index.buildAccessor(new IndexCriteria[]{
- new CriteriaBetween(new StringValue("23"),new StringValue("25")),
+ new IndexBetween(new StringValue("23"),new StringValue("25")),
null},null);
while (true)
{
@@ -441,7 +441,7 @@ public class MultiThreadTest
{
WHIndex index = ts.lookupIndex("testindex3");
WHAccessor accessor = index.buildAccessor(new IndexCriteria[]{
- new CriteriaBetween(new StringValue("02"),new StringValue("04")),
+ new IndexBetween(new StringValue("02"),new StringValue("04")),
null},null);
while (true)
{
Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/SanityTest.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/SanityTest.java?rev=1212814&r1=1212813&r2=1212814&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/SanityTest.java (original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/test/java/org/apache/warthog/tests/SanityTest.java Sat Dec 10 15:26:17 2011
@@ -191,7 +191,7 @@ public class SanityTest
// Build a bunch of accessors and see if they do what we expect
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaEquals(new LongValue(124L))},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexEquals(new LongValue(124L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -203,7 +203,7 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaEqualsOrBefore(new LongValue(124L))},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexEqualsOrBefore(new LongValue(124L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -227,7 +227,7 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaEqualsOrAfter(new LongValue(124L))},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexEqualsOrAfter(new LongValue(124L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -251,7 +251,7 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaBefore(new LongValue(124L))},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexBefore(new LongValue(124L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -269,7 +269,7 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaAfter(new LongValue(124L))},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexAfter(new LongValue(124L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -287,7 +287,7 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaEqualsMultiple(new WHValue[]{new LongValue(123L),new LongValue(333L)})},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexEqualsMultiple(new WHValue[]{new LongValue(123L),new LongValue(333L)})},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -305,7 +305,7 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
- accessor = index.buildAccessor(new IndexCriteria[]{new CriteriaBetween(new LongValue(123L),new LongValue(333L))},null);
+ accessor = index.buildAccessor(new IndexCriteria[]{new IndexBetween(new LongValue(123L),new LongValue(333L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);
@@ -319,7 +319,7 @@ public class SanityTest
ts.beginTransaction();
table = ts.lookupTable("testtable");
index = ts.lookupIndex("testindex");
- table.deleteRows(index.buildAccessor(new IndexCriteria[]{new CriteriaEquals(new LongValue(124L))},null));
+ table.deleteRows(index.buildAccessor(new IndexCriteria[]{new IndexEquals(new LongValue(124L))},null));
ts.commitTransaction();
// Go through the iterator to see if it's gone
@@ -410,8 +410,8 @@ public class SanityTest
ts.beginTransaction();
index = ts.lookupIndex("testindex");
accessor = index.buildAccessor(new IndexCriteria[]{
- new CriteriaEquals(new StringValue("hello")),
- new CriteriaBefore(new LongValue(123L))},null);
+ new IndexEquals(new StringValue("hello")),
+ new IndexBefore(new LongValue(123L))},null);
assertNotNull(accessor.getCurrentRowID());
value = accessor.getValue("colA");
assertNotNull(value);