Package com.taobao.zeus.model

Examples of com.taobao.zeus.model.Profile


          .findDebugHistory(historyId);
      long maxTime;
      FileDescriptor fd;
      try {
        fd = context.getFileManager().getFile(his.getFileId());
        Profile pf = context.getProfileManager().findByUid(
            fd.getOwner());
        String maxTimeString = pf.getHadoopConf().get(
            "zeus.job.maxtime");
        if (maxTimeString == null || maxTimeString.trim().isEmpty()) {
          continue;
        }
        maxTime = Long.parseLong(maxTimeString);
View Full Code Here


    });
  }

  @Override
  public void update(String uid,Profile p) throws Exception{
    Profile old=findByUid(uid);
    if(old==null){
      old=new Profile();
      old.setUid(uid);
      getHibernateTemplate().save(PersistenceAndBeanConvert.convert(old));
      old=findByUid(uid);
    }
    p.setUid(old.getUid());
    p.setGmtModified(new Date());
    getHibernateTemplate().update(PersistenceAndBeanConvert.convert(p));
  }
View Full Code Here

      jobContext.getProperties().setProperty("preview.hdfs.path", path);
      jobContext.getProperties().setProperty("preview.hdfs.inputFormat",
          model.getInputFormat());
      jobContext.getProperties().setProperty("preview.hdfs.isCompressed",
          String.valueOf(model.isCompressed()));
      Profile profile = profileManager.findByUid(LoginUser.getUser()
          .getUid());
      if (profile != null) {
        String ugi = profile.getHadoopConf().get(
            "hadoop.hadoop.job.ugi");
        jobContext.getProperties().setProperty(
            "preview.hadoop.job.ugi", ugi);
      }
      DataPreviewJob job = new DataPreviewJob(jobContext);
View Full Code Here

    DecimalFormat df1 = new DecimalFormat("0 B");
    DecimalFormat df2 = new DecimalFormat("0.000 KB");
    DecimalFormat df3 = new DecimalFormat("0.000 MB");
    DecimalFormat df4 = new DecimalFormat("0.000 GB");

    Profile profile = profileManager.findByUid(LoginUser.getUser()
        .getUid());
    String ugi = null;
    if (profile != null) {
      ugi = profile.getHadoopConf().get(
          "hadoop.hadoop.job.ugi");
    }
    long size = HDFSManager.getPathSize(p.getPath(), ugi);
    String sizeString = "";
View Full Code Here

 
  public static Profile convert(ProfilePersistence pp){
    if(pp==null){
      return null;
    }
    Profile p=new Profile();
    if(pp.getHadoopConf()!=null){
      JSONObject o=JSONObject.fromObject(pp.getHadoopConf());
      for(Object key:o.keySet()){
        p.getHadoopConf().put(key.toString(), o.getString(key.toString()));
      }
    }
    p.setId(pp.getId()==null?null:pp.getId().toString());
    p.setUid(pp.getUid());
    p.setGmtCreate(pp.getGmtCreate());
    p.setGmtModified(pp.getGmtModified());
    return p;
  }
View Full Code Here

    jobContext.setResources(resources);
    hp.setProperty(PropertyKeys.JOB_SCRIPT, script);
    FileManager fileManager=(FileManager) applicationContext.getBean("fileManager");
    ProfileManager profileManager=(ProfileManager) applicationContext.getBean("profileManager");
    String owner=fileManager.getFile(history.getFileId()).getOwner();
    Profile profile=profileManager.findByUid(owner);
    if(profile!=null && profile.getHadoopConf()!=null){
      for(String key:profile.getHadoopConf().keySet()){
        hp.setProperty(key, profile.getHadoopConf().get(key));
      }
    }
    jobContext.setProperties(new RenderHierarchyProperties(hp));
    hp.setProperty("hadoop.mapred.job.zeus_id", "zeus_debug_"+history.getId());
    List<Job> pres = new ArrayList<Job>(1);
View Full Code Here

  @Autowired
  private ProfileManager profileManager;
  @Override
  public void updateHadoopConf(Map<String, String> conf) throws GwtException{
    String uid=LoginUser.getUser().getUid();
    Profile p=profileManager.findByUid(uid);
    if(p==null){
      p=new Profile();
    }
    p.setHadoopConf(conf);
    try {
      profileManager.update(uid, p);
    } catch (Exception e) {
      log.error("updateHadoopConf",e);
      throw new GwtException(e.getMessage());
View Full Code Here

      throw new GwtException(e.getMessage());
    }
  }
  @Override
  public ProfileModel getProfile() {
    Profile p=profileManager.findByUid(LoginUser.getUser().getUid());
    if(p==null){
      try {
        profileManager.update(LoginUser.getUser().getUid(), new Profile());
        p=profileManager.findByUid(LoginUser.getUser().getUid());
      } catch (Exception e) {
        log.error("getProfile",e);
      }
    }
    if(p!=null){
      ProfileModel pm=new ProfileModel();
      pm.setUid(LoginUser.getUser().getUid());
      pm.setHadoopConf(p.getHadoopConf());
      return pm;
    }
    return null;
  }
View Full Code Here

    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);
      }
    }
    JobConf confQ = new JobConf(conf);
View Full Code Here

TOP

Related Classes of com.taobao.zeus.model.Profile

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.