Comments (5)
I had been meaning to do this. The challenge was that there was a single fetcher for the index fetcher and the file extractor. I've broken this out into the fetcher which pulls the literal bytes out of the WARC and the indexFetcher which grabs the index files. This means that you can now read index files from your local file system but still extract from the WARCs via s3 or https.
I've documented how to do this in https://github.com/tballison/commoncrawl-fetcher-lite/blob/main/AdvancedScenarios.md
I also fully bolded the point about having to download 300GB of index files for each month's run!
from commoncrawl-fetcher-lite.
Outstanding! Thanks, I will recompile after my current run is done. This will also help me identify new formats to create signatures for in PRONOM.
from commoncrawl-fetcher-lite.
https://github.com/tballison/commoncrawl-fetcher-lite/releases
from commoncrawl-fetcher-lite.
Would it make sense to be able to limit the number of index files downloaded? 300GB is a lot of data. Perhaps a setting that works like maxFilesExtracted to limit index files, maxIndexFilesDownloaded.
That way a user could use the local index files for repeat extractions of files without pulling down the whole 300GB.
from commoncrawl-fetcher-lite.
Also, in the event of a crash, does restarting the process skip already downloaded index files?
WARN [pool-2-thread-12] 15:23:06,761 org.tallison.cc.index.io.BackoffHttpFetcher got backoff warning (#4) for https://data.commoncrawl.org/cc-index/collections/CC-MAIN-2023-06/indexes/cdx-00280.gz. Will sleep 1800 seconds. Message: bad status code: 503 ::
SlowDown
Please reduce your request rate.4BN8B4E3MGZHXJ7PiV9YW4ma+StabztL8eBnfRuhvFhMithWHvv71OH8iPa3g6Z+vOLzHq1dvd+tSSaD236XSE5/UlJJdU4ZdCAH3w==.
INFO [pool-2-thread-7] 15:23:25,106 org.tallison.cc.index.extractor.CCIndexFetcher successfully downloaded: cc-index/collections/CC-MAIN-2023-06/indexes/cdx-00278.gz
INFO [pool-2-thread-7] 15:23:25,179 org.tallison.cc.index.extractor.CCIndexFetcher Index fetcher finished
INFO [pool-2-thread-19] 15:23:34,813 org.tallison.cc.index.extractor.CCIndexFetcher successfully downloaded: cc-index/collections/CC-MAIN-2023-06/indexes/cdx-00279.gz
INFO [pool-2-thread-19] 15:23:34,887 org.tallison.cc.index.extractor.CCIndexFetcher Index fetcher finished
INFO [pool-2-thread-14] 15:23:48,497 org.tallison.cc.index.extractor.CCIndexFetcher successfully downloaded: cc-index/collections/CC-MAIN-2023-06/indexes/cdx-00281.gz
INFO [pool-2-thread-14] 15:23:48,575 org.tallison.cc.index.extractor.CCIndexFetcher Index fetcher finished
ERROR [main] 15:50:13,007 org.tallison.cc.index.extractor.CCIndexFetcher main loop exception
java.util.concurrent.ExecutionException: org.tallison.cc.index.io.ThrottleException
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
at org.tallison.cc.index.extractor.CCIndexFetcher.execute(CCIndexFetcher.java:85) [commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.tallison.cc.index.extractor.CCIndexFetcher.main(CCIndexFetcher.java:57) [commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.tallison.cc.index.extractor.CCFetcherCli.main(CCFetcherCli.java:34) [commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
Caused by: org.tallison.cc.index.io.ThrottleException
at org.tallison.cc.index.io.BackoffHttpFetcher.fetchWithBackOff(BackoffHttpFetcher.java:103) ~[commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.tallison.cc.index.io.BackoffHttpFetcher.fetch(BackoffHttpFetcher.java:51) ~[commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.tallison.cc.index.extractor.CCIndexFetcher$IndexFetcher.fetch(CCIndexFetcher.java:135) ~[commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.tallison.cc.index.extractor.CCIndexFetcher$IndexFetcher.call(CCIndexFetcher.java:128) ~[commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at org.tallison.cc.index.extractor.CCIndexFetcher$IndexFetcher.call(CCIndexFetcher.java:102) ~[commoncrawl-fetcher-lite-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.tallison.cc.index.io.ThrottleException
at org.tallison.cc.index.extractor.CCIndexFetcher.execute(CCIndexFetcher.java:92)
at org.tallison.cc.index.extractor.CCIndexFetcher.main(CCIndexFetcher.java:57)
at org.tallison.cc.index.extractor.CCFetcherCli.main(CCFetcherCli.java:34)
Caused by: java.util.concurrent.ExecutionException: org.tallison.cc.index.io.ThrottleException
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.tallison.cc.index.extractor.CCIndexFetcher.execute(CCIndexFetcher.java:85)
... 2 more
Caused by: org.tallison.cc.index.io.ThrottleException
at org.tallison.cc.index.io.BackoffHttpFetcher.fetchWithBackOff(BackoffHttpFetcher.java:103)
at org.tallison.cc.index.io.BackoffHttpFetcher.fetch(BackoffHttpFetcher.java:51)
at org.tallison.cc.index.extractor.CCIndexFetcher$IndexFetcher.fetch(CCIndexFetcher.java:135)
at org.tallison.cc.index.extractor.CCIndexFetcher$IndexFetcher.call(CCIndexFetcher.java:128)
at org.tallison.cc.index.extractor.CCIndexFetcher$IndexFetcher.call(CCIndexFetcher.java:102)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)
[1]+ Done clear
upstairs:/media/work/commoncrawl$
from commoncrawl-fetcher-lite.
Related Issues (15)
- Add checkstyle HOT 1
- Add maven enforcer to prevent version collisions HOT 1
- Incorporate index urls into json file
- Shutdown fetching when throttling fails
- Allow writing extracted files to s3
- Configure release HOT 1
- Add loggers for extracted files and for truncated
- Allow users to download truncated bytes
- Add mime to logged files
- NPE if no fetcher is specified
- Backoff messages HOT 1
- 3. Allow a different extracted file naming scheme HOT 5
- Won't download older crawls HOT 12
- Redownloading cdx files HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commoncrawl-fetcher-lite.