MCPcopy Create free account
hub / github.com/apache/pig / getSingleton

Method getSingleton

src/org/apache/pig/ExecTypeProvider.java:61–73  ·  view source on GitHub ↗

This method attempts to return a singleton instance of the given exec type. Only works for MR ExecTypes as these are the only ExecTypes that we have constants in the Pig codebase for. @param execType @return

(ExecType execType)

Source from the content-addressed store, hash-verified

59 * @return
60 */
61 private static ExecType getSingleton(ExecType execType) {
62 if (execType instanceof MRExecType) {
63 return ExecType.MAPREDUCE;
64 }
65 if (execType instanceof LocalExecType) {
66 return ExecType.LOCAL;
67 }
68 // if it is not MR specific but rather a different
69 // execution engine, we don't have access to any
70 // constants that can act as singletons, so we just
71 // use the given instance
72 return execType;
73 }
74
75 public static ExecType fromString(String execType) throws PigException {
76 Properties properties = PropertiesUtil.loadDefaultProperties();

Callers 1

selectExecTypeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected