public class GeoIPDocumentCreator
extends java.lang.Object
Simple utility class which enables efficient, structured
NutchDocument building based on input from
GeoIPIndexingFilter, where configuration is also read.
Based on the nature of the input, this class wraps factory type
implementations for populating NutchDocument
's with the correct NutchField information.
| Constructor and Description |
|---|
GeoIPDocumentCreator() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addIfNotNull(NutchDocument doc,
java.lang.String name,
java.lang.Integer value)
Add field to document but only if value isn't null
|
static void |
addIfNotNull(NutchDocument doc,
java.lang.String name,
java.lang.String value)
Add field to document but only if value isn't null
|
static NutchDocument |
createDocFromCityDb(java.lang.String serverIp,
NutchDocument doc,
DatabaseReader reader) |
static NutchDocument |
createDocFromCityService(java.lang.String serverIp,
NutchDocument doc,
WebServiceClient client) |
static NutchDocument |
createDocFromConnectionDb(java.lang.String serverIp,
NutchDocument doc,
DatabaseReader reader) |
static NutchDocument |
createDocFromCountryService(java.lang.String serverIp,
NutchDocument doc,
WebServiceClient client) |
static NutchDocument |
createDocFromDomainDb(java.lang.String serverIp,
NutchDocument doc,
DatabaseReader reader) |
static NutchDocument |
createDocFromInsightsService(java.lang.String serverIp,
NutchDocument doc,
WebServiceClient client) |
static NutchDocument |
createDocFromIspDb(java.lang.String serverIp,
NutchDocument doc,
DatabaseReader reader) |
public static void addIfNotNull(NutchDocument doc, java.lang.String name, java.lang.String value)
public static void addIfNotNull(NutchDocument doc, java.lang.String name, java.lang.Integer value)
public static NutchDocument createDocFromInsightsService(java.lang.String serverIp, NutchDocument doc, WebServiceClient client) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2Exceptionpublic static NutchDocument createDocFromCityService(java.lang.String serverIp, NutchDocument doc, WebServiceClient client) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2Exceptionpublic static NutchDocument createDocFromCountryService(java.lang.String serverIp, NutchDocument doc, WebServiceClient client) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2Exceptionpublic static NutchDocument createDocFromIspDb(java.lang.String serverIp, NutchDocument doc, DatabaseReader reader) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2Exceptionpublic static NutchDocument createDocFromDomainDb(java.lang.String serverIp, NutchDocument doc, DatabaseReader reader) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2Exceptionpublic static NutchDocument createDocFromConnectionDb(java.lang.String serverIp, NutchDocument doc, DatabaseReader reader) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2Exceptionpublic static NutchDocument createDocFromCityDb(java.lang.String serverIp, NutchDocument doc, DatabaseReader reader) throws java.net.UnknownHostException, java.io.IOException, GeoIp2Exception
java.net.UnknownHostExceptionjava.io.IOExceptionGeoIp2ExceptionCopyright © 2019 The Apache Software Foundation