Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 17
- name: Set up JDK 25
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
java-version: '17'
java-version: '25'
distribution: 'temurin'

- name: Cache Maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: adopt
java-version: 17
java-version: 25
- name: Build with Maven
run: mvn -B --no-transfer-progress -Prat -DskipTests verify -Dskip.format.code=false

Expand All @@ -52,7 +52,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [ 17 ]
java: [ 25 ]
experimental: [false]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Apache StormCrawler is an open source collection of resources for building low-l

## Quickstart

NOTE: These instructions assume that you have [Apache Maven](https://maven.apache.org/install.html) installed. You will need to install [Apache Storm 2.8.8](http://storm.apache.org/) to run the crawler.
NOTE: These instructions assume that you have [Apache Maven](https://maven.apache.org/install.html) installed. You will need to install [Apache Storm 3.0.0](http://storm.apache.org/) to run the crawler.

StormCrawler requires Java 17 or above. To execute tests, it requires you to have a locally installed and working Docker environment.
StormCrawler requires Java 25 or above. To execute tests, it requires you to have a locally installed and working Docker environment.

Once Storm is installed, the easiest way to get started is to generate a new StormCrawler project following the instructions below:

Expand Down Expand Up @@ -53,7 +53,7 @@ mvn clean install -Dskip.format.code=false

The requirements for building from source are as follows

- JDK 17+
- JDK 25+
- Apache Maven 3
- Docker (if you want to run tests)

Expand Down
65 changes: 33 additions & 32 deletions THIRD-PARTY.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion archetype/src/main/resources/archetype-resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Have a look at the code and resources and modify them to your heart's content.

## Native

You need to install Apache Storm. The instructions on [setting up a Storm cluster](https://storm.apache.org/releases/2.8.8/Setting-up-a-Storm-cluster.html) should help.
You need to install Apache Storm. The instructions on [setting up a Storm cluster](https://storm.apache.org/releases/3.0.0/Setting-up-a-Storm-cluster.html) should help.
You also need to have an instance of URLFrontier running. See [the URLFrontier README](https://github.com/crawler-commons/url-frontier/tree/master/service); the easiest way is to use Docker, like so:

```
Expand Down
6 changes: 3 additions & 3 deletions archetype/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<stormcrawler.version>${project.version}</stormcrawler.version>
<storm.version>2.8.8</storm.version>
<storm.version>3.0.0</storm.version>
<urlfrontier.version>2.4</urlfrontier.version>
</properties>

Expand All @@ -43,8 +43,8 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>25</source>
<target>25</target>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/quick-start.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ These instructions should help you get Apache StormCrawler up and running in 5 t

=== Prerequisites

To run StormCrawler, you will need Java SE 17 or later.
To run StormCrawler, you will need Java SE 25 or later.

Additionally, since we'll be running the required Apache Storm cluster using Docker Compose,
make sure Docker is installed on your operating system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<stormcrawler.version>${StormCrawlerVersion}</stormcrawler.version>
<storm.version>2.8.8</storm.version>
<storm.version>3.0.0</storm.version>
</properties>

<build>
Expand All @@ -44,8 +44,8 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>25</source>
<target>25</target>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion external/solr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You'll be asked to enter a groupId (e.g. com.mycompany.crawler), an artefactId (

This will not only create a fully formed project containing a POM with the dependency above but also a set of resources, configuration files and sample topology classes. Enter the directory you just created (should be the same as the artefactId you specified earlier) and follow the instructions on the README file.

You will of course need to have both Apache Storm (2.8.8) and Apache Solr (10.0.0) installed.
You will of course need to have both Apache Storm (3.0.0) and Apache Solr (10.0.0) installed.

Official references:
* [Apache Storm: Setting Up a Development Environment](https://storm.apache.org/releases/current/Setting-up-development-environment.html)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This has been generated by the StormCrawler Maven Archetype as a starting point for building your own crawler with [Apache Solr](https://solr.apache.org/) as a backend.
Have a look at the code and resources and modify them to your heart's content.

You need to have Apache Storm (2.8.8) installed, as well as a running instance of Apache Solr (9.8.0).
You need to have Apache Storm (3.0.0) installed, as well as a running instance of Apache Solr (9.8.0).

## Generated resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<stormcrawler.version>${StormCrawlerVersion}</stormcrawler.version>
<storm.version>2.8.8</storm.version>
<storm.version>3.0.0</storm.version>
</properties>

<build>
Expand All @@ -44,8 +44,8 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>25</source>
<target>25</target>
</configuration>
</plugin>
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions external/warc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ Please note that in order to access WARC files on AWS S3, you will need to add t
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-aws</artifactId>
<version>2.10.1</version>
<version>3.5.0</version>
</dependency>
```

where the version should match the one used by Apache Storm. In doubt, you can check with

```
mvn dependency:tree | grep "org.apache.hadoop:hadoop-hdfs:jar"
mvn dependency:tree | grep "org.apache.hadoop:hadoop-client-api:jar"
```


Expand Down
17 changes: 2 additions & 15 deletions external/warc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,9 @@ under the License.
<version>${storm-client.version}</version>
<exclusions>
<exclusion>
<!-- not available with Java 9 and higher -->
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
<exclusion>
<!-- subdependency JMS can't be found -->
<groupId>org.apache.hive.hcatalog</groupId>
<artifactId>hive-webhcat-java-client</artifactId>
</exclusion>
<exclusion>
<!-- only needed by the AutoHBase credentials plugin -->
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hive.hcatalog</groupId>
<artifactId>hive-hcatalog-streaming</artifactId>
<artifactId>hbase-client</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@

package org.apache.stormcrawler.warc;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPOutputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
import org.apache.storm.hdfs.bolt.HdfsBolt;
import org.apache.storm.hdfs.bolt.format.RecordFormat;
import org.apache.storm.hdfs.common.AbstractHDFSWriter;
import org.apache.storm.hdfs.common.HDFSWriter;
import org.apache.storm.tuple.Tuple;
import org.apache.storm.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -34,6 +35,15 @@ public class GzipHdfsBolt extends HdfsBolt {

private static final Logger LOG = LoggerFactory.getLogger(GzipHdfsBolt.class);

/** Compresses the given bytes into a standalone gzip container. */
protected static byte[] gzip(byte[] bytes) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream(bytes.length / 2 + 64);
try (GZIPOutputStream gzos = new GZIPOutputStream(bos)) {
gzos.write(bytes);
}
return bos.toByteArray();
}

protected transient FSDataOutputStream out = null;

protected RecordFormat format;
Expand All @@ -59,7 +69,7 @@ public byte[] format(Tuple tuple) {
if (bytes.length == 0 && !compressEmpty) {
return new byte[0];
}
return Utils.gzip(bytes);
return gzip(bytes);
} catch (Exception e) {
LOG.error("Exception caught when formatting - skipping the whole tuple");
return new byte[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.tuple.Tuple;
import org.apache.storm.utils.Utils;
import org.apache.stormcrawler.protocol.ProtocolResponse;
import org.apache.stormcrawler.util.ConfUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -102,7 +101,7 @@ protected AbstractHDFSWriter makeNewWriter(Path path, Tuple tuple) throws IOExce

// write the header at the beginning of the file
if (header != null && header.length > 0) {
super.out.write(Utils.gzip(header));
super.out.write(gzip(header));
}

return writer;
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ under the License.
<additionalparam>-Xdoclint:none</additionalparam>
<!-- dependency versions -->
<junit.version>6.1.2</junit.version>
<storm-client.version>2.8.8</storm-client.version>
<storm-client.version>3.0.0</storm-client.version>
<!-- Jackson's version should be in-line with the one in Storm -->
<jackson-annotations.version>2.21</jackson-annotations.version>
<jackson.version>2.21.3</jackson.version>
Expand Down Expand Up @@ -95,8 +95,8 @@ under the License.

<skip.format.code>true</skip.format.code>

<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>

<apache-jar-resource-bundle.version>1.7</apache-jar-resource-bundle.version>
</properties>
Expand All @@ -117,9 +117,9 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<source>17</source>
<target>17</target>
<release>17</release>
<source>25</source>
<target>25</target>
<release>25</release>
</configuration>
</plugin>
<plugin>
Expand All @@ -128,7 +128,7 @@ under the License.
<version>3.12.0</version>
<configuration>
<doclint>none</doclint>
<release>17</release>
<release>25</release>
<sourcepath>src/main/java</sourcepath>
</configuration>
<executions>
Expand Down
Loading