@SuppressWarnings("unchecked")
private void deactivateRequest(QueryRequest request,RunState newRunState) {
LOG.info("DeActivating Query:" + request.getSourceQuery().getQueryId() + " RunState:" + request.getRunState().toString());
// preserve last run state ...
RunState lastRunState = request.getRunState();
// set new run state
request.setRunState(newRunState);
// remote from active or remote list
_activeRemoteOrLocalQueries.remove(request.getSourceQuery().getQueryId());