(Properties properties)
| 32 | private static final Log log = LogFactory.getLog(ExecTypeProvider.class); |
| 33 | |
| 34 | public static ExecType selectExecType(Properties properties) |
| 35 | throws PigException { |
| 36 | |
| 37 | ServiceLoader<ExecType> frameworkLoader = ServiceLoader |
| 38 | .load(ExecType.class); |
| 39 | |
| 40 | for (ExecType execType : frameworkLoader) { |
| 41 | log.info("Trying ExecType : " + execType); |
| 42 | if (execType.accepts(properties)) { |
| 43 | log.info("Picked " + execType + " as the ExecType"); |
| 44 | return getSingleton(execType); |
| 45 | } else { |
| 46 | log.debug("Cannot pick " + execType + " as the ExecType"); |
| 47 | } |
| 48 | } |
| 49 | throw new PigException("Unknown exec type: " |
| 50 | + properties.getProperty("exectype"), 2040); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * This method attempts to return a singleton instance of the given exec |
no test coverage detected