pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cheol...@apache.org
Subject svn commit: r1403944 - in /pig/trunk: CHANGES.txt src/org/apache/pig/impl/streaming/ExecutableManager.java test/org/apache/pig/impl/streaming/TestExecutableManager.java
Date Wed, 31 Oct 2012 01:02:07 GMT
Author: cheolsoo
Date: Wed Oct 31 01:02:07 2012
New Revision: 1403944

URL: http://svn.apache.org/viewvc?rev=1403944&view=rev
Log:
PIG-3001: TestExecutableManager.testAddJobConfToEnv fails randomly

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/impl/streaming/ExecutableManager.java
    pig/trunk/test/org/apache/pig/impl/streaming/TestExecutableManager.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1403944&r1=1403943&r2=1403944&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Wed Oct 31 01:02:07 2012
@@ -336,6 +336,8 @@ OPTIMIZATIONS
 
 BUG FIXES
 
+PIG-3001: TestExecutableManager.testAddJobConfToEnv fails randomly (cheolsoo)
+
 PIG-3017: Pig's object serialization should use compression (jcoveney)
 
 PIG-2968: ColumnMapKeyPrune fails to prune a subtree inside foreach (knoguchi via cheolsoo)

Modified: pig/trunk/src/org/apache/pig/impl/streaming/ExecutableManager.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/impl/streaming/ExecutableManager.java?rev=1403944&r1=1403943&r2=1403944&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/impl/streaming/ExecutableManager.java (original)
+++ pig/trunk/src/org/apache/pig/impl/streaming/ExecutableManager.java Wed Oct 31 01:02:07
2012
@@ -252,32 +252,15 @@ public class ExecutableManager {
             }
             LOG.debug("Setting property in streaming environment: " + prop);
             envPut(env, prop, value);
-
-        }
-      }
-
-      String safeEnvVarName(String var) {
-        StringBuffer safe = new StringBuffer();
-        int len = var.length();
-        for (int i = 0; i < len; i++) {
-          char c = var.charAt(i);
-          char s;
-          if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')) {
-            s = c;
-          } else {
-            s = '_';
-          }
-          safe.append(s);
         }
-        return safe.toString();
-      }
+    }
 
-      void envPut(Map<String, String> env, String name, String value) {
+    void envPut(Map<String, String> env, String name, String value) {
         if (LOG.isDebugEnabled()) {
           LOG.debug("Add  env entry:" + name + "=" + value);
         }
         env.put(name, value);
-      }
+    }
 
     /**
      * Start execution of the external process.

Modified: pig/trunk/test/org/apache/pig/impl/streaming/TestExecutableManager.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/impl/streaming/TestExecutableManager.java?rev=1403944&r1=1403943&r2=1403944&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/impl/streaming/TestExecutableManager.java (original)
+++ pig/trunk/test/org/apache/pig/impl/streaming/TestExecutableManager.java Wed Oct 31 01:02:07
2012
@@ -36,23 +36,13 @@ public class TestExecutableManager {
     private static final Random r = new Random(100L);
 
     @Test
-    public void testSafeEnvVarName() {
-        ExecutableManager manager = new ExecutableManager();
-        assertEquals("foo", manager.safeEnvVarName("foo"));
-        assertEquals("", manager.safeEnvVarName(""));
-        assertEquals("foo_bar",manager.safeEnvVarName("foo.bar"));
-        assertEquals("foo_bar",manager.safeEnvVarName("foo$bar"));
-        assertEquals("foo_",manager.safeEnvVarName("foo "));
-    }
-
-    @Test
     public void testAddJobConfToEnv() {
         StringBuilder streamingEnv = null;
         Configuration conf = new Configuration();
         Map<String, String> all = Maps.newHashMap();
         for (int i = 0; i < 10000; i++) {
-            String key = RandomStringUtils.random(10);
-            String value = RandomStringUtils.random(10);
+            String key = RandomStringUtils.randomAlphanumeric(10);
+            String value = RandomStringUtils.randomAlphanumeric(10);
             all.put(key, value);
         }
         Map<String, String> toInclude = Maps.newHashMap();



Mime
View raw message