public class ClientConfiguration extends Object
构造器和说明 |
---|
ClientConfiguration()
构造新实例。
|
限定符和类型 | 方法和说明 |
---|---|
int |
getConnectionTimeoutInMillisecond()
返回建立连接的超时时间(单位:毫秒)。
|
int |
getIoThreadCount()
返回HttpAsyncClient的IOReactor的线程数。
|
int |
getMaxConnections()
返回允许打开的最大HTTP连接数。
|
String |
getProxyDomain()
返回访问NTLM验证的代理服务器的Windows域名(可选)。
|
String |
getProxyHost()
返回代理服务器主机地址。
|
String |
getProxyPassword()
返回代理服务器验证的密码。
|
int |
getProxyPort()
返回代理服务器端口。
|
String |
getProxyUsername()
返回代理服务器验证的用户名。
|
String |
getProxyWorkstation()
返回NTLM代理服务器的Windows工作站名称。
|
RetryStrategy |
getRetryStrategy()
返回TableStore的请求重试策略
|
int |
getRetryThreadCount()
返回用于执行错误重试的线程池的线程的个数。
|
int |
getSocketTimeoutInMillisecond()
返回通过打开的连接传输数据的超时时间(单位:毫秒)。
|
long |
getSyncClientWaitFutureTimeoutInMillis()
获取同步Client内等待异步调用返回的最大超时时间。
|
int |
getTimeThresholdOfServerTracer()
返回当前设置的服务端Tracer时间阈值(单位:毫秒)。
|
int |
getTimeThresholdOfTraceLogger()
返回当前设置的时间阈值(单位:毫秒)。
|
boolean |
isEnableRequestCompression()
返回是否需要对请求数据进行压缩
|
boolean |
isEnableResponseCompression()
返回是否需要告知TableStore对返回的响应内容进行压缩
|
boolean |
isEnableResponseContentMD5Checking()
返回是否需要对响应内容做MD5校验
|
boolean |
isEnableResponseValidation()
返回是否需要对响应进行验证
|
void |
setConnectionTimeoutInMillisecond(int connectionTimeoutInMillisecond)
设置建立连接的超时时间(单位:毫秒)。
|
void |
setEnableRequestCompression(boolean enableRequestCompression)
设置是否需要对请求数据进行压缩
|
void |
setEnableResponseCompression(boolean enableResponseCompression)
是否需要告知TableStore对返回的响应内容进行压缩
|
void |
setEnableResponseContentMD5Checking(boolean enableResponseContentMD5Checking)
是否需要对响应的内容做MD5校验, 如果需要校验,
Client会计算响应数据的MD5值并与返回的响应头中的x-ots-contentmd5头的值进行比对
|
void |
setEnableResponseValidation(boolean enableResponseValidation)
是否需要对响应进行验证, 如果需要验证,
Client会验证头信息完整性、结果是否过期、授权信息是否正确
|
void |
setIoThreadCount(int ioThreadCount)
设置HttpAsyncClient的IOReactor的线程数(因为采用的是异步IO,所以不需要配置大量线程,每个线程都能提供大量并发)。
|
void |
setMaxConnections(int maxConnections)
设置允许打开的最大HTTP连接数(连接数影响并发度,需要根据QPS、单个请求的时间、机器配置等因素来确定一个合理的值)。
|
void |
setProxyDomain(String proxyDomain)
设置访问NTLM验证的代理服务器的Windows域名(可选)。
|
void |
setProxyHost(String proxyHost)
设置代理服务器主机地址。
|
void |
setProxyPassword(String proxyPassword)
设置代理服务器验证的密码。
|
void |
setProxyPort(int proxyPort)
设置代理服务器端口。
|
void |
setProxyUsername(String proxyUsername)
设置代理服务器验证的用户名。
|
void |
setProxyWorkstation(String proxyWorkstation)
设置NTLM代理服务器的Windows工作站名称。
|
void |
setRetryStrategy(RetryStrategy retryStrategy)
设置TableStore的请求重试策略
|
void |
setRetryThreadCount(int retryThreadCount)
设置用于执行错误重试的线程池的线程的个数。
|
void |
setSocketTimeoutInMillisecond(int socketTimeoutInMillisecond)
设置通过打开的连接传输数据的超时时间(单位:毫秒)。
|
void |
setSyncClientWaitFutureTimeoutInMillis(long syncClientWaitFutureTimeoutInMillis)
设置同步Client内等待异步调用返回的最大超时时间。
|
void |
setTimeThresholdOfServerTracer(int timeThresholdOfServerTracer)
设置服务端Tracer的时间阈值(单位:毫秒)。
|
void |
setTimeThresholdOfTraceLogger(int timeThresholdOfTraceLogger)
设置一个时间阈值(单位:毫秒)。
|
public void setEnableRequestCompression(boolean enableRequestCompression)
enableRequestCompression
- 是否需要压缩(true/false)public boolean isEnableRequestCompression()
public void setEnableResponseCompression(boolean enableResponseCompression)
enableResponseCompression
- 是否告知TableStore对返回的响应内容进行压缩public boolean isEnableResponseCompression()
public boolean isEnableResponseValidation()
public void setEnableResponseValidation(boolean enableResponseValidation)
enableResponseValidation
- 是否需要对响应进行验证public int getIoThreadCount()
public void setIoThreadCount(int ioThreadCount)
ioThreadCount
- IOReactor的线程数public int getMaxConnections()
public void setMaxConnections(int maxConnections)
maxConnections
- 最大HTTP连接数。public int getSocketTimeoutInMillisecond()
public void setSocketTimeoutInMillisecond(int socketTimeoutInMillisecond)
socketTimeoutInMillisecond
- 通过打开的连接传输数据的超时时间(单位:毫秒)。public int getConnectionTimeoutInMillisecond()
public void setConnectionTimeoutInMillisecond(int connectionTimeoutInMillisecond)
connectionTimeoutInMillisecond
- 建立连接的超时时间(单位:毫秒)。public int getRetryThreadCount()
public void setRetryThreadCount(int retryThreadCount)
retryThreadCount
- 用于执行错误重试的线程池的线程的个数。public boolean isEnableResponseContentMD5Checking()
public void setEnableResponseContentMD5Checking(boolean enableResponseContentMD5Checking)
enableResponseContentMD5Checking
- 是否需要校验响应数据MD5public RetryStrategy getRetryStrategy()
public void setRetryStrategy(RetryStrategy retryStrategy)
retryStrategy
- TableStore的请求重试策略public int getTimeThresholdOfTraceLogger()
public void setTimeThresholdOfTraceLogger(int timeThresholdOfTraceLogger)
timeThresholdOfTraceLogger
- trace loggerpublic int getTimeThresholdOfServerTracer()
public void setTimeThresholdOfServerTracer(int timeThresholdOfServerTracer)
timeThresholdOfServerTracer
- trace loggerpublic String getProxyHost()
public void setProxyHost(String proxyHost)
proxyHost
- 代理服务器主机地址。public int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort
- 代理服务器端口。public String getProxyUsername()
public void setProxyUsername(String proxyUsername)
proxyUsername
- 用户名。public String getProxyPassword()
public void setProxyPassword(String proxyPassword)
proxyPassword
- 密码。public String getProxyDomain()
public void setProxyDomain(String proxyDomain)
proxyDomain
- 域名。public String getProxyWorkstation()
public void setProxyWorkstation(String proxyWorkstation)
proxyWorkstation
- NTLM代理服务器的Windows工作站名称。public long getSyncClientWaitFutureTimeoutInMillis()
public void setSyncClientWaitFutureTimeoutInMillis(long syncClientWaitFutureTimeoutInMillis)
syncClientWaitFutureTimeoutInMillis
- Copyright © 2019. All Rights Reserved.