anjuke/hwi — pull request #18 by xielong (2013-06-26 13:33:06+00:00)
Title: fix:Memory leak exists in the function runCmd() in the class QueryRunner.

Hive Relevant code:

static Map mapDrivers = new HashMap();

public static CommandProcessor get(String cmd, HiveConf conf) {
String cmdl = cmd.toLowerCase();

if ("set".equals(cmdl)) {
return new SetProcessor();
} else if ("dfs".equals(cmdl)) {
SessionState ss = SessionState.get();
return new DfsProcessor(ss.getConf());
} else if ("add".equals(cmdl)) {
return new AddResourceProcessor();
} else if ("delete".equals(cmdl)) {
return new DeleteResourceProcessor();
} else if (!isBlank(cmd)) {
if (conf == null) {
return new Driver();
}

Driver drv = mapDrivers.get(conf);
if (drv == null) {
drv = new Driver();
mapDrivers.put(conf, drv);
}
drv.init();
return drv;
}