protected void addTipToFinish(TaskInProgress tip,
                                TaskUmbilicalProtocol umbilicalProtocol) {
    long currentTime = System.currentTimeMillis();
    long finishTime = currentTime + Math.abs(rand.nextLong()) %
        timeToFinishTask;
    LOG.info("Adding TIP " + tip.getTask().getTaskID() +
        " to finishing queue with start time " +
        currentTime + " and finish time " + finishTime +
        " (" + ((finishTime - currentTime) / 1000.0) + " sec) to thread " +
        getName());
    TipToFinish ttf = new TipToFinish(tip, finishTime, umbilicalProtocol);
    tipQueue.put(ttf);
    // Interrupt the waiting thread. We could put in additional logic to only
    // interrupt when necessary, but probably not worth the complexity.
    this.interrupt();
  }
protected void addTipToFinish ( TaskInProgress tip , TaskUmbilicalProtocol umbilicalProtocol ) { long currentTime = System . currentTimeMillis ( ) ; long finishTime = currentTime + Math . abs ( rand . nextLong ( ) ) % timeToFinishTask ; LOG . info ( "Adding TIP " + tip . getTask ( ) . getTaskID ( ) + " to finishing queue with start time " + currentTime + " and finish time " + finishTime + " (" + ( ( finishTime - currentTime ) / 1000.0 ) + " sec) to thread " + getName ( ) ) ; TipToFinish ttf = new TipToFinish ( tip , finishTime , umbilicalProtocol ) ; tipQueue . put ( ttf ) ; this . interrupt ( ) ; }
Add the specified TaskInProgress to the priority queue of tasks to finish.
@param tip
@param umbilicalProtocol