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

impove JobEndNotifier#httpNotification With recommended methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • mrv1
    • Reviewed

    Description

      JobEndNotifier#httpNotification's DefaultHttpClient has been Deprecated, use the recommended method instead

      JobEndNotifier#httpNotification

      private static int httpNotification(String uri, int timeout)
            throws IOException, URISyntaxException {
          DefaultHttpClient client = new DefaultHttpClient();
          client.getParams()
              .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeout)
              .setLongParameter(ClientPNames.CONN_MANAGER_TIMEOUT, (long) timeout);
          HttpGet httpGet = new HttpGet(new URI(uri));
          httpGet.setHeader("Accept", "*/*");
          return client.execute(httpGet).getStatusLine().getStatusCode();
        } 
      • CoreConnectionPNames.SO_TIMEOUT
      • Use RequestConfig.setSocketTimeout instead
      Deprecated.Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). A timeout value of zero is interpreted as an infinite timeout. 

       

      • ClientPNames.CONN_MANAGER_TIMEOUT
      • Use RequestConfig.setConnectionRequestTimeout instead
      Deprecated. Defines the timeout in milliseconds used when retrieving an instance of ManagedClientConnection from the ClientConnectionManager. 

       
       

       

      Attachments

        Issue Links

          Activity

            People

              slfan1989 Shilun Fan
              slfan1989 Shilun Fan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 50m
                  2h 50m