All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.taobao.drc.clusterclient.clustermanager.BatchCommitRequest Maven / Gradle / Ivy

There is a newer version: 5.0.0.1.beta
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy