Created
September 9, 2019 11:20
-
-
Save kazabubu/ffcdc774307abf810c0d3d80886e4f62 to your computer and use it in GitHub Desktop.
Killing TEZ Queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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