Class JSONResourceWrapper
java.lang.Object
com.digitalpebble.stormcrawler.util.AbstractConfigurable
com.digitalpebble.stormcrawler.parse.ParseFilter
com.digitalpebble.stormcrawler.opensearch.parse.filter.JSONResourceWrapper
- All Implemented Interfaces:
Configurable
Wraps a ParseFilter whose resources are in a JSON file that can be stored in OpenSearch. The
benefit of doing this is that the resources can be refreshed automatically and modified without
having to recompile the jar and restart the topology. The connection to OpenSearch is done via
the config and uses a new bolt type 'config'.
The configuration of the delegate is done in the parsefilters.json as usual.
{
"class": "com.digitalpebble.stormcrawler.elasticsearch.parse.filter.JSONResourceWrapper",
"name": "OpenSearchCollectionTagger",
"params": {
"refresh": "60",
"delegate": {
"class": "com.digitalpebble.stormcrawler.parse.filter.CollectionTagger",
"params": {
"file": "collections.json"
}
}
}
}
The resource file can be pushed to OpenSearch with
curl -XPUT "$OSHOST/config/_create/collections.json" -H 'Content-Type: application/json' -d @src/main/resources/collections.json
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(@NotNull Map<String, Object> stormConf, @NotNull com.fasterxml.jackson.databind.JsonNode filterParams) voidfilter(String URL, byte[] content, DocumentFragment doc, ParseResult parse) Methods inherited from class com.digitalpebble.stormcrawler.parse.ParseFilter
needsDOMMethods inherited from class com.digitalpebble.stormcrawler.util.AbstractConfigurable
configure, getName
-
Constructor Details
-
JSONResourceWrapper
public JSONResourceWrapper()
-
-
Method Details
-
configure
-
filter
- Specified by:
filterin classParseFilter
-