geoip scala api

#!/bin/bash
/home/hadoop/spark-1.6.2/bin/spark-shell --master spark://hbase11:7077 --executor-memory 50g  --jars /data/elas-input/maxmind-geoip2-scala_2.10-1.5.1.jar,geoip2-2.3.1.jar,util-collection_2.10-6.23.0.jar,util-core_2.10-6.23.0.jar,maxmind-db-1.0.0.jar


import com.sanoma.cda.geoip.MaxMindIpGeo
val geoIp = MaxMindIpGeo("/data/elas-input/GeoIP2-City.mmdb", 1000,synchronized = true)
println(geoIp.getLocation("123.123.123.123"))
posted @ 2016-09-24 15:14  蚂蚁都督  阅读(333)  评论(0编辑  收藏  举报