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

Remove unused params in connection-related methods of Fetcher

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: