Package com.taobao.top.analysis.node.event

Examples of com.taobao.top.analysis.node.event.SendMonitorInfoEvent


   
    MasterMonitorInfo info = null;

    try {
     
      final SendMonitorInfoEvent event = sendSlaveMonitorInfoEvent;
      if(logger.isInfoEnabled()) {
        logger.info("Trying to send monitor info to master");
      }
     
      responseQueue.put(sendSlaveMonitorInfoEvent.getSequence(), sendSlaveMonitorInfoEvent);
     
      Channel channel = getChannel(leaderChannel);
      sendSlaveMonitorInfoEvent.setChannel(channel);
      ChannelFuture channelFuture = channel.write(sendSlaveMonitorInfoEvent);

      channelFuture.addListener(new ChannelFutureListener() {
        public void operationComplete(ChannelFuture future) {
          if (!future.isSuccess()) {
            responseQueue.remove(event.getSequence());
            logger.error("Slavesocket write error when trying to get tasks from master.", future.getCause());
            future.getChannel().close();
          }
        }
      });
View Full Code Here


          }
      }
      if(nodeEvent.getEventCode().equals(MasterEventCode.SEND_MONITOR_INFO)) {
         //INFO信息记录M/S通信内容
          if(logger.isInfoEnabled()) {
              SendMonitorInfoEvent requestEvent = (SendMonitorInfoEvent)nodeEvent;
                  StringBuffer stringBuffer = new StringBuffer("receive send_monitor_info event, result:{");
                  stringBuffer.append(requestEvent.getSlaveMonitorInfo().toString()).append("}");
                  stringBuffer.append("from slave:").append(channel.getRemoteAddress()).append(",squence:").append(nodeEvent.getSequence());
              logger.info(stringBuffer.toString());
          }
      }
    }
View Full Code Here

  private class ReportTask implements Runnable {
   
    @Override
    public void run() {
      try {
        SendMonitorInfoEvent event = new SendMonitorInfoEvent("monitor-info-" + idGenerator++);
        event.setSlaveMonitorInfo((SlaveMonitorInfo)monitorInfo.clone());
        MonitorUtil.monitor(event.getSlaveMonitorInfo());
        slaveConnector.sendMonitorInfo(event);
      } catch (CloneNotSupportedException e) {
        logger.error("Exception:", e);
      }
    }
View Full Code Here

TOP

Related Classes of com.taobao.top.analysis.node.event.SendMonitorInfoEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.