Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-6587

Remove unused params in connection-related methods of Fetcher

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7.1
    • 2.8.0, 3.0.0-alpha1
    • None
    • None
    • Reviewed

    Description

      There are some unused params in Fecther#openConnectionWithRetry.The code is following:

      private void openConnectionWithRetry(MapHost host,
            Set<TaskAttemptID> remaining, URL url) throws IOException {
          long startTime = Time.monotonicNow();
          boolean shouldWait = true;
          while (shouldWait) {
            try {
              openConnection(url);
              shouldWait = false;
            } catch (IOException e) {
              if (!fetchRetryEnabled) {
                 // throw exception directly if fetch's retry is not enabled
                 throw e;
              }
              if ((Time.monotonicNow() - startTime) >= this.fetchRetryTimeout) {
                LOG.warn("Failed to connect to host: " + url + "after " 
                    + fetchRetryTimeout + " milliseconds.");
                throw e;
              }
              try {
                Thread.sleep(this.fetchRetryInterval);
              } catch (InterruptedException e1) {
                if (stopped) {
                  return;
                }
              }
            }
          }
        }
      

      we can see that the param remaing and host is not be used in this method. So we need to remove these param and update the method params which invoke this method.

      Attachments

        1. MAPREDUCE-6587.001.patch
          2 kB
          Yiqun Lin

        Activity

          People

            linyiqun Yiqun Lin
            linyiqun Yiqun Lin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: