Skip to content

Commit

Permalink
[update][plugin][influxdbreader] Remove unused InfluxDBReaderTask#pos…
Browse files Browse the repository at this point in the history
…t method
  • Loading branch information
wgzhao committed Dec 6, 2023
1 parent d72fa75 commit 4f1ca9c
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.wgzhao.addax.plugin.reader.influxdb2reader;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.wgzhao.addax.common.element.Record;
Expand All @@ -31,7 +30,6 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.fluent.Content;
import org.apache.http.client.fluent.Request;
import org.apache.http.entity.ContentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -40,7 +38,6 @@
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Map;

public class InfluxDBReaderTask
{
Expand Down Expand Up @@ -160,42 +157,6 @@ public String get(String url)
return content.asString(StandardCharsets.UTF_8);
}

private String post(String url, Map<String, Object> params)
throws Exception
{
return post(url, JSON.toJSONString(params), this.connTimeout, this.socketTimeout);
}

private String post(String url, String params)
throws Exception
{
return post(url, params, this.connTimeout, this.socketTimeout);
}

private String post(String url, Map<String, Object> params,
int connectTimeoutInMill, int socketTimeoutInMill)
throws Exception
{
return post(url, JSON.toJSONString(params), connectTimeoutInMill, socketTimeoutInMill);
}

private String post(String url, String params,
int connectTimeoutInMill, int socketTimeoutInMill)
throws Exception
{
Content content = Request.Post(url)
.connectTimeout(connectTimeoutInMill)
.socketTimeout(socketTimeoutInMill)
.addHeader("Content-Type", "application/json")
.bodyString(params, ContentType.APPLICATION_JSON)
.execute()
.returnContent();
if (content == null) {
return null;
}
return content.asString(StandardCharsets.UTF_8);
}

@SuppressWarnings("JavaTimeDefaultTimeZone")
private String getLastMinute()
{
Expand Down

0 comments on commit 4f1ca9c

Please sign in to comment.