Package com.taobao.top.analysis.node.job

Examples of com.taobao.top.analysis.node.job.JobTaskExecuteInfo


    java.io.BufferedReader reader = null;
    InputStream in = null;
   
    try
    {
      in = hdfsInputAdaptor.getInputFormJob(jobtask, new JobTaskExecuteInfo());
     
      reader = new java.io.BufferedReader(new java.io.InputStreamReader(in));
     
      String aa = null;
     
View Full Code Here


  @Override
  public JobTaskResult doAnalysis(JobTask jobTask) throws UnsupportedEncodingException, IOException {
   
    InputStream in = null;
    JobTaskExecuteInfo taskExecuteInfo = new JobTaskExecuteInfo();
   
    try
    {
      // 寻找输入适配器
      for(IInputAdaptor inputAdaptor : inputAdaptors)
      {
        if (inputAdaptor.ignore(jobTask.getInput()))
          continue;
       
        in = inputAdaptor.getInputFormJob(jobTask, taskExecuteInfo);
       
        if (in != null)
          break;
      }
     
      if (in == null)
      {
          if(config.isEnableAlert()) {
              AnalyzerUtil.sendOutAlert(Calendar.getInstance(),
                        config.getAlertUrl(),
                        config.getAlertFrom(),
                        config.getAlertModel(),
                        config.getAlertWangWang(),
                        "Can't connect resource:" + jobTask.getInput());
          }
          JobTaskResult jobTaskResult = new JobTaskResult();
            jobTaskResult.setJobName(jobTask.getJobName());
            jobTaskResult.addTaskId(jobTask.getTaskId());
            jobTaskResult.setJobEpoch(jobTask.getJobEpoch());
            taskExecuteInfo.setAnalysisConsume(0);
              taskExecuteInfo.setEmptyLine(0);
              taskExecuteInfo.setErrorLine(0);
              taskExecuteInfo.setJobDataSize(0);
              taskExecuteInfo.setTotalLine(0);
              taskExecuteInfo.setTaskId(jobTask.getTaskId());
              taskExecuteInfo.setSuccess(false);
             
              jobTaskResult.addTaskExecuteInfo(taskExecuteInfo);
        logger.error("Input not found! input : " + jobTask.getInput());
        return jobTaskResult;
      }
View Full Code Here

                  .append(jobTask.getTaskId()).append(",recycleCounter=")
                  .append(jobTask.getRecycleCounter().get()).append(",slaveIp=")
                  .append(jobTaskResult.getSlaveIp()).append(",efficiency=")
                  .append(jobTaskResult.getEfficiency()).append(",");
              
                JobTaskExecuteInfo executeInfo = jobTaskResult.getTaskExecuteInfos().get(jobTask.getTaskId());
               
                if (executeInfo != null) {
                    log.append("analysisConsume=").append(executeInfo.getAnalysisConsume()).append(",")
                        .append("jobDataSize=").append(executeInfo.getJobDataSize()).append(",").append("totalLine=")
                        .append(executeInfo.getTotalLine()).append(",").append("errorLine=")
                        .append(executeInfo.getErrorLine()).append(",").append("emptyLine=")
                        .append(executeInfo.getEmptyLine()).append(",fileBegin=").append(executeInfo.getFileBegin())
                        .append(",fileLength=").append(executeInfo.getFileLength());
                    if(jobTask.getInput().startsWith("hub:")) {
                        jobTask.setJobSourceTimeStamp(executeInfo.getTimestamp());
                        job.updateCursor(jobTask.getUrl(), executeInfo.getFileBegin(), executeInfo.getFileLength(), executeInfo.getTimestamp());
                    }
                }
                else
                  logger.error(new StringBuilder().append("taskId : ").
                      append(jobTask.getTaskId()).append(" executeInfo is null!").toString());
View Full Code Here

TOP

Related Classes of com.taobao.top.analysis.node.job.JobTaskExecuteInfo

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.