Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B87A9FB1F for ; Wed, 3 Apr 2013 04:53:48 +0000 (UTC) Received: (qmail 51020 invoked by uid 500); 3 Apr 2013 04:53:43 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 50862 invoked by uid 500); 3 Apr 2013 04:53:43 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 50823 invoked by uid 99); 3 Apr 2013 04:53:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 04:53:41 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yypvsxf19870706@gmail.com designates 209.85.192.173 as permitted sender) Received: from [209.85.192.173] (HELO mail-pd0-f173.google.com) (209.85.192.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 04:53:34 +0000 Received: by mail-pd0-f173.google.com with SMTP id v14so411493pde.4 for ; Tue, 02 Apr 2013 21:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=IhduWTfTMDnxM3S6OICCFm5ofm9cyqOc7u0U2LciTos=; b=D3raDVnaizpL02fILqeMUGswRyTfPjt8IjxHPRXudK//hHNndpJIgmm3zIzTf0QAW+ faOEstsjas884TK+HFILiryVMvzmwd3ldoXAYdRtLjgsIrQaRYikCn+p2WRD9c98Z0B3 9sd7bVOw7+JShl54ejOx/729ggglCNoPh+M30yidav8dI6fYYnnRAbBUaFwWeWGeYzU+ mdRSozAO7NdAZ4/9iwiR28o3pjpPBqsmUFgUrJ5LTLXduzMX74/3CFkb1kT98B7rFFjo 37g90QkvDeuU/cFgoXKF1ucjCbEn/10DfJut1x5C/mer2jQ1Kg9eq1fr8wCXsxH7oWTv 26Gg== X-Received: by 10.68.179.67 with SMTP id de3mr265270pbc.130.1364964792860; Tue, 02 Apr 2013 21:53:12 -0700 (PDT) Received: from [10.49.137.107] ([122.96.47.142]) by mx.google.com with ESMTPS id pg7sm4417393pbc.5.2013.04.02.21.53.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 21:53:12 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-0EFC7E15-57C0-41E3-AC83-68E3864F3BD1 Content-Transfer-Encoding: 7bit Message-Id: <238AD49B-5781-4A16-90B8-F155D204A4FF@gmail.com> Cc: "user@hadoop.apache.org" X-Mailer: iPhone Mail (10B146) From: yypvsxf19870706 Subject: Re: MultipleInputs.addInputPath compile error in eclipse(indigo) Date: Wed, 3 Apr 2013 12:52:01 +0800 To: "user@hadoop.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-0EFC7E15-57C0-41E3-AC83-68E3864F3BD1 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable hi wow=A3=ACthank you liang =B7=A2=D7=D4=CE=D2=B5=C4 iPhone =D4=DA 2013-4-2=A3=AC17:25=A3=ACYanbo Liang =D0=B4=B5= =C0=A3=BA > You set the wrong parameter NodeReducer.class which should be subclass of M= apper rather than Reducer. >=20 >=20 > 2013/4/2 YouPeng Yang >> HI GUYS >> I want to use the the org.apache.hadoop.mapreduce.lib.input.MultipleInp= uts; >> =20 >>=20 >> However it comes a compile error in my eclipse(indigo): >>=20 >> public static void main(String[] args) throws IOException, InterruptedEx= ception, ClassNotFoundException { >> Configuration conf =3D new Configuration(); >> String[] otheArgs =3D new GenericOptionsParser(conf,args).g= etRemainingArgs(); >> if(otheArgs.length !=3D 2){ >> System.err.println("Usage:aaaa"); >> System.exit(2); >> } >> Job job =3D new Job(conf,"Data test2"); >> =09 >> job.setReducerClass(CPUReducer.class); >> job.setOutputKeyClass(Text.class); >> job.setOutputValueClass(Text.class); >> MultipleInputs.addInputPath(job, new Path(otheArgs[0]), Tex= tInputFormat.class,CPUMapper.class); >> MultipleInputs.addInputPath(job, new Path(otheArgs[1]), Tex= tInputFormat.class,NodeReducer.class); >> ---->The method addInputPath(Job, Path, Class, Class) in the type MultipleInputs is not ap= plicable for the arguments (Job, Path, Class, Class >>=20 >> FileOutputFormat.setOutputPath(job,new Path(otheArgs[2])); >> System.exit(job.waitForCompletion(true) ? 0 : 1); >>=20 >> } >> =20 >> My questions=A3=BA >> 1.Does the org.apache.hadoop.mapreduce.lib.input.MultipleInputs belong = =20 >> to the new Hadoop API? >> Why this error come out,did i miss something? >> 2.I also found the constructor Job(Configuration, String) is deprecate= d when i declare Job job =3D new Job(conf,"Data test2"). >> According to the Hadoop Defenitive Guide ,the API Job is the new Ha= doop API. So why the job api is deprecated . >> =20 >> I use the hadoop 2.0.0 with the CDH 4.1.2 . >>=20 >> please help me. >>=20 >> Thanks you. >>=20 >>=20 >>=20 >> Regards=20 >=20 --Apple-Mail-0EFC7E15-57C0-41E3-AC83-68E3864F3BD1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
hi
wow=EF=BC=8Cthank you lia= ng

=E5=8F=91=E8=87=AA=E6=88=91=E7=9A=84 iPhone

=E5=9C=A8= 2013-4-2=EF=BC=8C17:25=EF=BC=8CYanbo Liang <yanbohappy@gmail.com> =E5=86=99=E9=81=93=EF=BC=9A

=
You set the wrong parameter NodeReducer.class which should be subclass of Mapper rather than Reducer= .


2013/4/2 YouPeng Yang &= lt;yypvsxf198= 70706@gmail.com>
HI GUYS
  I want to use the the org.apache.ha= doop.mapreduce.lib.input.MultipleInputs;
 

  However it comes a compile error in my eclipse(indigo):

 p= ublic static void main(String[] args) throws IOException, InterruptedExcepti= on, ClassNotFoundException {
= Configuration conf =3D new Configuration();
String[] oth= eArgs =3D new GenericOptionsParser(conf,args).getRemainingArgs();
= if(otheArgs.length != =3D 2){
System.err.p= rintln("Usage:aaaa");
= System.exit(2);
}
Job job =3D n= ew Job(conf,"Data test2");
=
= job.setReducerClass(CPUReducer.class);
job.setOutpu= tKeyClass(Text.class);
= job.setOutputValueClass(Text.class);
MultipleInputs.addInputPath(job, new= Path(otheArgs[0]), TextInputFormat.class,CPUMapper.class);
= MultipleInputs.addInputPath(job, new P= ath(otheArgs[1]), TextInputFormat.class,NodeReducer.class);
    ---->The method addInputPath(Job, Path, Class<? exte= nds InputFormat>, Class<? extends Mapper>) in the type MultipleInpu= ts is not applicable for the arguments (Job, Path, Class<TextInputFormat&= gt;, Class<NodeReducer>

FileOutputFormat.setOutputPath(job,new Path(= otheArgs[2]));
System.exit(job.waitForCompletion(true) ?  0 : 1);

}
 
   My questions=EF=BC=9A
=   1.Does the org.apache.hadoop.mapreduce.lib.input.MultipleInputs belon= g  
 to the new Hadoop API?
   Why this error come out,= did i miss something?
  2.I also found  the constructor J= ob(Configuration, String) is deprecated when i declare  Job job =3D new= Job(conf,"Data test2").
     According to the Hadoop Defenitive Guide ,the API J= ob  is the new Hadoop API. So why the job api is deprecated .
 
  I use the hadoop 2.0.0 with the CDH 4.1.2 .

  please help me.

Thanks you.



Regards 


= --Apple-Mail-0EFC7E15-57C0-41E3-AC83-68E3864F3BD1--