Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-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 348E011246 for ; Tue, 29 Jul 2014 08:04:26 +0000 (UTC) Received: (qmail 17974 invoked by uid 500); 29 Jul 2014 08:04:20 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 17831 invoked by uid 500); 29 Jul 2014 08:04:20 -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 17819 invoked by uid 99); 29 Jul 2014 08:04:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 08:04:19 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nitinpawar432@gmail.com designates 209.85.160.171 as permitted sender) Received: from [209.85.160.171] (HELO mail-yk0-f171.google.com) (209.85.160.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 08:04:17 +0000 Received: by mail-yk0-f171.google.com with SMTP id 19so5369661ykq.2 for ; Tue, 29 Jul 2014 01:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UWf422ayZDm4jPpGqnGXEW8yGVvsq87V0pVLmcPv/g8=; b=cS9UKJDOEn3MMd4m+eXEThl1j79NpYUTFBXQkXJD80R6466AKin54n1atAPVLhWcju zuJyVXbgLoAJuMjrYu9j581wx28QaV9olcC1slWnjGBVxxSXz+cK9e78fdcF89kpOz2V 1v3PYqWs94MOejYLHsHFi0BjblRyOLegtiaKh/LdF2MdTreHfh4NGk7V1RF+6Fz+miRC Nm1IyV9ypm8FtTHli21X1vJ9CUk9sF3VJx4eKoiolHzjLJlFyBJ27Wbh7gzrU3ZIcmwv I9Yr1igzccdIrkqTWrxBla0aV+HeDTsFFZ4CYxCOYgv9B1BQVf+65q+0GexmJEk0Lip1 qyHA== MIME-Version: 1.0 X-Received: by 10.236.18.195 with SMTP id l43mr697302yhl.150.1406621032693; Tue, 29 Jul 2014 01:03:52 -0700 (PDT) Received: by 10.170.110.146 with HTTP; Tue, 29 Jul 2014 01:03:52 -0700 (PDT) In-Reply-To: <53D7537F.9060703@ericsson.com> References: <53D7537F.9060703@ericsson.com> Date: Tue, 29 Jul 2014 13:33:52 +0530 Message-ID: Subject: Re: Which replication value will be used From: Nitin Pawar To: user@hadoop.apache.org, satyam.singh@ericsson.com Content-Type: multipart/alternative; boundary=089e01229f1afcc5a104ff507ac5 X-Virus-Checked: Checked by ClamAV on apache.org --089e01229f1afcc5a104ff507ac5 Content-Type: text/plain; charset=UTF-8 first it will check if you have set replication factor in your write call .. if yes .. it will be respected. if there is no value for replication in write process, it falls back to default value in hdfs-site.xml On Tue, Jul 29, 2014 at 1:25 PM, Satyam Singh wrote: > Hello, > > > > I have given dfs.replication=2 in hdfs-site.xml as: > > dfs.replication > 2 > > > Also, In my application i have used api for wrting in hdfs: > public FSDataOutputStream create(Path f, > boolean overwrite, > int bufferSize, > short replication, > long blockSize, > Progressable progress > ) throws IOException { > return this.create(f, FsPermission.getFileDefault().applyUMask( > FsPermission.getUMask(getConf())), overwrite, bufferSize, > replication, blockSize, progress); > } > > here i also given replication as fourth parameter. > > So my question is which replication value will be used that we have given > in api or in hdfs-site.xml > > > Warm Regards, > Satyam > -- Nitin Pawar --089e01229f1afcc5a104ff507ac5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
first it will check if you have set replication factor in = your write call .. if yes .. it will be respected.=C2=A0
if there is no= value for replication in write process, it falls back to default value in = hdfs-site.xml=C2=A0


On Tue,= Jul 29, 2014 at 1:25 PM, Satyam Singh <satyam.singh@ericsson.com<= /a>> wrote:
Hello,



I have given dfs.replication=3D2 in hdfs-site.xml as:
<property>
=C2=A0 =C2=A0 <name>dfs.replication</name>
=C2=A0 =C2=A0 <value>2</value>
</property>

Also, In my application i have used api for wrting in hdfs:
public FSDataOutputStream create(Path f,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 boolean overwrite,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 int bufferSize,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 short replication,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 long blockSize,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 Progressable progress
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ) throws IOException {
=C2=A0 =C2=A0 return this.create(f, FsPermission.getFileDefault().ap= plyUMask(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 FsPermission.getUMask(getConf())), overw= rite, bufferSize,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 replication, blockSize, progress);
=C2=A0 }

here i also given replication as fourth parameter.

So my question is which replication value will be used that we have given i= n api or in hdfs-site.xml


Warm Regards,
Satyam



--
Nitin Pawar<= br>
--089e01229f1afcc5a104ff507ac5--