You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yazdan Shirvany (JIRA)" <ji...@apache.org> on 2018/05/09 05:30:00 UTC

[jira] [Updated] (FLINK-9317) Async I/O API Example For Scala has Variable Name error

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

Yazdan Shirvany updated FLINK-9317:
-----------------------------------
    Description: 
h2. Async I/O API Scala Example has duplicated {{resultFuture variable with different data type.}}

 

{{resultFuture: ResultFuture[(String, String)]}}

val resultFuture: Future[String]

 

{{this cause error on compile as variables have same naming.}}

 

{{In order to example works properly we need to update variable names to be distinct,}}

 

{{```}}

override def asyncInvoke(input: (String,String, String), resultFuture: ResultFuture[(String,String, String, String)]): Unit = {

// issue the asynchronous request, receive a future for the result
 val *resultFutureRequested*: Future[String] = Future

{ // client2.query(str) client.getAccountReferenceId(token, input._1) }

// set the callback to be executed once the request by the client is complete
 // the callback simply forwards the result to the result future
 *resultFutureRequested*.onSuccess {
 case result: String =>

{ resultFuture.complete(Iterable((input._1, input._2, input._3, result))) }

}
 }

{{```}}

 

 

  was:
h2. Async I/O API Scala Example has duplicated {{resultFuture variable with different data type.}}

 

{{resultFuture: ResultFuture[(String, String)]}}

{{ val resultFuture: Future[String]}}

 

{{this cause error on compile as variables have same naming.}}

 

{{In order to example works properly we need to update variable names to be distinct,}}

 

{{```}}

override def asyncInvoke(input: (String,String, String), resultFuture: ResultFuture[(String,String, String, String)]): Unit = {


 // issue the asynchronous request, receive a future for the result
 val *resultFutureRequested*: Future[String] = Future {
 // client2.query(str)
 client.getAccountReferenceId(token, input._1)
 }

 // set the callback to be executed once the request by the client is complete
 // the callback simply forwards the result to the result future
 *resultFutureRequested*.onSuccess {
 case result: String => {
 resultFuture.complete(Iterable((input._1, input._2, input._3, result)))
 }
 }
}

{{```}}

 

 


> Async I/O API Example For Scala has Variable Name error
> -------------------------------------------------------
>
>                 Key: FLINK-9317
>                 URL: https://issues.apache.org/jira/browse/FLINK-9317
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 1.4.1, 1.4.2
>            Reporter: Yazdan Shirvany
>            Priority: Minor
>              Labels: documentation
>
> h2. Async I/O API Scala Example has duplicated {{resultFuture variable with different data type.}}
>  
> {{resultFuture: ResultFuture[(String, String)]}}
> val resultFuture: Future[String]
>  
> {{this cause error on compile as variables have same naming.}}
>  
> {{In order to example works properly we need to update variable names to be distinct,}}
>  
> {{```}}
> override def asyncInvoke(input: (String,String, String), resultFuture: ResultFuture[(String,String, String, String)]): Unit = {
> // issue the asynchronous request, receive a future for the result
>  val *resultFutureRequested*: Future[String] = Future
> { // client2.query(str) client.getAccountReferenceId(token, input._1) }
> // set the callback to be executed once the request by the client is complete
>  // the callback simply forwards the result to the result future
>  *resultFutureRequested*.onSuccess {
>  case result: String =>
> { resultFuture.complete(Iterable((input._1, input._2, input._3, result))) }
> }
>  }
> {{```}}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)