2016-07-15 9 views
0

MapReduceアプリケーションを実行しようとしています。反復MapReduce(Twister)実行中例外

これは、メインクラスです:

public class GPFunctionFitting { 
    public static void main(String[] args) { 
     // .... 
     GPFunctionFitting client; 
     try { 
      client = new GPFunctionFitting(); 
      client.runMapReduce(partitionFile, numMapTasks); // line 44 
      // ... 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
    } 
} 

と方法:

public ExpressionTree runMapReduce(String partitionFile, int numMapTasks) throws Exception { 

     JobConf jobConf = new JobConf("gp-function-fitting-map-reduce" + uuidGen.generateRandomBasedUUID()); 
     jobConf.setMapperClass(GPMapTask.class); 
     jobConf.setReducerClass(GPReduceTask.class); 
     jobConf.setCombinerClass(GPCombiner.class); 
     jobConf.setNumMapTasks(numMapTasks); 
     jobConf.setNumReduceTasks(1); 

     TwisterModel driver = new TwisterDriver(jobConf); 
     driver.configureMaps(partitionFile); // line 74 
     TwisterMonitor monitor = driver.runMapReduce(); 
     monitor.monitorTillCompletion(); 
     ExpressionTree solution = ((GPCombiner) driver.getCurrentCombiner()).getResult(); 

     driver.close(); 

     return solution; 
    } 

これは、Eclipseのコンソールからのログです:

JobID: 
gp-function-fitting-map-reduce9f25c1da-ab8b-446b-b453-d60f4165b3a9 
TransmissionManager: There is a pending/ongoing transfer on 
niotcp:///127.0.0.1:3045 for a total of 16384 bytes 
TransmissionManager: All transfers have been completed 
CommunicationsService: Closing Link = niotcp://127.0.0.1:3045 null 0 
[main] INFO cgl.imr.client.TwisterDriver - MapReduce computation 
termintated gracefully. 

cgl.imr.base.TwisterException: Could not send all the map executor 
requests. First error is Did not receive a response from the worker.14 
[Thread-0] DEBUG cgl.imr.client.ShutdownHook - Shutting down 
completed. 
    at cgl.imr.client.TwisterDriver.configureMaps(TwisterDriver.java:360) 
    at cgl.imr.client.TwisterDriver.configureMaps(TwisterDriver.java:381) 
    at map_reduce.GPFunctionFitting.runMapReduce(GPFunctionFitting.java:74) 
    at map_reduce.GPFunctionFitting.main(GPFunctionFitting.java:44) 

そして、最後にから、エラー私が走ったターミナル:

2588033 [Thread-4] ERROR cgl.imr.worker.DaemonWorker - Could not 
instantiate the Mapper. cgl.imr.base.TwisterException: Could not 
instantiate the Mapper.  at 
cgl.imr.worker.Mapper.<init (Mapper.java:120)  at 
cgl.imr.worker.DaemonWorker.handleMapperRequest(DaemonWorker.java:228) 
    at cgl.imr.worker.DaemonWorker.onEvent(DaemonWorker.java:471) 
    at cgl.imr.pubsub.nb.NBPubSubService.onEvent(NBPubSubService.java:154) 
    at cgl.narada.service.qos.impl.QosServiceImpl.routeToEventConsumer(QosServiceImpl.java:938) 
    at cgl.narada.service.qos.impl.QosServiceImpl.manageEventRoutingToDestinations(QosServiceImpl.java:530) 
    at cgl.narada.service.qos.impl.QosServiceImpl.processReceivedEvent(QosServiceImpl.java:424) 
    at cgl.narada.service.qos.impl.CommunicationsService.processDataPackets(CommunicationsService.java:236) 
    at cgl.narada.service.qos.impl.CommunicationsService.processData(CommunicationsService.java:214) 
    at cgl.narada.service.qos.impl.CommunicationsService.handleData(CommunicationsService.java:142) 
    at cgl.narada.transport.TransportHandlerImpl.dataReceived(TransportHandlerImpl.java:516) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:323) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.processBuffer(NIOTCPReceiverThread.java:329) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.readDataFromSocket(NIOTCPReceiverThread.java:247) 
    at cgl.narada.transport.niotcp.NIOTCPReceiverThread.run(NIOTCPReceiverThread.java:196) 
Caused by: java.lang.ClassNotFoundException: map_reduce.GPMapTask 
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)  
at java.lang.ClassLoader.findSystemClass(ClassLoader.java:1004)  
at cgl.imr.util.CustomClassLoader.findClass(CustomClassLoader.java:102) 
at cgl.imr.util.CustomClassLoader.loadClass(CustomClassLoader.java:129) 
at java.lang.Class.forName0(Native Method) 
at java.lang.Class.forName(Class.java:348) 
at cgl.imr.worker.Mapper.<init (Mapper.java:116) ... 24 more 

クラスGPMapTaskが存在し、MapTaskインターフェイスを実装しており、メインクラスと同じパッケージに含まれています。 パーティションファイルは適切に生成され、要求されたマップジョブの数に等しい12行が含まれます。

誰かが少なくとも私に問題を探すためのアイデアを教えてもらえますか? "Class not found exception"を解決しようとしていますが、問題がパーティション構成にあると考え始めています。

答えて

0

.classが見つからないか、複数の場所に存在します。 クラスの定義があいまいであるため、コンパイラは混乱します。 すべてのクラスが正確に1回含まれていることを確認してください。 クラスパスに含まれるすべてのjarの内容を確認してください。

binフォルダを削除して、プロジェクトを再度クリーンアップしてビルドします。 Twisterでは、実行中のアプリケーションの.jarファイルがapps /ディレクトリに存在する必要があります。変更するたびに(IDEから実行する場合)、アプリケーションの最新バージョンをエクスポートします。

+0

なぜアプリディレクトリにある必要がありますか? JARは、同じ場所のすべてのノード、または好ましくはHDFS上でアクセス可能である必要があります。 –

+0

ああ、私は場所がapps /ディレクトリでなければならないと思っていました。 –

+0

Nope =) 'hadoop jar hdfs:/// path/to/file.jar'はほとんどが私の経験で働いていた –

関連する問題