Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6257A964D for ; Wed, 8 Feb 2012 08:24:45 +0000 (UTC) Received: (qmail 72469 invoked by uid 500); 8 Feb 2012 08:24:42 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 71641 invoked by uid 500); 8 Feb 2012 08:24:35 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 71633 invoked by uid 99); 8 Feb 2012 08:24:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2012 08:24:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lblabs@gmail.com designates 209.85.217.176 as permitted sender) Received: from [209.85.217.176] (HELO mail-lpp01m020-f176.google.com) (209.85.217.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2012 08:24:27 +0000 Received: by lboi15 with SMTP id i15so166999lbo.35 for ; Wed, 08 Feb 2012 00:24:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=svanCOh84cvtr+CDLrJDPv/62mm/vHXiWm2N3Ddf+68=; b=RvZWFag/rCXcg8VCwUXgPJ4WoT56SCyvRXhaRgrXTLTMSGmNalthgq1JfVFqKa1ygA SWejyAx1WN9QadhIcNT/ZPPG+EDqtfxQYo9XDCvyErJYE1rL+zASEhNSOqZK6CSLPwF6 /dfffe18jANxCPHebGyS4P0Mxv4qgvMFv9XJ8= MIME-Version: 1.0 Received: by 10.112.98.37 with SMTP id ef5mr7802287lbb.73.1328689446847; Wed, 08 Feb 2012 00:24:06 -0800 (PST) Received: by 10.112.25.163 with HTTP; Wed, 8 Feb 2012 00:24:06 -0800 (PST) Reply-To: bing.li@asu.edu In-Reply-To: References: <1542FA4EE20C5048A5C2A3663BED2A6B1E37D4A1@szxeml531-mbs.china.huawei.com> Date: Wed, 8 Feb 2012 16:24:06 +0800 Message-ID: Subject: Re: Unable to Load Native-Hadoop Library for Your Platform From: Bing Li To: Harsh J Cc: common-user@hadoop.apache.org, Adam Brown Content-Type: multipart/alternative; boundary=bcaec554d6027f063c04b86f9e89 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec554d6027f063c04b86f9e89 Content-Type: text/plain; charset=ISO-8859-1 Hi, Harsh, I appreciate so much for your reply! My current Linux is RedHat 9. I worry that it must be a little bit old. That's the reason for the warning? Best regards, Bing On Wed, Feb 8, 2012 at 1:56 PM, Harsh J wrote: > Hey Bing, > > What platform are you using to submit jobs from? Linux has native libs > pre-built and available already, and you can just use them OOB. Native > libraries also help performance beyond just compression today, so its > a must-have at the server end today. > > Adam's second point was more about choosing the right compression > codec, which is your next step after having native libs setup -- and > yes you'd want the codec to either be splittable - LZO is splittable, > but requires a level of manual indexing first, Bz2 is natively > splittable but too slow, though gives a great compression ratio, the > rest (gz, snappy) so far aren't splittable on their own. > > My suggestion is always to use SequenceFile/Avro-DataFile formats over > plaintext files, which are very well optimized for Hadoop and are > splittable without any manual work -- and support a variety of > compression codecs each. > > On Wed, Feb 8, 2012 at 11:12 AM, Bing Li wrote: > > Dear Adam, > > > > Since I am not familiar with the native configuration, I have not solved > > the warning. > > > > You mean I can find a proper compression solution and do that in my own > > code instead of using the ones in Hadoop? What I need to do is just to > > guarantee the compressed data should be splittable. Right? > > > > Thanks so much for your help! > > > > Best regards, > > Bing > > > > On Wed, Feb 8, 2012 at 8:53 AM, Adam Brown wrote: > > > >> Hi Bing, > >> > >> If your data is highly compressible (e.g.-text) you should expect to see > >> higher throughput consuming the compressed stream. Of course you should > >> mmend doing a benchmark run against some sample data. > >> > >> Keep in mind that not all compressed streams can be arbitrarily split, > so > >> you must either use compression that is splittable (like lzo) or write > your > >> own input/output handlers. > >> > >> cheers, > >> > >> Adam > >> > >> On Tue, Feb 7, 2012 at 6:05 AM, Bing Li wrote: > >> > >>> Dear Uma, > >>> > >>> Thanks so much for your reply! > >>> > >>> Is the compression technique critical to Hadoop? I am not familiar with > >>> native libraries. > >>> > >>> Best regards, > >>> Bing > >>> > >>> On Tue, Feb 7, 2012 at 6:04 PM, Uma Maheswara Rao G < > maheswara@huawei.com > >>> >wrote: > >>> > >>> > Looks you are not using any compression in your code. Hadoop has some > >>> > native libraries to load mainly for compression codecs. > >>> > When you want to use that compression tequniques, you need to compile > >>> with > >>> > this compile.native option enable. Also need to set in java library > >>> path. > >>> > If you are not using any such stuff, then you need not worry about > that > >>> > warning. > >>> > Please look at the below link for more information. > >>> > http://hadoop.apache.org/common/docs/current/native_libraries.html > >>> > > >>> > Regards, > >>> > Uma > >>> > ________________________________________ > >>> > From: Bing Li [lblabs@gmail.com] > >>> > Sent: Tuesday, February 07, 2012 3:08 PM > >>> > To: common-user@hadoop.apache.org > >>> > Subject: Unable to Load Native-Hadoop Library for Your Platform > >>> > > >>> > Dear all, > >>> > > >>> > I got an error when running a simple Java program on Hadoop. The > >>> program is > >>> > just to merge some local files to one and put it on Hadoop. > >>> > > >>> > The code is as follows. > >>> > > >>> > ...... > >>> > > >>> > Configuration conf = new Configuration(); > >>> > try > >>> > { > >>> > FileSystem hdfs = FileSystem.get(conf); > >>> > FileSystem local = FileSystem.getLocal(conf); > >>> > Path inputDir = new > Path("/home/libing/Temp/"); > >>> > Path hdfsFile = new > >>> > Path("/tmp/user/libing/example.txt"); > >>> > > >>> > try > >>> > { > >>> > FileStatus[] inputFiles = > >>> > local.listStatus(inputDir); > >>> > FSDataOutputStream out = > >>> > hdfs.create(hdfsFile); > >>> > for (int i = 0; i < > inputFiles.length; i > >>> ++) > >>> > { > >>> > > >>> > System.out.println(inputFiles[i].getPath().getName()); > >>> > FSDataInputStream in = > >>> > local.open(inputFiles[i].getPath()); > >>> > byte buffer[] = new byte[256]; > >>> > int bytesRead = 0; > >>> > while ((bytesRead = > >>> > in.read(buffer)) > 0) > >>> > { > >>> > out.write(buffer, 0, > >>> > bytesRead); > >>> > } > >>> > in.close(); > >>> > } > >>> > out.close(); > >>> > } > >>> > catch (IOException e) > >>> > { > >>> > e.printStackTrace(); > >>> > } > >>> > } > >>> > catch (IOException e) > >>> > { > >>> > e.printStackTrace(); > >>> > } > >>> > > >>> > ...... > >>> > > >>> > I run it with ant and got the following warning. BTW, all the > relevant > >>> jar > >>> > packages from Hadoop are specified in the build.xml. > >>> > > >>> > [java] 2012-2-7 17:16:18 org.apache.hadoop.util.NativeCodeLoader > >>> > > >>> > [java] Warning: Unable to load native-hadoop library for your > >>> > platform... using builtin-java classes where applicable > >>> > > >>> > The program got a correct result. But I cannot figure out what the > above > >>> > problem is. > >>> > > >>> > Thanks so much! > >>> > Bing > >>> > > >>> > >> > >> > >> > >> -- > >> Adam Brown > >> Enablement Engineer > >> Hortonworks > >> > >> > >> > > > > -- > Harsh J > Customer Ops. Engineer > Cloudera | http://tiny.cloudera.com/about > --bcaec554d6027f063c04b86f9e89--