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

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


    GetTaskRequestEvent event = new GetTaskRequestEvent("1234567");
    event.setRequestJobCount(2);
   
    jobManager.getUnDoJobTasks(event);
   
    GetTaskResponseEvent eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
   
    Assert.assertEquals(event.getSequence(), eventresp.getSequence());
    Assert.assertEquals(2, eventresp.getJobTasks().size());
   
    event = new GetTaskRequestEvent("1234567");
    event.setRequestJobCount(2);
    event.setJobName("job2");
   
    jobManager.getUnDoJobTasks(event);
   
    eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
   
    Assert.assertEquals(event.getSequence(), eventresp.getSequence());
    Assert.assertEquals(1, eventresp.getJobTasks().size());
   
  }
View Full Code Here


    event.setRequestJobCount(3);
   
    jobManager.getUnDoJobTasks(event);
   
   
    GetTaskResponseEvent eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
   
    Assert.assertEquals(event.getSequence(), eventresp.getSequence());
    Assert.assertEquals(2, eventresp.getJobTasks().size());
   
    defaultAnalysisEngine.releaseResource();
  }
View Full Code Here

    GetTaskRequestEvent event = new GetTaskRequestEvent("1234567");
    event.setRequestJobCount(3);
   
    jobManager.getUnDoJobTasks(event);
   
    GetTaskResponseEvent eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
   
    Assert.assertEquals(event.getSequence(), eventresp.getSequence());
    Assert.assertEquals(3, eventresp.getJobTasks().size());
   
    //验证没有任务
    event = new GetTaskRequestEvent("12345678");
    event.setRequestJobCount(3);
   
    jobManager.getUnDoJobTasks(event);
   
    eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
   
    Assert.assertEquals(event.getSequence(), eventresp.getSequence());
    Assert.assertEquals(0, eventresp.getJobTasks().size());
   
    //任务被回收
    Thread.sleep(21 * 1000);
   
    //验证一共3个任务
    jobManager.checkJobStatus();
   
    event = new GetTaskRequestEvent("12345679");
    event.setRequestJobCount(3);
   
    jobManager.getUnDoJobTasks(event);
   
    eventresp = (GetTaskResponseEvent)tunnel.getSlaveSide().poll();
   
    Assert.assertEquals(event.getSequence(), eventresp.getSequence());
    Assert.assertEquals(3, eventresp.getJobTasks().size());
   
    Assert.assertEquals(1,eventresp.getJobTasks().get(0).getRecycleCounter().get());
       
  }
View Full Code Here

     
      // 在SlaveConnectorHandler. messageReceived中会countDown
      requestEvent.getResultReadyFlag().await(
          config.getMaxClientEventWaitTime(), TimeUnit.SECONDS);

      GetTaskResponseEvent responseEvent = (GetTaskResponseEvent) requestEvent
          .getResponse();

      if (responseEvent != null && responseEvent.getJobTasks() != null
          && responseEvent.getJobTasks().size() > 0) {
        tasks = new JobTask[responseEvent.getJobTasks().size()];
        responseEvent.getJobTasks().toArray(tasks);
      }

    } catch (Exception ex) {
      logger.error(ex, ex);
    }
View Full Code Here

   * @param sequence
   * @param jobTasks
   */
  public void echoGetJobTasks(String sequence,List<JobTask> jobTasks,Object channel)
  {
    GetTaskResponseEvent event = new GetTaskResponseEvent(sequence);
    event.setJobTasks(jobTasks);
    event.setChannel(channel);
   
    masterConnector.echoGetJobTasks(event);
  }
View Full Code Here

TOP

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

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.