io.edurt.datacap.plugin.http.clickhouse.ClickHouseAdapter Maven / Gradle / Ivy
The newest version!
package io.edurt.datacap.plugin.http.clickhouse;
import io.edurt.datacap.spi.adapter.HttpAdapter;
import io.edurt.datacap.spi.connection.HttpConfigure;
import io.edurt.datacap.spi.connection.HttpConnection;
import io.edurt.datacap.spi.connection.http.HttpClient;
import io.edurt.datacap.spi.connection.http.HttpMethod;
import io.edurt.datacap.spi.model.Response;
import io.edurt.datacap.spi.model.Time;
import lombok.extern.slf4j.Slf4j;
import okhttp3.MediaType;
import org.apache.commons.beanutils.BeanUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
public class ClickHouseAdapter
extends HttpAdapter
{
public ClickHouseAdapter(HttpConnection httpConnection)
{
super(httpConnection);
}
@Override
public Response handlerExecute(String content)
{
Time processorTime = new Time();
processorTime.setStart(new Date().getTime());
Response response = this.connection.getResponse();
HttpConfigure httpConfigure = new HttpConfigure();
if (response.getIsConnected()) {
List headers = new ArrayList<>();
List types = new ArrayList<>();
List