Package com.taobao.zeus.store.mysql.persistence

Examples of com.taobao.zeus.store.mysql.persistence.ZeusUser


          GroupBean gb=readOnlyGroupManager.getGlobeGroupBean();
          chainLocal.set(new ChainException(causeJobId, gb));
        }
        final ChainException chain=chainLocal.get();
        final JobBean jobBean=chain.gb.getAllSubJobBeans().get(jobId);
        final ZeusUser owner=userManager.findByUid(jobBean.getJobDescriptor().getOwner());
        //延迟6秒发送邮件,保证日志已经输出到数据库
        new Thread(){
          public void run() {
            try {
              Thread.sleep(6000);
              StringBuffer sb=new StringBuffer();
              sb.append("Job任务(").append(jobId).append(")").append(jobBean.getJobDescriptor().getName()).append("运行失败");
              sb.append("<br/>");
              String type="";
              if(event.getTriggerType()==TriggerType.MANUAL){
                type="手动触发";
              }else if(event.getTriggerType()==TriggerType.MANUAL_RECOVER){
                type="手动恢复";
              }else if(event.getTriggerType()==TriggerType.SCHEDULE){
                type="自动调度";
              }
              sb.append("Job任务的触发类型为:"+type).append("<br/>");
              if(event.getHistory()!=null){
                sb.append("失败原因:"+jobHistoryManager.findJobHistory(event.getHistory().getId()).getLog().getContent().replaceAll("\\n", "<br/>"));
                String msg= "Zeus报警 JobId:"+jobId+" 任务运行失败";
                if(!jobBean.getDepender().isEmpty()){
                  msg+=",影响范围:"+getDependencyJobs(jobBean);
                }
                if(!causeJobId.equalsIgnoreCase(event.getJobId())){
                  msg+="(根本原因:job "+causeJobId+"运行失败)";
                }
                mailAlarm.alarm(event.getHistory().getId(), msg, sb.toString());
              }
            } catch (Exception e) {
              log.error("邮件发送出现异常",e);
            }
          };
        }.start();
       
        String msg="Job任务("+jobId+"-"+owner.getName()+"):"+jobBean.getJobDescriptor().getName()+" 运行失败";
        if(!jobBean.getDepender().isEmpty()){
          msg+=",影响范围:"+getDependencyJobs(jobBean);
        }
        if(!causeJobId.equalsIgnoreCase(event.getJobId())){
          msg+="(根本原因:job "+causeJobId+"运行失败)";
View Full Code Here


        query.setParameter(0, user.getUid());
        return query.list();
      }
    });
    if(list!=null && !list.isEmpty()){
      ZeusUser zu=list.get(0);
      zu.setEmail(user.getEmail());
      zu.setWangwang(user.getWangwang());
      zu.setName(user.getName());
      if(user.getPhone()!=null && !"".equals(user.getPhone())){
        zu.setPhone(user.getPhone());
      }
      zu.setGmtModified(new Date());
      getHibernateTemplate().update(zu);
    }else{
      user.setGmtCreate(new Date());
      user.setGmtModified(new Date());
      getHibernateTemplate().save(user);
View Full Code Here

public class UserServiceImpl implements UserService{
  @Autowired
  private UserManager userManager;
  @Override
  public ZUser getUser() {
    ZeusUser u= LoginUser.getUser();
    ZUser zu=new ZUser();
    zu.setName(u.getName());
    zu.setUid(u.getUid());
    zu.setSuper(Super.getSupers().contains(u.getUid()));
    return zu;
  }
View Full Code Here

    if(httpRequest.getRequestURI().equals("/check.taobao")){
      response.getWriter().write("success");
      return;
    }
   
    ZeusUser zeusUser=null;
    String uri=httpRequest.getRequestURI();
    if(uri.endsWith(".taobao") || uri.endsWith(".js") || uri.endsWith(".css") || uri.endsWith(".gif") ||
        uri.endsWith(".jpg") || uri.endsWith(".png") || uri.endsWith("dump.do")){
      chain.doFilter(request, response);
      return;
    }

    String uid=login.getUid(httpRequest);
    if(uid==null){
      return;
    }
    zeusUser=new ZeusUser();
    zeusUser.setEmail(login.getEmail(httpRequest));
    zeusUser.setUid(login.getUid(httpRequest));
    zeusUser.setName(login.getName(httpRequest));
    zeusUser.setPhone(login.getPhone(httpRequest));
    if(!uid.equals(httpRequest.getSession().getAttribute("user"))){
      userManager.addOrUpdateUser(zeusUser);
      httpRequest.getSession().setAttribute("user", zeusUser.getUid());
    }
    LoginUser.user.set(zeusUser);
   
    chain.doFilter(request, response);
  }
View Full Code Here

  }

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    ZeusUser user = LoginUser.getUser();
        String tableName = req.getParameter("table");
        String pathString = req.getParameter("path");

    resp.setCharacterEncoding("GBK");
    resp.setContentType("text/csv");
    resp.setHeader("Content-disposition", "attachment;filename="
        + tableName + ".csv");
    PrintWriter w = resp.getWriter();

    TableModel t = tableManager.getTableModel(tableName);
    String inputFormatString = t.getInputFormat();
    char fieldDelim = t.getFieldDelim()==null? DEFAULT_FIELD_DELIM:t.getFieldDelim().toCharArray()[0];
    char lineDelim = t.getLineDelim() == null ? DEFAULT_LINE_DELIM : t
        .getLineDelim().toCharArray()[0];

    final Configuration conf = ConfUtil.getDefaultCoreSite();
    Profile profile = profileManager.findByUid(user.getUid());
    if (profile != null) {
      String ugi = profile.getHadoopConf().get("hadoop.hadoop.job.ugi");
      if (ugi != null) {
        conf.set("hadoop.job.ugi", ugi);
      }
View Full Code Here

TOP

Related Classes of com.taobao.zeus.store.mysql.persistence.ZeusUser

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.