Review Board 1.7.22


PIG-2978 TestLoadStoreFuncLifeCycle fails with hadoop-2.0.x

Review Request #8121 - Created Nov. 19, 2012 and submitted

Cheolsoo Park
PIG-2978
Reviewers
pig
sms
pig-git
Please see:
https://issues.apache.org/jira/browse/PIG-2978
ant clean test -Dhadoopversion=20/23

Diff revision 1 (Latest)

  1. test/org/apache/pig/TestLoadStoreFuncLifeCycle.java: Loading...
test/org/apache/pig/TestLoadStoreFuncLifeCycle.java
Revision 9e453af New Change
[20] 33 lines
[+20]
34
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit;
34
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit;
35
import org.apache.pig.builtin.mock.Storage;
35
import org.apache.pig.builtin.mock.Storage;
36
import org.apache.pig.builtin.mock.Storage.Data;
36
import org.apache.pig.builtin.mock.Storage.Data;
37
import org.apache.pig.data.Tuple;
37
import org.apache.pig.data.Tuple;
38
import org.apache.pig.impl.logicalLayer.FrontendException;
38
import org.apache.pig.impl.logicalLayer.FrontendException;

    
   
39
import org.apache.pig.test.Util;
39
import org.junit.Test;
40
import org.junit.Test;
40

    
   
41

   
41
public class TestLoadStoreFuncLifeCycle {
42
public class TestLoadStoreFuncLifeCycle {
42

    
   
43

   
43
    public static String loaderSignature;
44
    public static String loaderSignature;
[+20] [20] 221 lines
[+20] [+] private static void logCaller(int id, Class<?> clazz, Object[] params) {
265
        StackTraceElement called = stackTrace[i + 1];
266
        StackTraceElement called = stackTrace[i + 1];
266
        String calledClass = clazz.getSimpleName();
267
        String calledClass = clazz.getSimpleName();
267

    
   
268

   
268
        String paramsString = null;
269
        String paramsString = null;
269
        for (Object param : params) {
270
        for (Object param : params) {
270
            String paramString = String.valueOf(param);
271
            String paramString = null;

    
   
272
            if (param instanceof Job) {

    
   
273
                paramString = Job.class.getName();

    
   
274
            } else {

    
   
275
                paramString = String.valueOf(param);

    
   
276
            }
271
            if (paramString.length() > MAX_PARAM_SIZE || paramString.contains("\n")) {
277
            if (paramString.length() > MAX_PARAM_SIZE || paramString.contains("\n")) {
272
                int end = paramString.indexOf('\n');
278
                int end = paramString.indexOf('\n');
273
                if (end == -1 || end > MAX_PARAM_SIZE) {
279
                if (end == -1 || end > MAX_PARAM_SIZE) {
274
                    end = MAX_PARAM_SIZE;
280
                    end = MAX_PARAM_SIZE;
275
                }
281
                }
[+20] [20] 62 lines
[+20] [+] public void testLoadStoreFunc() throws Exception {
338
        assertEquals("a", out.get(0).get(0));
344
        assertEquals("a", out.get(0).get(0));
339
        assertEquals("b", out.get(1).get(0));
345
        assertEquals("b", out.get(1).get(0));
340
        assertEquals("c", out.get(2).get(0));
346
        assertEquals("c", out.get(2).get(0));
341

    
   
347

   
342
        assertTrue("loader instanciation count increasing: " + Loader.count, Loader.count <= 3);
348
        assertTrue("loader instanciation count increasing: " + Loader.count, Loader.count <= 3);
343
        assertTrue("storer instanciation count increasing: " + Storer.count, Storer.count <= 4);
349
        assertTrue("storer instanciation count increasing: " + Storer.count, Storer.count <= (Util.isHadoop2_0() ? 5 : 4));
344

    
   
350

   
345
    }
351
    }
346

    
   
352

   
347
    /**
353
    /**
348
     * prints out a report on instantiation sites and method calls
354
     * prints out a report on instantiation sites and method calls
[+20] [20] 21 lines
  1. test/org/apache/pig/TestLoadStoreFuncLifeCycle.java: Loading...