Apache Solr open-source search software
Reviewing streaming code and making small clean ups. (#2558)
Eric Pugh47d554723815
diff --git a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.javaindex e47bfd90da8..37049baaad4 100644--- a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java+++ b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java@@ -97,7 +97,7 @@ public class FieldComparator implements StreamComparator {}/*- * What're we doing here messing around with lambdas for the comparator logic?+ * What are we doing here messing around with lambdas for the comparator logic?* We want the compare(...) function to run as fast as possible because it will be called many many* times over the lifetime of this object. For that reason we want to limit the number of comparisons* taking place in the compare(...) function. Because this class supports both ascending anddiff --git a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/eval/AscEvaluator.java b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/eval/AscEvaluator.javaindex abcb9752372..015dafeb879 100644--- a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/eval/AscEvaluator.java+++ b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/eval/AscEvaluator.java@@ -75,7 +75,7 @@ public class AscEvaluator extends RecursiveObjectEvaluator implements OneValueWothrow new IOException(String.format(Locale.ROOT,- "Invalid expression %s - value %s is of type %s but we are expeting type %s",+ "Invalid expression %s - value %s is of type %s but we are expecting type %s",toExpression(constructingFactory),item.toString(),item.getClass().getSimpleName(),diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.javaindex b6e9fe36354..0b5053b7a20 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java@@ -1,7 +1,7 @@/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with- * this work for multitional information regarding copyright ownership.+ * 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 atdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ConversionEvaluatorsTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ConversionEvaluatorsTest.javaindex 60f42b7d155..614cab5ad73 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ConversionEvaluatorsTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ConversionEvaluatorsTest.java@@ -47,7 +47,7 @@ public class ConversionEvaluatorsTest extends SolrTestCase {}@Test- public void testInvalidExpression() throws Exception {+ public void testInvalidExpression() {StreamEvaluator evaluator;diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.javaindex 935175f144a..73b521cf413 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java@@ -1,7 +1,7 @@/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with- * this work for multitional information regarding copyright ownership.+ * 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 atdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.javaindex 413049268d7..e2b3f2e11d2 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java@@ -36,7 +36,6 @@ public class FieldValueEvaluatorTest extends SolrTestCase {values = new HashMap<>();}- @SuppressWarnings("serial")@Testpublic void listTypes() throws Exception {values.clear();@@ -87,7 +86,6 @@ public class FieldValueEvaluatorTest extends SolrTestCase {"second", ((Collection<?>) new FieldValueEvaluator("e").evaluate(tuple)).toArray()[1]);}- @SuppressWarnings("serial")@Testpublic void iterableTypes() throws Exception {values.clear();diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.javaindex d61be7821a8..7a9319b5634 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java@@ -1,7 +1,7 @@/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with- * this work for multitional information regarding copyright ownership.+ * 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 atdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.javaindex b363ab4cc0c..a2f368d6d81 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java@@ -1,7 +1,7 @@/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with- * this work for multitional information regarding copyright ownership.+ * 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 atdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.javaindex 817b04c86f9..287bc939e50 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java@@ -1,7 +1,7 @@/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with- * this work for multitional information regarding copyright ownership.+ * 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 atdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.javaindex 0ca2eeaf3cb..91063467ee1 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java@@ -1,7 +1,7 @@/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with- * this work for subitional information regarding copyright ownership.+ * 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 atdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.javaindex ade96428b16..2701f55cd66 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/eval/TemporalEvaluatorsTest.java@@ -81,7 +81,7 @@ public class TemporalEvaluatorsTest extends SolrTestCase {}@Test- public void testInvalidExpression() throws Exception {+ public void testInvalidExpression() {StreamEvaluator evaluator;@@ -175,7 +175,7 @@ public class TemporalEvaluatorsTest extends SolrTestCase {testFunction("quarter(a)", "1995-12-31T23:59:59Z", 4L);testFunction("week(a)", "1995-12-31T23:59:59Z", 52L);testFunction("second(a)", "1995-12-31T23:59:58Z", 58L);- testFunction("epoch(a)", "1995-12-31T23:59:59Z", 820454399000l);+ testFunction("epoch(a)", "1995-12-31T23:59:59Z", 820454399000L);testFunction("year(a)", "2017-03-17T10:30:45Z", 2017L);testFunction("year('a')", "2017-03-17T10:30:45Z", 2017L);@@ -189,10 +189,10 @@ public class TemporalEvaluatorsTest extends SolrTestCase {testFunction("quarter(a)", "2017-03-17T10:30:45Z", 1L);testFunction("week(a)", "2017-03-17T10:30:45Z", 11L);testFunction("second(a)", "2017-03-17T10:30:45Z", 45L);- testFunction("epoch(a)", "2017-03-17T10:30:45Z", 1489746645000l);+ testFunction("epoch(a)", "2017-03-17T10:30:45Z", 1489746645000L);- testFunction("epoch(a)", new Date(1489746645500l).toInstant().toString(), 1489746645500l);- testFunction("epoch(a)", new Date(820454399990l).toInstant().toString(), 820454399990l);+ testFunction("epoch(a)", new Date(1489746645500L).toInstant().toString(), 1489746645500L);+ testFunction("epoch(a)", new Date(820454399990L).toInstant().toString(), 820454399990L);}@Test@@ -238,7 +238,7 @@ public class TemporalEvaluatorsTest extends SolrTestCase {@Testpublic void testFunctionsOnLong() throws Exception {- Long longDate = 1512518340000l;+ Long longDate = 1512518340000L;testFunction("year(a)", longDate, 2017);testFunction("month(a)", longDate, 12);diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParserTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParserTest.javaindex 915a64f030e..36f6bc348bd 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParserTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParserTest.java@@ -27,7 +27,7 @@ public class StreamExpressionParserTest extends SolrTestCase {}@Test- public void testParsing() throws Exception {+ public void testParsing() {StreamExpression actual, expected;actual = StreamExpressionParser.parse("aliases(a_i=alias.a_i)");diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ops/ConcatOperationTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ops/ConcatOperationTest.javaindex 029176c75fb..3a1e0326c6f 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ops/ConcatOperationTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ops/ConcatOperationTest.java@@ -40,7 +40,7 @@ public class ConcatOperationTest extends SolrTestCase {}@Test- public void concatSingleField() throws Exception {+ public void concatSingleField() {Tuple tuple;StreamOperation operation;@@ -59,7 +59,7 @@ public class ConcatOperationTest extends SolrTestCase {}@Test- public void concatMultipleFields() throws Exception {+ public void concatMultipleFields() {Tuple tuple;StreamOperation operation;@@ -79,7 +79,7 @@ public class ConcatOperationTest extends SolrTestCase {assertNotNull(tuple.get("fieldABConcat"));assertEquals("bar-baz", tuple.get("fieldABConcat"));- // do the same in oposite order+ // do the same in reverse orderoperation = new ConcatOperation(new String[] {"fieldB", "fieldA"}, "fieldABConcat", "-");tuple = new Tuple(values);operation.operate(tuple);@@ -95,7 +95,7 @@ public class ConcatOperationTest extends SolrTestCase {}@Test- public void concatMultipleFieldsWithIgnoredFields() throws Exception {+ public void concatMultipleFieldsWithIgnoredFields() {Tuple tuple;StreamOperation operation;@@ -123,7 +123,7 @@ public class ConcatOperationTest extends SolrTestCase {assertNotNull(tuple.get("fieldABConcat"));assertEquals("bar-baz", tuple.get("fieldABConcat"));- // do the same in oposite order+ // do the same in opposite orderoperation = new ConcatOperation(new String[] {"fieldB", "fieldA"}, "fieldABConcat", "-");tuple = new Tuple(values);operation.operate(tuple);@@ -139,7 +139,7 @@ public class ConcatOperationTest extends SolrTestCase {}@Test- public void concatWithNullValues() throws Exception {+ public void concatWithNullValues() {Tuple tuple;StreamOperation operation;@@ -207,7 +207,7 @@ public class ConcatOperationTest extends SolrTestCase {assertNotNull(tuple.get("fieldABConcat"));assertEquals("bar-baz", tuple.get("fieldABConcat"));- // do the same in oposite order+ // do the same in opposite orderoperation =new ConcatOperation(StreamExpressionParser.parse(@@ -259,7 +259,7 @@ public class ConcatOperationTest extends SolrTestCase {assertNotNull(tuple.get("fieldABConcat"));assertEquals("bar-baz", tuple.get("fieldABConcat"));- // do the same in oposite order+ // do the same in opposite orderoperation =new ConcatOperation(StreamExpressionParser.parse(