[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

fanshilun updated MAPREDUCE-7385:
---------------------------------
    Description: 
JobEndNotifier#httpNotification's DefaultHttpClient has been Deprecated, use 
the recommended method instead

JobEndNotifier#httpNotification
{code:java}
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();
  } {code}
 * CoreConnectionPNames.SO_TIMEOUT
 * Use RequestConfig.setSocketTimeout instead

{code:java}
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. {code}
 
 * ClientPNames.CONN_MANAGER_TIMEOUT
 * Use RequestConfig.setConnectionRequestTimeout instead

{code:java}
Deprecated. Defines the timeout in milliseconds used when retrieving an 
instance of ManagedClientConnection from the ClientConnectionManager. {code}
 

 

 

 

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

JobEndNotifier#httpNotification
{code:java}
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();
  } {code}
 * CoreConnectionPNames.SO_TIMEOUT
 * Use RequestConfig.setSocketTimeout instead

 
{code:java}
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. {code}
 
 * ClientPNames.CONN_MANAGER_TIMEOUT
 * Use RequestConfig.setConnectionRequestTimeout instead

 
{code:java}
Deprecated. Defines the timeout in milliseconds used when retrieving an 
instance of ManagedClientConnection from the ClientConnectionManager. {code}
 

 

 

 


> impove JobEndNotifier#httpNotification With recommended methods
> ---------------------------------------------------------------
>
>                 Key: MAPREDUCE-7385
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7385
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>            Reporter: fanshilun
>            Priority: Minor
>
> JobEndNotifier#httpNotification's DefaultHttpClient has been Deprecated, use 
> the recommended method instead
> JobEndNotifier#httpNotification
> {code:java}
> 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();
>   } {code}
>  * CoreConnectionPNames.SO_TIMEOUT
>  * Use RequestConfig.setSocketTimeout instead
> {code:java}
> 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. {code}
>  
>  * ClientPNames.CONN_MANAGER_TIMEOUT
>  * Use RequestConfig.setConnectionRequestTimeout instead
> {code:java}
> Deprecated. Defines the timeout in milliseconds used when retrieving an 
> instance of ManagedClientConnection from the ClientConnectionManager. {code}
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-h...@hadoop.apache.org

Reply via email to