Package com.clickhouse.client.http
Class ClickHouseHttpConnection
java.lang.Object
com.clickhouse.client.http.ClickHouseHttpConnection
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ApacheHttpConnectionImpl,HttpUrlConnectionImpl
Deprecated.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClickHouseConfigDeprecated.Deprecated.protected final ClickHouseRequestManagerDeprecated.protected final ClickHouseNodeDeprecated.protected final StringDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseHttpConnection(ClickHouseNode server, ClickHouseRequest<?> request, Map<String, Serializable> additionalParams) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.protected voidDeprecated.createDefaultHeaders(ClickHouseConfig config, ClickHouseNode server, String userAgent, String referer) Deprecated.protected StringDeprecated.protected StringDeprecated.protected static ProxygetProxy(ClickHouseConfig config) Deprecated.protected static StringgetProxyAuth(ClickHouseConfig config) Deprecated.protected final StringDeprecated.protected booleanDeprecated.Checks whether the connection is reusable or not.mergeHeaders(Map<String, String> requestHeaders) Deprecated.Creates a merged map.protected static StringparseErrorFromException(String errorCode, String serverName, IOException e, byte[] bytes) Deprecated.abstract booleanping(int timeout) Deprecated.Sends a request to<baseUrl>/pingfor liveness detection.protected abstract ClickHouseHttpResponsepost(ClickHouseConfig config, String query, com.clickhouse.data.ClickHouseInputStream data, List<com.clickhouse.data.ClickHouseExternalTable> tables, com.clickhouse.data.ClickHouseOutputStream output, String url, Map<String, String> headers, Runnable postCloseAction) Deprecated.Posts query and data to server.protected static voidpostData(ClickHouseConfig config, byte[] boundary, String sql, com.clickhouse.data.ClickHouseInputStream data, List<com.clickhouse.data.ClickHouseExternalTable> tables, OutputStream requestStream) Deprecated.Deprecated.Deprecated.query(String query, List<com.clickhouse.data.ClickHouseExternalTable> tables, Map<String, String> headers) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.
-
Field Details
-
server
Deprecated. -
rm
Deprecated. -
config
Deprecated. -
defaultHeaders
Deprecated. -
url
Deprecated.
-
-
Constructor Details
-
ClickHouseHttpConnection
protected ClickHouseHttpConnection(ClickHouseNode server, ClickHouseRequest<?> request, Map<String, Serializable> additionalParams) Deprecated.
-
-
Method Details
-
createDefaultHeaders
protected static Map<String,String> createDefaultHeaders(ClickHouseConfig config, ClickHouseNode server, String userAgent, String referer) Deprecated. -
getProxy
Deprecated. -
getProxyAuth
Deprecated. -
parseErrorFromException
protected static String parseErrorFromException(String errorCode, String serverName, IOException e, byte[] bytes) Deprecated. -
postData
protected static void postData(ClickHouseConfig config, byte[] boundary, String sql, com.clickhouse.data.ClickHouseInputStream data, List<com.clickhouse.data.ClickHouseExternalTable> tables, OutputStream requestStream) throws IOException Deprecated.- Throws:
IOException
-
closeQuietly
protected void closeQuietly()Deprecated. -
getBaseUrl
Deprecated. -
getDefaultUserAgent
Deprecated. -
getUserAgent
Deprecated. -
mergeHeaders
Deprecated.Creates a merged map.- Parameters:
requestHeaders- request headers- Returns:
- non-null merged headers
-
post
protected abstract ClickHouseHttpResponse post(ClickHouseConfig config, String query, com.clickhouse.data.ClickHouseInputStream data, List<com.clickhouse.data.ClickHouseExternalTable> tables, com.clickhouse.data.ClickHouseOutputStream output, String url, Map<String, String> headers, Runnable postCloseAction) throws IOExceptionDeprecated.Posts query and data to server.- Parameters:
query- non-blank queryconfig- non-null configurationdata- optionally input stream for batch updatingtables- optionally external tables for queryoutput- optionally output streamurl- optionally urlheaders- optionally request headerspostCloseAction- optionally post action- Returns:
- response
- Throws:
IOException- when error occured posting request and/or server failed to respond
-
isReusable
protected boolean isReusable()Deprecated.Checks whether the connection is reusable or not. This method will be called inClickHouseHttpClient.checkConnection(ClickHouseHttpConnection, ClickHouseNode, ClickHouseNode, ClickHouseRequest)for making a decision of whether to create a new connection. In addition to that, if a connection is NOT reusable, it will be closed right after corresponding ClickHouseResponse is closed.- Returns:
- true if it's reusable; false otherwise
-
ping
public abstract boolean ping(int timeout) Deprecated.Sends a request to<baseUrl>/pingfor liveness detection.- Parameters:
timeout- timeout in millisecond- Returns:
- true if server responded
Ok.; false otherwise
-
update
Deprecated.- Throws:
IOException
-
update
Deprecated.- Throws:
IOException
-
update
public ClickHouseHttpResponse update(String query, com.clickhouse.data.ClickHouseInputStream data) throws IOException Deprecated.- Throws:
IOException
-
update
public ClickHouseHttpResponse update(String query, com.clickhouse.data.ClickHouseInputStream data, Map<String, String> headers) throws IOExceptionDeprecated.- Throws:
IOException
-
query
Deprecated.- Throws:
IOException
-
query
Deprecated.- Throws:
IOException
-
query
public ClickHouseHttpResponse query(String query, List<com.clickhouse.data.ClickHouseExternalTable> tables) throws IOException Deprecated.- Throws:
IOException
-
query
public ClickHouseHttpResponse query(String query, List<com.clickhouse.data.ClickHouseExternalTable> tables, Map<String, String> headers) throws IOExceptionDeprecated.- Throws:
IOException
-
close
Deprecated.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-