@ Override public void cancelCurrentQuery ( ) throws SQLException { try ( MasterProtocol copiedProtocol = new MasterProtocol ( urlParser , new GlobalStateInfo ( ) , new ReentrantLock ( ) ) ) { copiedProtocol . setHostAddress ( getHostAddress ( ) ) ; copiedProtocol . connect ( ) ; //no lock, because there is already a query running that possessed the lock. copiedProtocol . executeQuery ( "KILL QUERY " + serverThreadId ) ; } interrupted = true ; }
Cancels the current query - clones the current protocol and executes a query using the new connection .