Called to reset ThreadLocal or static states that PigServer depends on when a test suite has testcases switching between LOCAL and MAPREDUCE/TEZ execution modes
()
| 1441 | * execution modes |
| 1442 | */ |
| 1443 | public static void resetStateForExecModeSwitch() { |
| 1444 | FileLocalizer.setInitialized(false); |
| 1445 | |
| 1446 | // For tez testing, we want to avoid TezResourceManager/LocalResource reuse |
| 1447 | // (when switching between local and mapreduce/tez) |
| 1448 | TezResourceManager.dropInstance(); |
| 1449 | |
| 1450 | // TODO: once we have Tez local mode, we can get rid of this. For now, |
| 1451 | // if we run this test suite in Tez mode and there are some tests |
| 1452 | // in LOCAL mode, we need to set ScriptState to |
| 1453 | // null to force ScriptState gets initialized every time. |
| 1454 | ScriptState.start(null); |
| 1455 | } |
| 1456 | |
| 1457 | public static boolean isMapredExecType(ExecType execType) { |
| 1458 | return execType == ExecType.MAPREDUCE; |
no test coverage detected