tuples = getTuples(stream);
- for (Tuple tuple : tuples) {
- idToLabel.put(tuple.getString("id"), tuple.getDouble(outField));
- }
- return idToLabel;
- }
-
@Test
public void testBasicTextLogitStream() throws Exception {
Assume.assumeTrue(!useAlias);
@@ -4047,7 +4036,7 @@ public void testSignificantTermsStream() throws Exception {
assertEquals(5600, tuples.get(1).getLong("background").longValue());
assertEquals(5000, tuples.get(1).getLong("foreground").longValue());
- // Execersise the /stream hander
+ // Exercise the /stream handler
// Add the shards http parameter for the myCollection
StringBuilder buf = new StringBuilder();
@@ -4108,7 +4097,7 @@ public void tooLargeForGetRequest() throws IOException, SolrServerException {
StreamContext streamContext = new StreamContext();
streamContext.setSolrClientCache(cache);
// use filter() to allow being parsed as 'terms in set' query instead of a (weighted/scored)
- // BooleanQuery so we don't trip too many boolean clauses
+ // BooleanQuery, so we don't trip too many boolean clauses
String longQuery =
"\"filter(id:("
+ IntStream.range(0, 4000).mapToObj(i -> "a").collect(Collectors.joining(" ", "", ""))
@@ -4374,7 +4363,7 @@ private static Path findUserFilesDataDir() {
/**
* Creates a tree of files underneath a provided data-directory.
*
- * The filetree created looks like:
+ *
The file tree created looks like:
*
*
* dataDir
diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpressionTest.java
similarity index 98%
rename from solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
rename to solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpressionTest.java
index 2c941f142d7..37429f7a939 100644
--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpressionTest.java
@@ -30,11 +30,11 @@
import org.junit.Test;
/** */
-public class StreamExpressionToExpessionTest extends SolrTestCase {
+public class StreamExpressionToExpressionTest extends SolrTestCase {
- private StreamFactory factory;
+ private final StreamFactory factory;
- public StreamExpressionToExpessionTest() {
+ public StreamExpressionToExpressionTest() {
super();
factory =
@@ -77,7 +77,6 @@ public void testCloudSolrStream() throws Exception {
"search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f\", sort=\"a_f asc, a_i asc\", fq=\"a_s:one\", fq=\"a_s:two\")"),
factory)) {
expressionString = stream.toExpression(factory).toString();
- System.out.println("ExpressionString: " + expressionString.toString());
assertTrue(expressionString.contains("search(collection1,"));
assertTrue(expressionString.contains("q=\"*:*\""));
assertTrue(expressionString.contains("fl=\"id,a_s,a_i,a_f\""));
@@ -550,7 +549,7 @@ public void testCloudSolrStreamWithEscapedQuote() throws Exception {
// The purpose of this test is to ensure that a parameter with a contained " character is
// properly escaped when it is turned back into an expression. This is important when an
- // expression is passedto a worker (parallel stream) or even for other reasons when an
+ // expression is passed to a worker (parallel stream) or even for other reasons when an
// expression is string-ified.
// Basic test
diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java
index d8770711876..42252add70c 100644
--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java
+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java
@@ -89,13 +89,12 @@ public class StreamingTest extends SolrCloudTestCase {
private static String zkHost;
- private static int numShards;
private static int numWorkers;
private static boolean useAlias;
@BeforeClass
public static void configureCluster() throws Exception {
- numShards = random().nextInt(2) + 1; // 1 - 3
+ int numShards = random().nextInt(2) + 1; // 1 - 3
numWorkers = numShards > 2 ? random().nextInt(numShards - 1) + 1 : numShards;
configureCluster(numShards)
.addConfig(