Commit 729d20a3 by 魏建枢

文件路径修改

parent 63bf39b8
...@@ -64,10 +64,7 @@ public class IpToConvert extends GenericUDTF{ ...@@ -64,10 +64,7 @@ public class IpToConvert extends GenericUDTF{
if(args[0] != null) { if(args[0] != null) {
id = args[0].toString(); id = args[0].toString();
} }
String ip = null; String ip = args[1].toString();
if(args[1] != null) {
ip = args[1].toString();
}
String cid = null; String cid = null;
if(args[2] != null) { if(args[2] != null) {
cid = args[2].toString(); cid = args[2].toString();
...@@ -86,9 +83,7 @@ public class IpToConvert extends GenericUDTF{ ...@@ -86,9 +83,7 @@ public class IpToConvert extends GenericUDTF{
} }
String area_name = null; String area_name = null;
try { try {
if(StringUtils.isNotEmpty(ip)) {
area_name = SearcherUtil.getCityInfoByFile(ip); area_name = SearcherUtil.getCityInfoByFile(ip);
}
} catch (Exception e) { } catch (Exception e) {
System.out.println("ip:"+ip+"e:"+e.toString()); System.out.println("ip:"+ip+"e:"+e.toString());
} }
......
...@@ -15,8 +15,8 @@ public class SearcherUtil { ...@@ -15,8 +15,8 @@ public class SearcherUtil {
public static String getCityInfoByFile(String ip) { public static String getCityInfoByFile(String ip) {
System.out.println("SearcherUtil start! ip:"+ip); System.out.println("SearcherUtil start! ip:"+ip);
// 1、创建 searcher 对象 // 1、创建 searcher 对象
String dbPath = "D:\\gitEagleEye\\eagleEye-service\\src\\main\\resources\\ip2region.xdb"; // String dbPath = "D:\\gitEagleEye\\eagleEye-service\\src\\main\\resources\\ip2region.xdb";
// String dbPath = "/home/opc/ip2region.xdb"; String dbPath = "/home/opc/ip2region.xdb";
Searcher searcher; Searcher searcher;
try { try {
System.out.println("dbPath:"+dbPath); System.out.println("dbPath:"+dbPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment