code: public final void setFinished() {
      if (!finished) {
        totalTime = ((Long) (System.currentTimeMillis() - startTime)).intValue();
        shardInfoUpdated = false;
        finished = true;
        rsp = null;
      }
    }
docs: Sets the finished.