类全名:com.aliyun.hitsdb.client.TSDBConfig.Builder

java.lang.Object

com.aliyun.hitsdb.client.TSDBConfig.Builder

封闭类: TSDBConfig
public static class TSDBConfig.Builder extends Object

构造器概要

构造器和说明
Builder(String host, int port) 
使用时序引擎地址与端口创建TSDBConfig.Builder实例

方法概要

限定符和类型 方法和说明
TSDBConfig.Builder

asyncPut(boolean asyncPut)

异步写开关。默认为 true。推荐异步写。

TSDBConfig.Builder

batchPutBufferSize(int batchPutBufferSize)

异步写相关,设置客户端缓冲队列长度,默认为10000。

TSDBConfig.Builder

batchPutConsumerThreadCount(int batchPutConsumerThreadCount)

异步写相关,设置缓冲队列消费线程数,默认为1。

TSDBConfig.Builder

batchPutSize(int batchPutSize)

异步写相关,设置每次批次提交给客户端点的个数,默认为500。

TSDBConfig.Builder

batchPutTimeLimit(int batchPutTimeLimit)

异步写相关,每次等待最大时间限制,单位为 ms,默认为300。

TSDBConfig.Builder

closePutRequestLimit()

异步写相关,不限制写请求队列数,若关闭可能导致 OOM,不建议关闭。

TSDBConfig

config()

构造 TSDBConfig 对象

TSDBConfig.Builder

httpCompress(boolean httpCompress)

是否开启Http传输压缩。

TSDBConfig.Builder

httpConnectionLiveTime(int httpConnectionLiveTime)

连接存在时间长度。单位为秒。默认为0,即不生效。

TSDBConfig.Builder

httpConnectionPool(int connectionPool)

HTTP连接池大小

TSDBConfig.Builder

httpConnectTimeout(int httpConnectTimeout)

HTTP 等待时间,单位为秒,默认为90秒。

TSDBConfig.Builder

httpKeepaliveTime(int httpKeepaliveTime)

HTTP Keepalive时间

TSDBConfig.Builder

ioThreadCount(int ioThreadCount)

IO 线程数,默认为1。

TSDBConfig.Builder

listenBatchPut(AbstractBatchPutCallback<?> cb)

设置异步写回调,异步批量 Put 回调接口。

TSDBConfig.Builder

maxTPS(int maxTPS)

限制写入端最大TPS,默认不限制。

TSDBConfig.Builder

openHttpCompress()

打开HTTP压缩传输

TSDBConfig.Builder

putRequestLimit(int limit)

异步写相关,写请求队列数,默认等于连接池数。可根据读写次数的比例进行配置。

TSDBConfig.Builder

readonly()

打开只读开关。当 readonly 设置为 true 时,异步写开关会被关闭。

TSDBConfig.Builder

readonly(boolean readonly)

配置只读开关,默认为 false。当 readonly 设置为 true 时,异步写开关会被关闭。

从类继承的方法 java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造器详细资料

Builder
public Builder(String host, int port)
Builder
public Builder(TSDBNetAddress… netAddresses)

方法详细资料

putRequestLimit
public TSDBConfig.Builder putRequestLimit(int limit)
batchPutBufferSize
public TSDBConfig.Builder batchPutBufferSize(int batchPutBufferSize)
batchPutConsumerThreadCount
public TSDBConfig.Builder batchPutBufferSize(int batchPutBufferSize)
batchPutRetryCount
public TSDBConfig.Builder batchPutRetryCount(int batchPutRetryCount)
batchPutSize
public TSDBConfig.Builder batchPutSize(int batchPutSize)
batchPutTimeLimit
public TSDBConfig.Builder batchPutTimeLimit(int batchPutTimeLimit)
closePutRequestLimit
public TSDBConfig.Builder closePutRequestLimit()
closeBackpressure
public TSDBConfig.Builder closeBackpressure()
backpressure
public TSDBConfig.Builder backpressure(boolean backpressure)
httpConnectionLiveTime
public TSDBConfig.Builder httpConnectionLiveTime(int httpConnectionLiveTime)
httpKeepaliveTime
public TSDBConfig.Builder httpKeepaliveTime(int httpKeepaliveTime)
readonly
public TSDBConfig.Builder readonly()
readonly
public TSDBConfig.Builder readonly(boolean readonly)
asyncPut
public TSDBConfig.Builder asyncPut(boolean asyncPut)
maxTPS
public TSDBConfig.Builder maxTPS(int maxTPS)
config
public TSDBConfig config()
httpCompress
public TSDBConfig.Builder httpCompress(boolean httpCompress)
httpConnectionPool
public TSDBConfig.Builder httpConnectionPool(int connectionPool)
httpConnectTimeout
public TSDBConfig.Builder httpConnectTimeout(int httpConnectTimeout)
ioThreadCount
public TSDBConfig.Builder ioThreadCount(int ioThreadCount)
listenBatchPut
public TSDBConfig.Builder listenBatchPut(AbstractBatchPutCallback<?> cb)
openHttpCompress
public TSDBConfig.Builder openHttpCompress()