Package cn.thinkingdata.analytics
Class TDBatchConsumer.Config
- java.lang.Object
-
- cn.thinkingdata.analytics.TDBatchConsumer.Config
-
- Enclosing class:
- TDBatchConsumer
public static class TDBatchConsumer.Config extends Object
BatchConsumer config
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanautoFlushEnable auto flushprotected intbatchSizeBatch sizeprotected StringcompressHttp compress type.protected intintervalBatch time intervalprotected booleanisThrowExceptionIs throw exceptionprotected intmaxCacheSizeMax cache sizeprotected inttimeoutHttp timeout
-
Constructor Summary
Constructors Constructor Description Config()Construct batch consumer config
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetAutoFlush(boolean autoFlush)Whether to allow automatic flushingvoidsetBatchSize(int batchSize)voidsetCompress(String compress)voidsetInterval(int interval)voidsetMaxCacheSize(int maxCacheSize)max cache buffer sizevoidsetThrowException(boolean isThrowException)Whether to throw exceptionvoidsetTimeout(int timeout)network timeout
-
-
-
Field Detail
-
batchSize
protected int batchSize
Batch size
-
interval
protected int interval
Batch time interval
-
compress
protected String compress
Http compress type. default is "gzip"
-
timeout
protected int timeout
Http timeout
-
autoFlush
protected boolean autoFlush
Enable auto flush
-
maxCacheSize
protected int maxCacheSize
Max cache size
-
isThrowException
protected boolean isThrowException
Is throw exception
-
-
Method Detail
-
setBatchSize
public void setBatchSize(int batchSize)
- Parameters:
batchSize- flush event count each time
-
setInterval
public void setInterval(int interval)
- Parameters:
interval- auto flush spacing (Unit: second)
-
setCompress
public void setCompress(String compress)
- Parameters:
compress- compress type
-
setTimeout
public void setTimeout(int timeout)
network timeout- Parameters:
timeout- millSecond
-
setAutoFlush
public void setAutoFlush(boolean autoFlush)
Whether to allow automatic flushing- Parameters:
autoFlush- enable or not
-
setMaxCacheSize
public void setMaxCacheSize(int maxCacheSize)
max cache buffer size- Parameters:
maxCacheSize- number
-
setThrowException
public void setThrowException(boolean isThrowException)
Whether to throw exception- Parameters:
isThrowException- enable or not
-
-