2013-05-30 2 views
1

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) 

을 얻고 내가 잘못이 무엇인지 알아낼 수 없습니다입니다. 잘못된 클래스를 따기

+0

파일을 캐시에 추가 할 때 파트에 가져 오기를 표시 할 수 있습니까? –

답변

2

그것 도와주세요 : URIConfiguration 클래스

The method addCacheFile(URI, Configuration) in the type DistributedCache is not applicable for the arguments (URI, Configuration) 

검사는 수입.

documentation 당, 그들은 java.net.URIorg.apache.hadoop.conf.Configuration

난 당신이 JDK에서 javax.security.auth.login.Configuration 클래스를 엉망 것 같아되어야한다. 여기서는 사용하지 않아도됩니다.

+0

귀하의 도움에 감사했습니다. – Ananda