예제 #1
0
    public Object visit(ConnectionEndEvent event) {
      final MutableConnectionInfo conn = connectionMap.remove(event.connectionId);
      if (conn == null) {
        return missing(event);
      }
      foo(conn, event);
      foo(server.aggConn, event);

      // Since the connection info will no longer be in the table,
      // broadcast the final info to anyone who is interested.
      RolapUtil.MONITOR_LOGGER.debug(conn.fix());
      return null;
    }
예제 #2
0
    public Object visit(SqlStatementEndEvent event) {
      final MutableSqlStatementInfo sql = sqlStatementMap.remove(event.sqlStatementId);
      if (sql == null) {
        return missing(event);
      }
      foo(sql, event);
      foo(sql.stmt.aggSql, event);
      foo(server.aggSql, event);

      // Since the SQL statement info will no longer be in the table,
      // broadcast the final info to anyone who is interested.
      RolapUtil.MONITOR_LOGGER.debug(sql.fix());
      return null;
    }
예제 #3
0
    public Object visit(ExecutionEndEvent event) {
      final MutableExecutionInfo exec = executionMap.remove(event.executionId);
      if (exec == null) {
        return missing(event);
      }
      retiredExecutionMap.put(exec.executionId, exec);
      foo(exec, event);
      foo(exec.stmt.aggExec, event);
      foo(exec.stmt.conn.aggExec, event);
      foo(server.aggExec, event);

      // Since the execution info will no longer be in the table,
      // broadcast the final info to anyone who is interested.
      RolapUtil.MONITOR_LOGGER.debug(exec.fix());
      return null;
    }
예제 #4
0
 /**
  * Retrieves the response from the queue matching the given key, blocking until it is received.
  *
  * @param k Response
  * @return Response
  * @throws InterruptedException if interrupted while waiting
  */
 public synchronized V take(K k) throws InterruptedException {
   final V v = taken.remove(k);
   if (v != null) {
     return v;
   }
   // Take the laundry out of the machine. If it's ours, leave with it.
   // If it's someone else's, fold it neatly and put it on the pile.
   for (; ; ) {
     final Pair<K, V> pair = queue.take();
     if (pair.left.equals(k)) {
       return pair.right;
     } else {
       taken.put(pair.left, pair.right);
     }
   }
 }