public class ParSeqRestClient extends com.linkedin.parseq.batching.BatchingStrategy<com.linkedin.restli.client.RequestGroup,com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>> implements ParSeqRestliClient
Request by sending the request to underlying rest.li
Client. ParSeqRestClient delegates task execution to Rest.li Client Client.sendRequest(Request, Callback)
method that takes a PromiseCallbackAdapter. ParSeq task created from ParSeqRestClient may fail when
PromiseCallbackAdapter receives the following error conditions:
1. @{link RestLiResponseExcepion}: Request has reached Rest.li server and rest.li server throws RestLiServiceException.
2. @{link RemoteInvocationException}: Request failed before reaching rest.li server, for example, RestException thrown
from request filters, ServiceUnavailableException when client cannot find available server instance
that could serve the request, etc.
3. @{link TimeoutException}: Request times out after configured timeoutMs.
| Constructor and Description |
|---|
ParSeqRestClient(com.linkedin.restli.client.Client client)
Deprecated.
Please use
ParSeqRestliClientBuilder to create instances. |
ParSeqRestClient(com.linkedin.restli.client.RestClient client)
Deprecated.
Please use
ParSeqRestliClientBuilder to create instances. |
| Modifier and Type | Method and Description |
|---|---|
com.linkedin.restli.client.RequestGroup |
classify(com.linkedin.restli.client.RestRequestBatchKey key) |
<T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> |
createTask(com.linkedin.restli.client.Request<T> request)
Creates a task that makes rest.li request and returns response.
|
<T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> |
createTask(com.linkedin.restli.client.Request<T> request,
RequestConfigOverrides configOverrides)
Creates a task that makes rest.li request and returns response.
|
<T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> |
createTask(com.linkedin.restli.client.Request<T> request,
com.linkedin.r2.message.RequestContext requestContext)
Creates a task that makes rest.li request and returns response.
|
<T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> |
createTask(com.linkedin.restli.client.Request<T> request,
com.linkedin.r2.message.RequestContext requestContext,
RequestConfigOverrides configOverrides)
Creates a task that makes rest.li request and returns response.
|
<T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> |
createTask(String name,
com.linkedin.restli.client.Request<T> request,
com.linkedin.r2.message.RequestContext requestContext)
Deprecated.
ParSeqRestClient generates consistent names for tasks based on request parameters and it is
recommended to us default names.
|
void |
executeBatch(com.linkedin.restli.client.RequestGroup group,
com.linkedin.parseq.batching.Batch<com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>> batch) |
BatchingMetrics |
getBatchingMetrics() |
String |
getBatchName(com.linkedin.restli.client.RequestGroup group,
com.linkedin.parseq.batching.Batch<com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>> batch) |
Metrics |
getMetrics()
Returns ParSeq rest.li client's metrics.
|
int |
keySize(com.linkedin.restli.client.RequestGroup group,
com.linkedin.restli.client.RestRequestBatchKey key) |
int |
maxBatchSizeForGroup(com.linkedin.restli.client.RequestGroup group) |
<T> com.linkedin.parseq.promise.Promise<com.linkedin.restli.client.Response<T>> |
sendRequest(com.linkedin.restli.client.Request<T> request)
Deprecated.
|
<T> com.linkedin.parseq.promise.Promise<com.linkedin.restli.client.Response<T>> |
sendRequest(com.linkedin.restli.client.Request<T> request,
com.linkedin.r2.message.RequestContext requestContext)
Deprecated.
|
@Deprecated public ParSeqRestClient(com.linkedin.restli.client.Client client)
ParSeqRestliClientBuilder to create instances.@Deprecated public ParSeqRestClient(com.linkedin.restli.client.RestClient client)
ParSeqRestliClientBuilder to create instances.@Deprecated public <T> com.linkedin.parseq.promise.Promise<com.linkedin.restli.client.Response<T>> sendRequest(com.linkedin.restli.client.Request<T> request)
ParSeqRestliClientsendRequest in interface ParSeqRestliClientT - type of the resultrequest - to sendParSeqRestliClient.createTask(Request)@Deprecated public <T> com.linkedin.parseq.promise.Promise<com.linkedin.restli.client.Response<T>> sendRequest(com.linkedin.restli.client.Request<T> request, com.linkedin.r2.message.RequestContext requestContext)
ParSeqRestliClientsendRequest in interface ParSeqRestliClientT - type of the resultrequest - to sendrequestContext - context for the requestpublic <T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> createTask(com.linkedin.restli.client.Request<T> request)
ParSeqRestliClientcreateTask in interface ParSeqRestliClientT - type of the resultrequest - request to be madepublic <T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> createTask(com.linkedin.restli.client.Request<T> request,
com.linkedin.r2.message.RequestContext requestContext)
ParSeqRestliClientcreateTask in interface ParSeqRestliClientT - type of the resultrequest - request to be maderequestContext - context for the request@Deprecated public <T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> createTask(String name, com.linkedin.restli.client.Request<T> request, com.linkedin.r2.message.RequestContext requestContext)
public <T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> createTask(com.linkedin.restli.client.Request<T> request,
RequestConfigOverrides configOverrides)
ParSeqRestliClient
Passed in configOverrides will override any existing configuration. Not all properties need to be set.
Use RequestConfigOverridesBuilder to create instance of RequestConfigOverrides.
createTask in interface ParSeqRestliClientT - type of the resultrequest - request to be madeconfigOverrides - configuration overridespublic <T> com.linkedin.parseq.Task<com.linkedin.restli.client.Response<T>> createTask(com.linkedin.restli.client.Request<T> request,
com.linkedin.r2.message.RequestContext requestContext,
RequestConfigOverrides configOverrides)
ParSeqRestliClient
Passed in configOverrides will override any existing configuration. Not all properties need to be set.
Use RequestConfigOverridesBuilder to create instance of RequestConfigOverrides.
createTask in interface ParSeqRestliClientT - type of the resultrequest - request to be maderequestContext - context for the requestconfigOverrides - configuration overridespublic void executeBatch(com.linkedin.restli.client.RequestGroup group,
com.linkedin.parseq.batching.Batch<com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>> batch)
executeBatch in class com.linkedin.parseq.batching.BatchingStrategy<com.linkedin.restli.client.RequestGroup,com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>>public com.linkedin.restli.client.RequestGroup classify(com.linkedin.restli.client.RestRequestBatchKey key)
classify in class com.linkedin.parseq.batching.BatchingStrategy<com.linkedin.restli.client.RequestGroup,com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>>public String getBatchName(com.linkedin.restli.client.RequestGroup group, com.linkedin.parseq.batching.Batch<com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>> batch)
getBatchName in class com.linkedin.parseq.batching.BatchingStrategy<com.linkedin.restli.client.RequestGroup,com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>>public int keySize(com.linkedin.restli.client.RequestGroup group,
com.linkedin.restli.client.RestRequestBatchKey key)
keySize in class com.linkedin.parseq.batching.BatchingStrategy<com.linkedin.restli.client.RequestGroup,com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>>public int maxBatchSizeForGroup(com.linkedin.restli.client.RequestGroup group)
maxBatchSizeForGroup in class com.linkedin.parseq.batching.BatchingStrategy<com.linkedin.restli.client.RequestGroup,com.linkedin.restli.client.RestRequestBatchKey,com.linkedin.restli.client.Response<Object>>public BatchingMetrics getBatchingMetrics()
public Metrics getMetrics()
ParSeqRestliClientgetMetrics in interface ParSeqRestliClientCopyright © 2018. All rights reserved.