Return-Path: X-Original-To: apmail-pig-commits-archive@www.apache.org Delivered-To: apmail-pig-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7807F7AEA for ; Thu, 21 Jul 2011 00:36:20 +0000 (UTC) Received: (qmail 68287 invoked by uid 500); 21 Jul 2011 00:36:20 -0000 Delivered-To: apmail-pig-commits-archive@pig.apache.org Received: (qmail 68216 invoked by uid 500); 21 Jul 2011 00:36:19 -0000 Mailing-List: contact commits-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pig.apache.org Delivered-To: mailing list commits@pig.apache.org Received: (qmail 68207 invoked by uid 99); 21 Jul 2011 00:36:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 00:36:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 00:36:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D35CB238890D for ; Thu, 21 Jul 2011 00:35:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1148989 - in /pig/trunk: contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVStorage.java src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java Date: Thu, 21 Jul 2011 00:35:56 -0000 To: commits@pig.apache.org From: daijy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110721003556.D35CB238890D@eris.apache.org> Author: daijy Date: Thu Jul 21 00:35:55 2011 New Revision: 1148989 URL: http://svn.apache.org/viewvc?rev=1148989&view=rev Log: PIG-2125: Make Pig work with hadoop .NEXT (PIG-2125-5.patch) Modified: pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVStorage.java pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java Modified: pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVStorage.java URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVStorage.java?rev=1148989&r1=1148988&r2=1148989&view=diff ============================================================================== --- pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVStorage.java (original) +++ pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVStorage.java Thu Jul 21 00:35:55 2011 @@ -21,6 +21,7 @@ import static org.junit.Assert.assertEqu import java.io.IOException; import java.util.Iterator; +import java.util.Properties; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -40,7 +41,7 @@ public class TestCSVStorage { public TestCSVStorage() throws ExecException, IOException { cluster = MiniCluster.buildCluster(); - pigServer = new PigServer(ExecType.LOCAL, cluster.getProperties()); + pigServer = new PigServer(ExecType.LOCAL, new Properties()); pigServer.getPigContext().getProperties() .setProperty("mapred.map.max.attempts", "1"); pigServer.getPigContext().getProperties() Modified: pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java?rev=1148989&r1=1148988&r2=1148989&view=diff ============================================================================== --- pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java (original) +++ pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java Thu Jul 21 00:35:55 2011 @@ -64,7 +64,8 @@ import org.apache.pig.pen.POOptimizeDisa public class HExecutionEngine { public static final String JOB_TRACKER_LOCATION = "mapred.job.tracker"; - private static final String FILE_SYSTEM_LOCATION = "fs.defaultFS"; + private static final String FILE_SYSTEM_LOCATION = "fs.default.name"; + private static final String ALTERNATIVE_FILE_SYSTEM_LOCATION = "fs.defaultFS"; private static final String HADOOP_SITE = "hadoop-site.xml"; private static final String CORE_SITE = "core-site.xml"; @@ -175,10 +176,14 @@ public class HExecutionEngine { properties.setProperty(JOB_TRACKER_LOCATION, LOCAL ); properties.setProperty(FILE_SYSTEM_LOCATION, "file:///"); + properties.setProperty(ALTERNATIVE_FILE_SYSTEM_LOCATION, "file:///"); } cluster = properties.getProperty(JOB_TRACKER_LOCATION); nameNode = properties.getProperty(FILE_SYSTEM_LOCATION); + if (nameNode==null) + nameNode = (String)pigContext.getProperties().get(ALTERNATIVE_FILE_SYSTEM_LOCATION); + if (cluster != null && cluster.length() > 0) { if(!cluster.contains(":") && !cluster.equalsIgnoreCase(LOCAL)) {