TranslateClient (AWS SDK for Java

This is a variant of listParallelData(software.amazon.awssdk.services.translate.model.ListParallelDataRequest) operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.

This is a variant of listParallelData(software.amazon.awssdk.services.translate.model.ListParallelDataRequest) operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.

When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.

The following are few ways to iterate through the response pages:

1) Using a Stream
  software.amazon.awssdk.services.translate.paginators.ListParallelDataIterable responses = client.listParallelDataPaginator(request); responses.stream().forEach(....);  
2) Using For loop
 { @code software.amazon.awssdk.services.translate.paginators.ListParallelDataIterable responses = client .listParallelDataPaginator(request); for (software.amazon.awssdk.services.translate.model.ListParallelDataResponse response : responses) { // do something; } } 
3) Use iterator directly
  software.amazon.awssdk.services.translate.paginators.ListParallelDataIterable responses = client.listParallelDataPaginator(request); responses.iterator().forEachRemaining(....);  

Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.

Note: If you prefer to have control on service calls, use the listParallelData(software.amazon.awssdk.services.translate.model.ListParallelDataRequest) operation.

This is a convenience which creates an instance of the ListParallelDataRequest.Builder avoiding the need to create one manually via ListParallelDataRequest.builder()

ncG1vNJzZmirlKB7ornAs6anmaeoe6S7zGihmq6RZK6xtY6lmK2do6l8tLvFra6aqpVkrq6t2ailaJmnqMClt46snKuumZiytHvTq5inq5yWwaZ7s6uYp6uclsGmj8uinKesXp3Brrg%3D

 Share!