public static class ThinkingDataAnalytics.BatchConsumer extends Object implements Consumer
| Modifier and Type | Class and Description |
|---|---|
static class |
ThinkingDataAnalytics.BatchConsumer.Config
BatchConsumer 的 配置类
|
| Constructor and Description |
|---|
BatchConsumer(String serverUrl,
String appId)
创建指定接收端地址和 APP ID 的 BatchConsumer
|
BatchConsumer(String serverUrl,
String appId,
boolean isThrowException)
创建指定接收端地址和 APP ID 的 BatchConsumer
|
BatchConsumer(String serverUrl,
String appId,
int batchSize,
int timeout,
boolean autoFlush,
int interval)
创建指定接收端地址和 APP ID 的 BatchConsumer,并设定 batchSize, 网络请求 timeout, 发送频次
|
BatchConsumer(String serverUrl,
String appId,
int batchSize,
int timeout,
boolean autoFlush,
int interval,
String compress)
创建指定接收端地址和 APP ID 的 BatchConsumer,并设定 batchSize, 网络请求 timeout, 发送频次
|
BatchConsumer(String serverUrl,
String appId,
ThinkingDataAnalytics.BatchConsumer.Config config) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Map<String,Object> message) |
void |
close() |
void |
flush()
将缓存的数据全部上传
|
void |
flushOnce() |
void |
httpSending(String data,
int dataSize) |
public BatchConsumer(String serverUrl, String appId) throws URISyntaxException
serverUrl - 接收端地址appId - APP IDURISyntaxException - 上传地址异常public BatchConsumer(String serverUrl, String appId, boolean isThrowException) throws URISyntaxException
serverUrl - 接收端地址appId - APP IDisThrowException - 出错时是否抛出异常URISyntaxException - 上传地址异常public BatchConsumer(String serverUrl, String appId, ThinkingDataAnalytics.BatchConsumer.Config config) throws URISyntaxException
serverUrl - 接收端地址appId - APP IDconfig - BatchConsumer配置类URISyntaxException - 上传地址异常public BatchConsumer(String serverUrl, String appId, int batchSize, int timeout, boolean autoFlush, int interval) throws URISyntaxException
serverUrl - 接收端地址appId - APP IDbatchSize - 缓存数目上线timeout - 超时时长,单位 msautoFlush - 自动上传开关interval - 自动上传间隔,单位秒URISyntaxException - 上传地址异常public BatchConsumer(String serverUrl, String appId, int batchSize, int timeout, boolean autoFlush, int interval, String compress) throws URISyntaxException
serverUrl - 接收端地址appId - APP IDbatchSize - 缓存数目上线timeout - 超时时长,单位 msautoFlush - 自动上传开关interval - 发送间隔,单位秒compress - 压缩方式URISyntaxException - 上传地址异常public void flushOnce()
public void httpSending(String data, int dataSize)
Copyright © 2022. All rights reserved.