Skip to content

Commit

Permalink
Update com.maxmind.geoip2 to 2.6.0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
erikdubbelboer committed Mar 12, 2016
1 parent cf7f6da commit 21b7572
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>0.4.0</version>
<version>2.6.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
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;
Expand Down Expand Up @@ -123,7 +124,7 @@ private DatabaseReader openDefaultGeoIpDb(File geoDb) {

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) {
Expand Down Expand Up @@ -196,7 +197,7 @@ public InputRow decodeMessage(final DateTime timestamp, String channel, String m
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());
Expand Down

0 comments on commit 21b7572

Please sign in to comment.