Search in sources :

Example 1 with PermitsRequestBuilders

use of org.apache.gobblin.restli.throttling.PermitsRequestBuilders in project incubator-gobblin by apache.

the class RestClientRequestSender method sendRequest.

@Override
public void sendRequest(PermitRequest request, Callback<Response<PermitAllocation>> callback) {
    PermitsGetRequestBuilder getBuilder = new PermitsRequestBuilders().get();
    Request<PermitAllocation> fullRequest = getBuilder.id(new ComplexResourceKey<>(request, new EmptyRecord())).build();
    getRestClient().sendRequest(fullRequest, decorateCallback(request, callback));
}
Also used : EmptyRecord(com.linkedin.restli.common.EmptyRecord) ComplexResourceKey(com.linkedin.restli.common.ComplexResourceKey) PermitsGetRequestBuilder(org.apache.gobblin.restli.throttling.PermitsGetRequestBuilder) PermitsRequestBuilders(org.apache.gobblin.restli.throttling.PermitsRequestBuilders) PermitAllocation(org.apache.gobblin.restli.throttling.PermitAllocation)

Aggregations

ComplexResourceKey (com.linkedin.restli.common.ComplexResourceKey)1 EmptyRecord (com.linkedin.restli.common.EmptyRecord)1 PermitAllocation (org.apache.gobblin.restli.throttling.PermitAllocation)1 PermitsGetRequestBuilder (org.apache.gobblin.restli.throttling.PermitsGetRequestBuilder)1 PermitsRequestBuilders (org.apache.gobblin.restli.throttling.PermitsRequestBuilders)1