com.linkedin.restli.client.BatchGetRequestUtil Maven / Gradle / Ivy
/*
Copyright (c) 2014 LinkedIn Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.linkedin.restli.client;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.r2.RemoteInvocationException;
import com.linkedin.restli.client.response.BatchKVResponse;
import com.linkedin.restli.common.BatchResponse;
import com.linkedin.restli.common.ErrorResponse;
import com.linkedin.restli.common.RestConstants;
import com.linkedin.restli.internal.client.ResponseImpl;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author Keren Jin
*/
// need to be place in same package as BatchRequest, since BatchRequest.getFields() is protected
public class BatchGetRequestUtil
{
public static Map getBatchQueryParam(List extends BatchRequest> requests, boolean batchFields)
{
if (requests.size() < 2)
{
throw new IllegalArgumentException("Must have at least two requests to batch");
}
final BatchRequest firstRequest = requests.get(0);
final BatchingKey> batchKey = new BatchingKey>(firstRequest, batchFields);
final Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy