MapReduce에 로그 분석 프로그램을 구축 중입니다. MaxMind GeoIP 데이터를 사용합니다. 이제 GeoIP 데이터를 분산 캐시에 저장하려고합니다. 나는 이클립스에서 내 응용 프로그램을 개발하고있다. 여기에 내가하고있는 일이있다.Hadoop 1.0.4 분산 캐시 오류
Job job = new Job();
DistributedCache.addCacheFile(new URI(args[3]), job.getConfiguration());
args [3]에는 경로가있을 것이다. 여기
나는 그것을
protected void setup(Context context) {
try {
//String dbfile = "GeoIP//GeoIPCountry.dat";
org.apache.hadoop.conf.Configuration conf = context.getConfiguration();
Path[] dbfile = DistributedCache.getLocalCacheFiles(conf);
// GEOIP_MEMORY_CACHE - load database into memory, faster
// performance but uses more memory, Increase the JVM heap Size
cl = new LookupService(dbfile.toString(), LookupService.GEOIP_MEMORY_CACHE);
} catch (Exception e) {
System.err.println("Error opening GeoIP data file.");
System.err.println(e);
System.exit(2);
}
}
을 사용하고 그러나 실행하는 동안 나는 다음과 같은 오류
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method addCacheFile(URI, Configuration) in the type DistributedCache is not applicable for the arguments (URI, Configuration)
을 얻고 내가 잘못이 무엇인지 알아낼 수 없습니다입니다. 잘못된 클래스를 따기
파일을 캐시에 추가 할 때 파트에 가져 오기를 표시 할 수 있습니까? –