com.taobao.drc.clusterclient.clustermanager.BatchCommitRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of consumer-core Show documentation
Show all versions of consumer-core Show documentation
The java consumer core component for Data Transmission Service
package com.taobao.drc.clusterclient.clustermanager;
import com.alibaba.fastjson.JSON;
import org.apache.http.client.config.RequestConfig;
import java.util.ArrayList;
import java.util.List;
/**
* @author yangyang
* @since 17/6/20
*/
public class BatchCommitRequest extends AbstractControllerRequest {
static final String API_VERSION = "1.0";
private static final RequestConfig REQUEST_CONFIG = RequestConfig.custom()
.setConnectTimeout(60 * 1000)
.setConnectionRequestTimeout(60 * 1000)
.setSocketTimeout(60 * 1000)
.build();
private List localConsumerStatusList = new ArrayList();
@Override
public String getAPIVersion() {
return API_VERSION;
}
@Override
public String getPath() {
return PatternUrlConstant.PATH_BATCH_COMMIT;
}
@Override
public String getContent() {
return JSON.toJSONString(localConsumerStatusList);
}
@Override
public RequestConfig getRequestConfig() {
return REQUEST_CONFIG;
}
public BatchCommitRequest addConsumerStatus(LocalConsumerStatus localConsumerStatus) {
localConsumerStatusList.add(localConsumerStatus);
return this;
}
public List getLocalConsumerStatusList() {
return localConsumerStatusList;
}
}