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

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


    MasterNode masterNode2 = buildMaster("master-config-ms2.properties");
     
   
    //build SlaveNode
    SlaveNode slaveNode = buildSlave("slave-config.properties",false);
    SlaveNodeEvent event = new SlaveNodeEvent();
    event.setEventCode(SlaveEventCode.SUSPEND);
    slaveNode.addEvent(event);
    slaveNode.startNode();
   
    Thread.sleep(3000);
   
    event.setEventCode(SlaveEventCode.AWAKE);
    slaveNode.addEvent(event);
   
   
    Thread.sleep(35 * 1000);
   
 
View Full Code Here


   
    tunnel.getMasterSide().offer(requestEvent);
   
    try {
     
      SlaveNodeEvent event = tunnel.getSlaveSide().poll(10, TimeUnit.SECONDS);
     
      if (event != null && event.getEventCode().equals(SlaveEventCode.GET_TASK_RESP))
      {
        List<JobTask> jobTasks = ((GetTaskResponseEvent)event).getJobTasks();
       
        JobTask[] result = new JobTask[jobTasks.size()];
       
View Full Code Here

   
    tunnel.getMasterSide().offer(jobResponseEvent);
   
    try {
     
      SlaveNodeEvent event = tunnel.getSlaveSide().poll(10, TimeUnit.SECONDS);
     
      if (event != null && event.getEventCode().equals(SlaveEventCode.SEND_RESULT_RESP))
      {
        return ((SendResultsResponseEvent)event).getResponse();
     
     
    } catch (InterruptedException e) {
View Full Code Here

      SendMonitorInfoEvent sendSlaveMonitorInfoEvent) {
   
    tunnel.getMasterSide().offer(sendSlaveMonitorInfoEvent);
    try {
     
      SlaveNodeEvent event = tunnel.getSlaveSide().poll(10, TimeUnit.SECONDS);
      if (event != null && event.getEventCode().equals(SlaveEventCode.SEND_RESULT_RESP)) {
        return ((SendMonitorInfoResponseEvent)event).getMasterMonitorInfo();
     
     
    } catch (InterruptedException e) {
      logger.error(e,e);
View Full Code Here

  }

  @Override
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
      throws Exception {
    SlaveNodeEvent slaveEvent = (SlaveNodeEvent)e.getMessage();
   
    if (slaveEvent != null)
    {
        if(SlaveEventCode.GET_TASK_RESP.equals(slaveEvent.getEventCode())) {
            slaveNode.addEvent(slaveEvent);
        }
      if (responseQueue.containsKey(slaveEvent.getSequence()))
      {
        responseQueue.get(slaveEvent.getSequence()).setResponse(slaveEvent);
        responseQueue.get(slaveEvent.getSequence()).getResultReadyFlag().countDown();
       
//        if(!slaveEventTimeQueue.remove(responseQueue.get(slaveEvent.getSequence())))
//          logger.error("event not in timeout queue, please check code,maybe it be wrong!");
       
        responseQueue.remove(slaveEvent.getSequence());
      }
      else
        logger.error("receive invalidate response,sequence :" + slaveEvent.getSequence());
    }
  }
View Full Code Here

TOP

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

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.