Example #1
0
  /**
   * @param taskNodeId Task node ID.
   * @param taskName Task name.
   * @param dep Deployment.
   * @param taskClsName Task class name.
   * @param sesId Task session ID.
   * @param startTime Task execution start time.
   * @param endTime Task execution end time.
   * @param siblings Collection of siblings.
   * @param attrs Session attributes.
   * @param ctx Grid Kernal Context.
   */
  public GridTaskSessionImpl(
      UUID taskNodeId,
      String taskName,
      @Nullable GridDeployment dep,
      String taskClsName,
      GridUuid sesId,
      long startTime,
      long endTime,
      Collection<GridJobSibling> siblings,
      Map<Object, Object> attrs,
      GridKernalContext ctx) {
    assert taskNodeId != null;
    assert taskName != null;
    assert sesId != null;
    assert attrs != null;
    assert ctx != null;

    this.taskNodeId = taskNodeId;
    this.taskName = taskName;
    this.dep = dep;

    // Note that class name might be null here if task was not explicitly
    // deployed.
    this.taskClsName = taskClsName;
    this.sesId = sesId;
    this.startTime = startTime;
    this.endTime = endTime;
    this.siblings = siblings != null ? Collections.unmodifiableCollection(siblings) : null;
    this.ctx = ctx;

    this.attrs.putAll(attrs);
  }
Example #2
0
  /** @param siblings Siblings. */
  public void addJobSiblings(Collection<GridJobSibling> siblings) {
    assert isTaskNode();

    synchronized (mux) {
      Collection<GridJobSibling> tmp = new ArrayList<GridJobSibling>(this.siblings);

      tmp.addAll(siblings);

      this.siblings = Collections.unmodifiableCollection(tmp);
    }
  }
Example #3
0
 /** @param siblings Siblings. */
 public void setJobSiblings(Collection<GridJobSibling> siblings) {
   synchronized (mux) {
     this.siblings = Collections.unmodifiableCollection(siblings);
   }
 }