This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new d9dfe20b8 TIKA-4321 -- rm solr 6 and 7 unit tests and turn logging to
error. (#1994)
d9dfe20b8 is described below
commit d9dfe20b806e7e1341fefa6bb84c9361ab37e361
Author: Tim Allison <[email protected]>
AuthorDate: Tue Oct 22 09:01:16 2024 -0400
TIKA-4321 -- rm solr 6 and 7 unit tests and turn logging to error. (#1994)
* TIKA-4321 -- rm solr 6 and 7 unit tests and turn logging to error.
---
.../tika/pipes/solr/tests/TikaPipesSolr6Test.java | 49 ----------------------
.../pipes/solr/tests/TikaPipesSolr6ZkTest.java | 41 ------------------
.../tika/pipes/solr/tests/TikaPipesSolr7Test.java | 33 ---------------
.../pipes/solr/tests/TikaPipesSolr7ZkTest.java | 42 -------------------
.../tika/pipes/solr/tests/TikaPipesSolr8Test.java | 2 +-
.../tika/pipes/solr/tests/TikaPipesSolr9Test.java | 2 +-
.../src/test/resources/log4j2.xml | 4 +-
tika-parent/pom.xml | 3 +-
.../tika/pipes/emitter/solr/SolrEmitter.java | 19 ++++++++-
.../pipesiterator/solr/SolrPipesIterator.java | 19 +++++++--
10 files changed, 38 insertions(+), 176 deletions(-)
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr6Test.java
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr6Test.java
deleted file mode 100644
index 3cb6a6d20..000000000
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr6Test.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.tika.pipes.solr.tests;
-
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import org.junit.jupiter.api.BeforeAll;
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-import org.apache.tika.utils.SystemUtils;
-
-@Testcontainers(disabledWithoutDocker = true)
-public class TikaPipesSolr6Test extends TikaPipesSolrTestBase {
- @BeforeAll
- public static void setUp() {
- assumeTrue(!SystemUtils.IS_OS_MAC_OSX &&
!SystemUtils.OS_VERSION.equals("12.6.1"),
- "This stopped working on macos x ... TIKA-3932");
- }
- @Override
- public boolean useZk() {
- return false;
- }
-
- @Override
- public String getSolrImageName() {
- return "solr:6";
- }
-
- @Override
- public boolean handlesParentChild() {
- //Solr 6 didn't automatically set _root_ with the parent-child
indexing,
- //apparently
- return false;
- }
-}
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr6ZkTest.java
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr6ZkTest.java
deleted file mode 100644
index 221d1e277..000000000
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr6ZkTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.tika.pipes.solr.tests;
-
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import org.junit.jupiter.api.BeforeAll;
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-import org.apache.tika.utils.SystemUtils;
-
-@Testcontainers(disabledWithoutDocker = true)
-public class TikaPipesSolr6ZkTest extends TikaPipesSolr6Test {
-
- @BeforeAll
- public static void setUp() {
- assumeTrue(
- SystemUtils.IS_OS_UNIX && !SystemUtils.IS_OS_MAC_OSX,
- "zk test only works on linux (and not mac os x)");
- }
-
- @Override
- public boolean useZk() {
- return true;
- }
-
-}
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr7Test.java
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr7Test.java
deleted file mode 100644
index efefedf44..000000000
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr7Test.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.tika.pipes.solr.tests;
-
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-@Testcontainers(disabledWithoutDocker = true)
-public class TikaPipesSolr7Test extends TikaPipesSolrTestBase {
-
- @Override
- public boolean useZk() {
- return false;
- }
-
- @Override
- public String getSolrImageName() {
- return "solr:7";
- }
-}
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr7ZkTest.java
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr7ZkTest.java
deleted file mode 100644
index 875afe223..000000000
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr7ZkTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.tika.pipes.solr.tests;
-
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
-
-import org.junit.jupiter.api.BeforeAll;
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-import org.apache.tika.utils.SystemUtils;
-
-@Testcontainers(disabledWithoutDocker = true)
-public class TikaPipesSolr7ZkTest extends TikaPipesSolr7Test {
-
- @BeforeAll
- public static void setUp() {
- assumeTrue(
- SystemUtils.IS_OS_UNIX && !SystemUtils.IS_OS_MAC_OSX,
- "zk test only works on linux (and not mac os x)");
- }
-
-
- @Override
- public boolean useZk() {
- return true;
- }
-
-}
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr8Test.java
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr8Test.java
index e04dc59fb..8b87db6a1 100644
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr8Test.java
+++
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr8Test.java
@@ -23,7 +23,7 @@ public class TikaPipesSolr8Test extends TikaPipesSolrTestBase
{
@Override
public String getSolrImageName() {
- return "solr:8.11.2";
+ return "solr:8.11.4";
}
@Override
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr9Test.java
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr9Test.java
index d4f7b7382..f60cdd696 100644
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr9Test.java
+++
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/java/org/apache/tika/pipes/solr/tests/TikaPipesSolr9Test.java
@@ -23,7 +23,7 @@ public class TikaPipesSolr9Test extends TikaPipesSolrTestBase
{
@Override
public String getSolrImageName() {
- return "solr:9.3";
+ return "solr:9.7.0";
}
@Override
diff --git
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/resources/log4j2.xml
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/resources/log4j2.xml
index c88e66e99..4b85ea2fe 100644
---
a/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/resources/log4j2.xml
+++
b/tika-integration-tests/tika-pipes-solr-integration-tests/src/test/resources/log4j2.xml
@@ -18,14 +18,14 @@
specific language governing permissions and limitations
under the License.
-->
-<Configuration status="WARN">
+<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_ERR">
<PatternLayout pattern="%-5p [%t] %d{HH:mm:ss,SSS} %c %m%n"/>
</Console>
</Appenders>
<Loggers>
- <Root level="info">
+ <Root level="error">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
diff --git a/tika-parent/pom.xml b/tika-parent/pom.xml
index d88443c0a..8838ffeac 100644
--- a/tika-parent/pom.xml
+++ b/tika-parent/pom.xml
@@ -428,8 +428,7 @@
<slf4j.version>2.0.16</slf4j.version>
<sis.version>1.4</sis.version>
<snappy.version>1.1.10.7</snappy.version>
- <!-- can't update because this requires non trivial changes in
SolrEmitter.initialize() -->
- <solrj.version>8.11.4</solrj.version>
+ <solrj.version>9.7.0</solrj.version>
<spring.version>6.1.14</spring.version>
<sqlite.version>3.46.1.3</sqlite.version>
<stax.ex.version>2.1.0</stax.ex.version>
diff --git
a/tika-pipes/tika-emitters/tika-emitter-solr/src/main/java/org/apache/tika/pipes/emitter/solr/SolrEmitter.java
b/tika-pipes/tika-emitters/tika-emitter-solr/src/main/java/org/apache/tika/pipes/emitter/solr/SolrEmitter.java
index a139b9b7b..d5655ddd9 100644
---
a/tika-pipes/tika-emitters/tika-emitter-solr/src/main/java/org/apache/tika/pipes/emitter/solr/SolrEmitter.java
+++
b/tika-pipes/tika-emitters/tika-emitter-solr/src/main/java/org/apache/tika/pipes/emitter/solr/SolrEmitter.java
@@ -25,9 +25,11 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
import org.apache.solr.client.solrj.impl.LBHttpSolrClient;
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.client.solrj.response.UpdateResponse;
@@ -46,6 +48,7 @@ import org.apache.tika.parser.ParseContext;
import org.apache.tika.pipes.emitter.AbstractEmitter;
import org.apache.tika.pipes.emitter.EmitData;
import org.apache.tika.pipes.emitter.TikaEmitterException;
+import org.apache.tika.utils.StringUtils;
public class SolrEmitter extends AbstractEmitter implements Initializable {
@@ -307,9 +310,21 @@ public class SolrEmitter extends AbstractEmitter
implements Initializable {
@Override
public void initialize(Map<String, Param> params) throws
TikaConfigException {
if (solrUrls == null || solrUrls.isEmpty()) {
+ //TODO -- there's more that we need to pass through, including ssl
etc.
+ Http2SolrClient.Builder http2SolrClientBuilder = new
Http2SolrClient.Builder();
+ if (!StringUtils.isBlank(httpClientFactory.getUserName())) {
+
http2SolrClientBuilder.withBasicAuthCredentials(httpClientFactory.getUserName(),
httpClientFactory.getPassword());
+ }
+ http2SolrClientBuilder
+ .withRequestTimeout(httpClientFactory.getRequestTimeout(),
TimeUnit.MILLISECONDS)
+ .withConnectionTimeout(connectionTimeout,
TimeUnit.MILLISECONDS);
+
+
+ Http2SolrClient http2SolrClient = http2SolrClientBuilder.build();
solrClient = new CloudSolrClient.Builder(solrZkHosts,
Optional.ofNullable(solrZkChroot))
-
.withConnectionTimeout(connectionTimeout).withSocketTimeout(socketTimeout)
- .withHttpClient(httpClientFactory.build()).build();
+ .withHttpClient(http2SolrClient)
+ .build();
+
} else {
solrClient = new
LBHttpSolrClient.Builder().withConnectionTimeout(connectionTimeout)
.withSocketTimeout(socketTimeout).withHttpClient(httpClientFactory.build())
diff --git
a/tika-pipes/tika-pipes-iterators/tika-pipes-iterator-solr/src/main/java/org/apache/tika/pipes/pipesiterator/solr/SolrPipesIterator.java
b/tika-pipes/tika-pipes-iterators/tika-pipes-iterator-solr/src/main/java/org/apache/tika/pipes/pipesiterator/solr/SolrPipesIterator.java
index 9ecead289..3681cdeb9 100644
---
a/tika-pipes/tika-pipes-iterators/tika-pipes-iterator-solr/src/main/java/org/apache/tika/pipes/pipesiterator/solr/SolrPipesIterator.java
+++
b/tika-pipes/tika-pipes-iterators/tika-pipes-iterator-solr/src/main/java/org/apache/tika/pipes/pipesiterator/solr/SolrPipesIterator.java
@@ -24,12 +24,14 @@ import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
import org.apache.solr.client.solrj.impl.LBHttpSolrClient;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
@@ -49,6 +51,7 @@ import org.apache.tika.pipes.HandlerConfig;
import org.apache.tika.pipes.emitter.EmitKey;
import org.apache.tika.pipes.fetcher.FetchKey;
import org.apache.tika.pipes.pipesiterator.PipesIterator;
+import org.apache.tika.utils.StringUtils;
/**
* Iterates through results from a Solr query.
@@ -232,11 +235,21 @@ public class SolrPipesIterator extends PipesIterator
implements Initializable {
private SolrClient createSolrClient() throws TikaConfigException {
if (solrUrls == null || solrUrls.isEmpty()) {
+ //TODO -- there's more that we need to pass through, including ssl
etc.
+ Http2SolrClient.Builder http2SolrClientBuilder = new
Http2SolrClient.Builder();
+ if (!StringUtils.isBlank(httpClientFactory.getUserName())) {
+
http2SolrClientBuilder.withBasicAuthCredentials(httpClientFactory.getUserName(),
httpClientFactory.getPassword());
+ }
+ http2SolrClientBuilder
+ .withRequestTimeout(httpClientFactory.getRequestTimeout(),
TimeUnit.MILLISECONDS)
+ .withConnectionTimeout(connectionTimeout,
TimeUnit.MILLISECONDS);
+
+
+ Http2SolrClient http2SolrClient = http2SolrClientBuilder.build();
return new CloudSolrClient.Builder(solrZkHosts,
Optional.ofNullable(solrZkChroot))
- .withHttpClient(httpClientFactory.build())
- .withConnectionTimeout(connectionTimeout)
- .withSocketTimeout(socketTimeout)
+ .withHttpClient(http2SolrClient)
.build();
+
}
return new LBHttpSolrClient.Builder()
.withConnectionTimeout(connectionTimeout)