Example #1
0
  private JobActor cloneJobActor(String fullJobId) {
    Collection<JobActor> actors = jobActorMap.get(fullJobId);
    if (actors == null || actors.isEmpty()) {
      log.error("Cannot expand actors for non-existing job: " + fullJobId);
      return null;
    }

    JobActor jobActor = actors.iterator().next(); // first actor
    GridJob job = state.getJobByFullId(fullJobId);

    if (job == null) {
      log.error("Cannot expand actors for unknown job: " + fullJobId);
      return null;
    }

    JobActor copy = jobActor.copy();
    copy.name += "#" + actors.size();
    jobActorMap.put(fullJobId, copy);
    return copy;
  }
Example #2
0
 public JobActor copy() {
   JobActor copy = new JobActor(pos, username);
   copy.name = name;
   copy.color = this.color;
   return copy;
 }
Example #3
0
 private JobActor createJobActor(GridJob job) {
   JobActor jobActor = new JobActor(null, job.getOwner());
   jobActor.color = legend.getItemColor(job.getOwner());
   jobActor.name = job.getFullJobId();
   return jobActor;
 }