From 21b7572533592f1700f86379483d87e9e340f2a7 Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Sat, 12 Mar 2016 09:44:00 +0000 Subject: [PATCH] Update com.maxmind.geoip2 to 2.6.0 com.maxmind.geoip2 2.6.0 depends on com.google.http-client 1.15.0-rc (3 years old). When trying to include other libraries in Druid that require an up to date version of com.google.http-client this causes a problem. --- pom.xml | 2 +- .../segment/realtime/firehose/WikipediaIrcDecoder.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a70e710d8b5..8b99ac8f669 100644 --- a/pom.xml +++ b/pom.xml @@ -612,7 +612,7 @@ com.maxmind.geoip2 geoip2 - 0.4.0 + 2.6.0 org.apache.httpcomponents diff --git a/server/src/main/java/io/druid/segment/realtime/firehose/WikipediaIrcDecoder.java b/server/src/main/java/io/druid/segment/realtime/firehose/WikipediaIrcDecoder.java index 9ddfabaf961..1ef270b572e 100644 --- a/server/src/main/java/io/druid/segment/realtime/firehose/WikipediaIrcDecoder.java +++ b/server/src/main/java/io/druid/segment/realtime/firehose/WikipediaIrcDecoder.java @@ -24,9 +24,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.maxmind.db.CHMCache; import com.maxmind.geoip2.DatabaseReader; import com.maxmind.geoip2.exception.GeoIp2Exception; -import com.maxmind.geoip2.model.Omni; +import com.maxmind.geoip2.model.CityResponse; import com.metamx.common.logger.Logger; import io.druid.data.input.InputRow; import io.druid.data.input.Row; @@ -123,7 +124,7 @@ class WikipediaIrcDecoder implements IrcDecoder private DatabaseReader openGeoIpDb(File geoDb) { try { - DatabaseReader reader = new DatabaseReader(geoDb); + DatabaseReader reader = new DatabaseReader.Builder(geoDb).withCache(new CHMCache()).build(); log.info("Using geo ip database at [%s].", geoDb); return reader; } catch (IOException e) { @@ -196,7 +197,7 @@ class WikipediaIrcDecoder implements IrcDecoder if (anonymous) { try { final InetAddress ip = InetAddress.getByName(ipMatch.group()); - final Omni lookup = geoLookup.omni(ip); + final CityResponse lookup = geoLookup.city(ip); dimensions.put("continent", lookup.getContinent().getName()); dimensions.put("country", lookup.getCountry().getName());