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 8A3B2200C34 for ; Mon, 27 Feb 2017 14:05:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 88EA9160B60; Mon, 27 Feb 2017 13:05:50 +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 9D290160B81 for ; Mon, 27 Feb 2017 14:05:49 +0100 (CET) Received: (qmail 15148 invoked by uid 500); 27 Feb 2017 13:05:37 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 10538 invoked by uid 99); 27 Feb 2017 13:04:55 -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; Mon, 27 Feb 2017 13:04:55 +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 28EBDC0ABA for ; Mon, 27 Feb 2017 13:04:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.547 X-Spam-Level: X-Spam-Status: No, score=-1.547 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id cVL5O76V_DAf for ; Mon, 27 Feb 2017 13:04:53 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id B0C4A5F23A for ; Mon, 27 Feb 2017 13:04:53 +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 B5376E0B4A for ; Mon, 27 Feb 2017 13:04:48 +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 891DA241BC for ; Mon, 27 Feb 2017 13:04:46 +0000 (UTC) Date: Mon, 27 Feb 2017 13:04:46 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-5815) Add resource files configuration for Yarn Mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Feb 2017 13:05:50 -0000 [ https://issues.apache.org/jira/browse/FLINK-5815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15885754#comment-15885754 ] ASF GitHub Bot commented on FLINK-5815: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/3388#discussion_r103194179 --- Diff: flink-fs-tests/src/test/java/org/apache/flink/hdfstests/FileUtilsTest.java --- @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.hdfstests; + +import org.apache.flink.core.fs.FSDataInputStream; +import org.apache.flink.core.fs.FSDataOutputStream; +import org.apache.flink.core.fs.FileSystem; +import org.apache.flink.core.fs.Path; +import org.apache.flink.test.util.AbstractTestBase; +import org.apache.flink.util.FileUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.junit.*; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.net.URI; + +import static org.junit.Assert.fail; + +/** + * Created by wenlong.lwl on 2017/2/21. + */ +public class FileUtilsTest { + @ClassRule + public static TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private static File TEMP_DIR; + + private static String HDFS_ROOT_URI; + + private static MiniDFSCluster HDFS_CLUSTER; + + private static FileSystem FS; + + // ------------------------------------------------------------------------ + // startup / shutdown + // ------------------------------------------------------------------------ + + @BeforeClass + public static void createHDFS() { + try { + TEMP_DIR = temporaryFolder.newFolder(); + + Configuration hdConf = new Configuration(); + hdConf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, TEMP_DIR.getAbsolutePath()); + MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(hdConf); + HDFS_CLUSTER = builder.build(); + + HDFS_ROOT_URI = "hdfs://" + HDFS_CLUSTER.getURI().getHost() + ":" + + HDFS_CLUSTER.getNameNodePort() + "/"; + + FS = FileSystem.get(new URI(HDFS_ROOT_URI)); + } + catch (Exception e) { + e.printStackTrace(); + fail("Could not create HDFS mini cluster " + e.getMessage()); + } + } + + @AfterClass + public static void destroyHDFS() { + try { + HDFS_CLUSTER.shutdown(); + } + catch (Exception ignored) {} + } + + @Test + public void testCompareFs() throws IOException { + File localDir = temporaryFolder.newFolder(); + Assert.assertFalse(FileUtils.compareFs(new Path(localDir.toURI()).getFileSystem(), FS)); --- End diff -- For this test, I think we don't have to create a HDFSCluster to obtain an HDFS `FileSystem`. Can't we create the respective URIs? > Add resource files configuration for Yarn Mode > ---------------------------------------------- > > Key: FLINK-5815 > URL: https://issues.apache.org/jira/browse/FLINK-5815 > Project: Flink > Issue Type: Improvement > Components: Client, YARN > Affects Versions: 1.3.0 > Reporter: Wenlong Lyu > Assignee: Wenlong Lyu > > Currently in flink, when we want to setup a resource file to distributed cache, we need to make the file accessible remotely by a url, which is often difficult to maintain a service like that. What's more, when we want do add some extra jar files to job classpath, we need to copy the jar files to blob server when submitting the jobgraph. In yarn, especially in flip-6, the blob server is not running yet when we try to start a flink job. > Yarn has a efficient distributed cache implementation for application running on it, what's more we can be easily share the files stored in hdfs in different application by distributed cache without extra IO operations. > I suggest to introduce -yfiles, -ylibjars -yarchives options to FlinkYarnCLI to enable yarn user setup their job resource files by yarn distributed cache. The options is compatible with what is used in mapreduce, which make it easy to use for yarn user who generally has experience on using mapreduce. -- This message was sent by Atlassian JIRA (v6.3.15#6346)