Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Killing TEZ Queries
public class PoolableRegisteredConnectionFactory extends PoolableConnectionFactory {
private ConnectionRegister connectionRegister;
@Override
public Object makeObject() throws Exception {
PoolableConnection conn = (PoolableConnection) super.makeObject();
if (connectionRegister != null) {
connectionRegister.register(conn);
}
return conn;
}
@Override
public void destroyObject(Object obj) throws Exception {
if (obj instanceof PoolableConnection) {
((PoolableConnection) obj).reallyClose();
if (connectionRegister != null) {
connectionRegister.unregister((PoolableConnection) obj);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.