Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0C0FE200C61 for ; Tue, 11 Apr 2017 05:22:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0A843160BA5; Tue, 11 Apr 2017 03:22:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 522D7160B99 for ; Tue, 11 Apr 2017 05:22:45 +0200 (CEST) Received: (qmail 97702 invoked by uid 500); 11 Apr 2017 03:22:44 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 97693 invoked by uid 99); 11 Apr 2017 03:22:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2017 03:22:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AC3B8C023E for ; Tue, 11 Apr 2017 03:22:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id qWoketTy2rpY for ; Tue, 11 Apr 2017 03:22:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A13375FAC9 for ; Tue, 11 Apr 2017 03:22:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E4188E00C4 for ; Tue, 11 Apr 2017 03:22:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A1FDB20D1F for ; Tue, 11 Apr 2017 03:22:41 +0000 (UTC) Date: Tue, 11 Apr 2017 03:22:41 +0000 (UTC) From: "yangping wu (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (BEAM-1491) HDFSFileSource should be able to read the HADOOP_CONF_DIR(YARN_CONF_DIR) environment variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 11 Apr 2017 03:22:46 -0000 [ https://issues.apache.org/jira/browse/BEAM-1491?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] yangping wu updated BEAM-1491: ------------------------------ Summary: HDFSFileSource should be able to read the HADOOP_CONF_DIR(YARN= _CONF_DIR) environment variable (was: HDFSFileSource should be able to rea= d the HADOOP_CONF_DIR(YARN_CONF_DIR) environmen variable) > HDFSFileSource should be able to read the HADOOP_CONF_DIR(YARN_CONF_DIR) = environment variable > -------------------------------------------------------------------------= -------------------- > > Key: BEAM-1491 > URL: https://issues.apache.org/jira/browse/BEAM-1491 > Project: Beam > Issue Type: Improvement > Components: sdk-java-core > Affects Versions: 0.6.0 > Reporter: yangping wu > Assignee: Jean-Baptiste Onofr=C3=A9 > > Currently, if we want to read file store on HDFS, we will do it as follow= : > {code}=20 > PRead.Bounded> from =3D Read.from(HDFSFileSource.f= rom("hdfs://hadoopserver:8020/tmp/data.txt", TextInputFormat.class, LongWri= table.class, Text.class)); > PCollection> data =3D p.apply(from); > {code} > or > {code} > Configuration conf =3D new Configuration(); > conf.set("fs.default.name", "hdfs://hadoopserver:8020"); > PRead.Bounded> from =3D Read.from(HDFSFileSource.f= rom("/tmp/data.txt", TextInputFormat.class, LongWritable.class, Text.class)= .withConfiguration(conf)); > PCollection> data =3D p.apply(from); > {code} > As we have seen above, we must be set {{hdfs://hadoopserver:8020}} in the= file path > if we can initialize {{conf}} by reading {{HADOOP_CONF_DIR}}({{YARN_CONF_= DIR}}) environmen variable, then we can read HDFS file like this: > {code} > PRead.Bounded> from =3D Read.from(HDFSFileSource.f= rom("/tmp/data.txt", TextInputFormat.class, LongWritable.class, Text.class)= ); > PCollection> data =3D p.apply(from); > {code} > note we don't specify {{hdfs://hadoopserver:8020}} prefix, because the pr= ogram read it from {{HADOOP_CONF_DIR}}({{YARN_CONF_DIR}}) environmen, and = the program will read file from HDFS. -- This message was sent by Atlassian JIRA (v6.3.15#6346)