summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/amazon/carbonado/qe/CompositeScore.java38
-rw-r--r--src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java9
-rw-r--r--src/main/java/com/amazon/carbonado/qe/OrderingScore.java38
-rw-r--r--src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java7
-rw-r--r--src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java18
-rw-r--r--src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java42
-rw-r--r--src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java2
7 files changed, 35 insertions, 119 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java
index be4ceb7..2a85a32 100644
--- a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java
+++ b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java
@@ -45,22 +45,7 @@ public class CompositeScore<S extends Storable> {
*
* @param index index to evaluate
* @param filter optional filter which cannot contain any logical 'or' operations.
- * @throws IllegalArgumentException if index is null or filter is not supported
- */
- public static <S extends Storable> CompositeScore<S> evaluate
- (StorableIndex<S> index,
- Filter<S> filter)
- {
- return evaluate(index, filter, null);
- }
-
- /**
- * Evaluates the given index for its filtering and ordering capabilities
- * against the given filter and order-by properties.
- *
- * @param index index to evaluate
- * @param filter optional filter which cannot contain any logical 'or' operations.
- * @param orderings properties which define desired ordering
+ * @param orderings optional properties which define desired ordering
* @throws IllegalArgumentException if index is null or filter is not supported
*/
public static <S extends Storable> CompositeScore<S> evaluate
@@ -87,26 +72,7 @@ public class CompositeScore<S extends Storable> {
* @param unique true if index is unique
* @param clustered true if index is clustered
* @param filter optional filter which cannot contain any logical 'or' operations.
- * @throws IllegalArgumentException if index is null or filter is not supported
- */
- public static <S extends Storable> CompositeScore<S> evaluate
- (OrderedProperty<S>[] indexProperties,
- boolean unique,
- boolean clustered,
- Filter<S> filter)
- {
- return evaluate(indexProperties, unique, clustered, filter, null);
- }
-
- /**
- * Evaluates the given index properties for its filtering and ordering
- * capabilities against the given filter and order-by properties.
- *
- * @param indexProperties index properties to evaluate
- * @param unique true if index is unique
- * @param clustered true if index is clustered
- * @param filter optional filter which cannot contain any logical 'or' operations.
- * @param orderings properties which define desired ordering
+ * @param orderings optional properties which define desired ordering
* @throws IllegalArgumentException if index is null or filter is not supported
*/
public static <S extends Storable> CompositeScore<S> evaluate
diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
index 92c21dd..23ec0d1 100644
--- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
@@ -76,15 +76,6 @@ public class IndexedQueryAnalyzer<S extends Storable> {
/**
* @param filter optional filter which which must be {@link Filter#isBound
* bound} and cannot contain any logical 'or' operations.
- * @throws IllegalArgumentException if filter is not supported
- */
- public Result analyze(Filter<S> filter) {
- return analyze(filter, null);
- }
-
- /**
- * @param filter optional filter which which must be {@link Filter#isBound
- * bound} and cannot contain any logical 'or' operations.
* @param orderings optional properties which define desired ordering
* @throws IllegalArgumentException if filter is not supported
*/
diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java
index 67edcdd..843e22d 100644
--- a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java
+++ b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java
@@ -68,22 +68,7 @@ public class OrderingScore<S extends Storable> {
*
* @param index index to evaluate
* @param filter optional filter which cannot contain any logical 'or' operations.
- * @throws IllegalArgumentException if index is null or filter is not supported
- */
- public static <S extends Storable> OrderingScore<S> evaluate
- (StorableIndex<S> index,
- Filter<S> filter)
- {
- return evaluate(index, filter, null);
- }
-
- /**
- * Evaluates the given index for its ordering capabilities against the
- * given filter and order-by properties.
- *
- * @param index index to evaluate
- * @param filter optional filter which cannot contain any logical 'or' operations.
- * @param orderings properties which define desired ordering
+ * @param orderings optional properties which define desired ordering
* @throws IllegalArgumentException if index is null or filter is not supported
*/
public static <S extends Storable> OrderingScore<S> evaluate
@@ -110,26 +95,7 @@ public class OrderingScore<S extends Storable> {
* @param unique true if index is unique
* @param clustered true if index is clustered
* @param filter optional filter which cannot contain any logical 'or' operations.
- * @throws IllegalArgumentException if index is null or filter is not supported
- */
- public static <S extends Storable> OrderingScore<S> evaluate
- (OrderedProperty<S>[] indexProperties,
- boolean unique,
- boolean clustered,
- Filter<S> filter)
- {
- return evaluate(indexProperties, unique, clustered, filter, null);
- }
-
- /**
- * Evaluates the given index properties for its ordering capabilities
- * against the given filter and order-by properties.
- *
- * @param indexProperties index properties to evaluate
- * @param unique true if index is unique
- * @param clustered true if index is clustered
- * @param filter optional filter which cannot contain any logical 'or' operations.
- * @param orderings properties which define desired ordering
+ * @param orderings optional properties which define desired ordering
* @throws IllegalArgumentException if index is null or filter is not supported
*/
public static <S extends Storable> OrderingScore<S> evaluate
diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
index b4e45fa..b07934c 100644
--- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
@@ -59,13 +59,6 @@ public class UnionQueryAnalyzer<S extends Storable> {
/**
* @param filter optional filter which must be {@link Filter#isBound bound}
- */
- public Result analyze(Filter<S> filter) {
- return analyze(filter, null);
- }
-
- /**
- * @param filter optional filter which must be {@link Filter#isBound bound}
* @param orderings optional properties which define desired ordering
*/
public Result analyze(Filter<S> filter, List<OrderedProperty<S>> orderings) {
diff --git a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java
index 85c78cb..166d6e6 100644
--- a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java
+++ b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryAnalyzer.java
@@ -71,7 +71,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Address.class, IxProvider.INSTANCE);
Filter<Address> filter = Filter.filterFor(Address.class, "addressZip = ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertFalse(result.handlesAnything());
assertEquals(filter, result.getCompositeScore().getFilteringScore().getRemainderFilter());
@@ -84,7 +84,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Address.class, IxProvider.INSTANCE);
Filter<Address> filter = Filter.filterFor(Address.class, "addressID = ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter());
@@ -97,7 +97,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Shipment.class, IxProvider.INSTANCE);
Filter<Shipment> filter = Filter.filterFor(Shipment.class, "shipmentID = ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter());
@@ -107,7 +107,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
filter = Filter.filterFor(Shipment.class, "orderID = ?");
filter = filter.bind();
- result = iqa.analyze(filter);
+ result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter());
@@ -120,7 +120,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
IndexedQueryAnalyzer iqa = new IndexedQueryAnalyzer(Shipment.class, IxProvider.INSTANCE);
Filter<Shipment> filter = Filter.filterFor(Shipment.class, "order.orderTotal >= ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertTrue(result.getCompositeScore().getFilteringScore().hasRangeStart());
@@ -136,7 +136,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
Filter<Shipment> filter = Filter.filterFor
(Shipment.class, "shipmentNotes = ? & order.orderTotal >= ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertTrue(result.getCompositeScore().getFilteringScore().hasRangeStart());
@@ -155,7 +155,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
Filter<Shipment> filter = Filter.filterFor
(Shipment.class, "orderID >= ? & order.orderTotal >= ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertTrue(result.getCompositeScore().getFilteringScore().hasRangeStart());
@@ -171,7 +171,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
Filter<Shipment> filter = Filter.filterFor
(Shipment.class, "order.address.addressState = ?");
filter = filter.bind();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertEquals(filter, result.getCompositeScore().getFilteringScore().getIdentityFilter());
@@ -189,7 +189,7 @@ public class TestIndexedQueryAnalyzer extends TestCase {
(Shipment.class, "order.address.addressState = ? & order.address.addressZip = ?");
FilterValues<Shipment> values = filter.initialFilterValues();
filter = values.getFilter();
- IndexedQueryAnalyzer.Result result = iqa.analyze(filter);
+ IndexedQueryAnalyzer.Result result = iqa.analyze(filter, null);
assertTrue(result.handlesAnything());
assertEquals(Filter.filterFor(Shipment.class, "order.address.addressState = ?").bind(),
diff --git a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java
index b3eef91..922266a 100644
--- a/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java
+++ b/src/test/java/com/amazon/carbonado/qe/TestIndexedQueryExecutor.java
@@ -76,7 +76,7 @@ public class TestIndexedQueryExecutor extends TestCase {
FilterValues<StorableTestBasic> values = filter.initialFilterValues();
filter = values.getFilter();
- CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter);
+ CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter, null);
Mock<StorableTestBasic> executor = new Mock(index, score);
@@ -96,7 +96,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -117,7 +117,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -140,7 +140,7 @@ public class TestIndexedQueryExecutor extends TestCase {
FilterValues<StorableTestBasic> values = filter.initialFilterValues();
filter = values.getFilter();
- CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter);
+ CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter, null);
Mock<StorableTestBasic> executor = new Mock(index, score);
@@ -159,7 +159,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -178,7 +178,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -197,7 +197,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -216,7 +216,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -235,7 +235,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -276,7 +276,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -339,7 +339,7 @@ public class TestIndexedQueryExecutor extends TestCase {
FilterValues<StorableTestBasic> values = filter.initialFilterValues();
filter = values.getFilter();
- CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter);
+ CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter, null);
Mock<StorableTestBasic> executor = new Mock(index, score);
@@ -358,7 +358,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -377,7 +377,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -396,7 +396,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -415,7 +415,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -434,7 +434,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -475,7 +475,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -541,7 +541,7 @@ public class TestIndexedQueryExecutor extends TestCase {
FilterValues<StorableTestBasic> values = filter.initialFilterValues();
filter = values.getFilter();
- CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter);
+ CompositeScore<StorableTestBasic> score = CompositeScore.evaluate(index, filter, null);
Mock<StorableTestBasic> executor = new Mock(index, score);
@@ -560,7 +560,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -580,7 +580,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
@@ -612,7 +612,7 @@ public class TestIndexedQueryExecutor extends TestCase {
values = filter.initialFilterValues();
filter = values.getFilter();
- score = CompositeScore.evaluate(index, filter);
+ score = CompositeScore.evaluate(index, filter, null);
executor = new Mock(index, score);
diff --git a/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java b/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java
index 1545b70..ac407ec 100644
--- a/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java
+++ b/src/test/java/com/amazon/carbonado/qe/TestOrderingScore.java
@@ -79,7 +79,7 @@ public class TestOrderingScore extends TestCase {
public void testEmpty() throws Exception {
StorableIndex<StorableTestBasic> ix = makeIndex(StorableTestBasic.class, "id");
- OrderingScore score = OrderingScore.evaluate(ix, null);
+ OrderingScore score = OrderingScore.evaluate(ix, null, null);
assertEquals(0, score.getHandledCount());
assertEquals(0, score.getRemainderCount());