Skip to content

(#2) Make indexer-elastic work with ES8.#3

Open
blairlearn wants to merge 1 commit into
nci-developfrom
v1.22-with-es8
Open

(#2) Make indexer-elastic work with ES8.#3
blairlearn wants to merge 1 commit into
nci-developfrom
v1.22-with-es8

Conversation

@blairlearn

@blairlearn blairlearn commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Dockerfile

  • Build with the v1.22-with-es8 branch.
  • Build and run Nutch with Java 17.

Address vulnerabilities

  • Update all io.netty packages to 4.1.135.Final
  • Update org.apache.cxf to v3.6.11
  • Update log4j to 2.25.4
  • Update org.apache.tika to 3.3.1.
  • Force override of Hadoop-managed packages:
    • com.nimbusds/nimbus-jose-jwt -> 9.37.4
    • org.apache.zookeeper/zookeeper -> 3.8.6
    • org.apache.zookeeper/zookeeper-jute -> 3.8.6
  • Update Jackson set to 2.18.6
  • Explicitly set jackson-core to 2.18.6
  • Override org.bouncycastle for org.apache.cxf, forcing to v1.84.
  • Override org.apache.commons2 for org.apache.hadoop, forcing to v2.15.0

Closes #2

@blairlearn blairlearn changed the title (#2) Make indexer-elastic to work with ES8. (#2) Make indexer-elastic work with ES8. Jul 16, 2026
@blairlearn
blairlearn force-pushed the v1.22-with-es8 branch 4 times, most recently from 0768cec to 0f3bf1f Compare July 21, 2026 21:03
- Rewrite ElasticIndexRewriter to use elasticsearch-java-8.16.7.
- Add unit tests for ElasticIndexWriter.
- Add nci-develop to list of pull-request build triggers.
- Build/run on OpenJDK 17.
  - This mirrors the apache/nutch master branch.
  - Continues to target 11 for runtime.
- Force curl to use HTTP 1.1 in scripts to avoid CVE-2026-27135
- Update packages:
  - all io.netty packages to 4.1.135.Final
  - org.apache.cxf to v3.6.11
  - log4j from 2.52.2 to 2.25.4
  - org.apache.tika to 3.3.1.
-Added forced Hadoop-managed overrides:
  - com.nimbusds/nimbus-jose-jwt -> 9.37.4
  - org.apache.zookeeper/zookeeper -> 3.8.6
  - org.apache.zookeeper/zookeeper-jute -> 3.8.6
- Bumped root Jackson set to 2.18.6
- Added explicit jackson-core 2.18.6
- Override org.bouncycastle for org.apache.cxf, forcing it to v1.84.
- Override org.apache.commons2 for org.apache.hadoop, forcing to v2.15.0
@blairlearn
blairlearn marked this pull request as ready for review July 21, 2026 21:21
Copilot AI review requested due to automatic review settings July 21, 2026 21:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Nutch’s Elasticsearch indexer plugin to work with Elasticsearch 8 by migrating from the deprecated high-level REST client/BulkProcessor to the Elasticsearch Java API Client and BulkIngester. It also bumps multiple dependency versions to address vulnerabilities and adds Testcontainers-based integration testing plus CI wiring to exercise indexer plugins.

Changes:

  • Migrate indexer-elastic to ES8 client APIs (Java API Client + low-level REST client) and implement bulk retry handling.
  • Add Testcontainers-powered integration test scaffolding for index writers and wire new Ant/CI targets to run them.
  • Update plugin/core dependency pins (Netty, Tika, CXF, Log4j, Jackson, etc.) and refresh binary NOTICE/LICENSE entries accordingly.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/test/org/apache/nutch/indexer/IndexWriterIntegrationTest.java Introduces an integration-test contract for IndexWriter implementations.
src/test/org/apache/nutch/indexer/AbstractIndexWriterIT.java Adds shared Testcontainers-oriented integration test logic for IndexWriters.
src/plugin/protocol-http/ivy.xml Scopes LittleProxy dependency to tests.
src/plugin/parse-tika/plugin.xml Updates bundled Tika dependency jar list to match newer Tika/parsers stack.
src/plugin/parse-tika/ivy.xml Bumps Tika parser/boilerpipe artifacts to 3.3.1.
src/plugin/lib-htmlunit/plugin.xml Updates Netty jar versions embedded in the plugin runtime manifest.
src/plugin/lib-htmlunit/ivy.xml Forces Netty modules to 4.1.135.Final for this plugin.
src/plugin/language-identifier/plugin.xml Updates bundled jar list for Tika language detector dependencies.
src/plugin/language-identifier/ivy.xml Bumps tika-langdetect-optimaize to 3.3.1.
src/plugin/indexer-solr/plugin.xml Updates Netty jar versions referenced by the Solr indexer plugin.
src/plugin/indexer-solr/ivy.xml Forces Netty modules to 4.1.135.Final for Solr indexer dependencies.
src/plugin/indexer-kafka/plugin.xml Updates Netty jar versions referenced by the Kafka indexer plugin.
src/plugin/indexer-kafka/ivy.xml Forces Netty modules to 4.1.135.Final for Kafka indexer dependencies.
src/plugin/indexer-elastic/src/test/org/apache/nutch/indexwriter/elastic/TestElasticIndexWriter.java Adds unit tests for ES8 writer mapping and retry/backoff helpers.
src/plugin/indexer-elastic/src/test/org/apache/nutch/indexwriter/elastic/ElasticIndexWriterIT.java Adds ES8 Testcontainers integration tests for indexing and delete behavior.
src/plugin/indexer-elastic/src/java/org/apache/nutch/indexwriter/elastic/ElasticIndexWriter.java Core ES8 migration: new client, BulkIngester ingestion, and retry handling.
src/plugin/indexer-elastic/README.md Updates docs to reflect REST port 9200 and new BulkIngester-based retry descriptions.
src/plugin/indexer-elastic/plugin.xml Replaces ES7-era runtime jar list with ES8 client/runtime dependencies.
src/plugin/indexer-elastic/ivy.xml Updates dependencies to ES8 client libs and adds Testcontainers Elasticsearch test dependency.
src/plugin/indexer-elastic/howto_upgrade_es.md Refreshes upgrade instructions for ES8 client artifacts and new plugin.xml section markers.
src/plugin/build.xml Adds a top-level plugin target to run indexer integration tests.
src/plugin/build-plugin.xml Adds integration-test target + ensures test dependency resolution and includes Testcontainers jars on test classpath.
NOTICE-binary Updates binary notice entries for new/removed Elasticsearch-related dependencies.
LICENSE-binary Updates binary license list to reflect new/removed Elasticsearch-related dependencies.
ivy/ivy.xml Updates core dependency pins (Log4j, CXF, Jackson, Tika, Netty, security overrides) and adds Testcontainers test deps.
docker/Dockerfile Switches Docker build to Java 17 and builds from a specific fork branch.
build.xml Adds a top-level Ant target to run indexer integration tests.
.github/workflows/master-build.yml Expands PR branch trigger and adds a CI step to run indexer integration tests on relevant changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 324 to +331
public void close() throws IOException {
// Close BulkProcessor (automatically flushes)
IOException closeException = null;
try {
bulkProcessor.awaitClose(bulkCloseTimeout, TimeUnit.SECONDS);
if (bulkIngester != null) {
bulkIngester.flush();
awaitBulkCompletion(bulkCloseTimeout, TimeUnit.SECONDS);
bulkIngester.close();
}
Comment on lines +416 to +430
long delayMillis = computeExponentialBackoffMillis(expBackoffMillis,
context.attempt);
RetryContext retryContext = context.nextAttempt();
scheduledRetries.incrementAndGet();
retryScheduler.schedule(() -> {
try {
bulkIngester.add(retryContext.operation, retryContext);
} catch (RuntimeException e) {
LOG.error("Elasticsearch retry failed for {}:", retryContext.description, e);
} finally {
scheduledRetries.decrementAndGet();
}
}, delayMillis, TimeUnit.MILLISECONDS);
LOG.debug("Scheduled Elasticsearch retry for {} in {} ms after {}",
context.description, delayMillis, reason);
Comment thread ivy/ivy.xml
Comment on lines +137 to +139
<!-- Testcontainers for indexer plugin integration tests -->
<dependency org="org.testcontainers" name="testcontainers" rev="2.0.3" conf="test->default"/>
<dependency org="org.testcontainers" name="junit-jupiter" rev="1.21.4" conf="test->default"/>
@blairlearn
blairlearn requested a review from bryanpizzillo July 21, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabler: Update indexer-elastic to Elasticsearch 8.

2 participants