| Constructor and Description |
|---|
ProducerImpl(ProducerConfig producerConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
暂停Producer
|
void |
close(long timeoutMs)
暂停Producer
|
void |
closeNow()
立刻暂停Producer
|
void |
config(ProducerConfig producerConfig)
初始化Producer配置
|
static Producer |
defaultProducer(String endpoint,
String region,
String accessKey,
String accessSecret,
String token) |
void |
resetAccessKeyToken(String accessKey,
String secretKey,
String securityToken) |
void |
sendLog(String hashKey,
String topicId,
String source,
String filename,
PutLogRequest.Log log,
CallBack callBack)
Deprecated.
|
void |
sendLogGroup(String hashKey,
String topicId,
String source,
String filename,
PutLogRequest.LogGroup logGroup,
CallBack callBack)
Deprecated.
|
void |
sendLogsV2(String hashKey,
String topicId,
String source,
String filename,
List<LogItem> logs,
CallBack callBack) |
void |
sendLogV2(String hashKey,
String topicId,
String source,
String filename,
LogItem log,
CallBack callBack) |
void |
start()
启动Producer
|
public ProducerImpl(ProducerConfig producerConfig) throws LogException
LogExceptionpublic static Producer defaultProducer(String endpoint, String region, String accessKey, String accessSecret, String token) throws LogException
LogException@Deprecated public void sendLog(String hashKey, String topicId, String source, String filename, PutLogRequest.Log log, CallBack callBack) throws InterruptedException, LogException
sendLog in interface ProducerInterruptedExceptionLogException@Deprecated public void sendLogGroup(String hashKey, String topicId, String source, String filename, PutLogRequest.LogGroup logGroup, CallBack callBack) throws InterruptedException, LogException
sendLogGroup in interface ProducerInterruptedExceptionLogExceptionpublic void sendLogV2(String hashKey, String topicId, String source, String filename, LogItem log, CallBack callBack) throws InterruptedException, LogException
sendLogV2 in interface ProducerhashKey - 路由Shard的keytopicId - 日志主题IDsource - 日志来源filename - 日志路径log - 待写入日志callBack - 回调函数InterruptedExceptionLogExceptionpublic void sendLogsV2(String hashKey, String topicId, String source, String filename, List<LogItem> logs, CallBack callBack) throws InterruptedException, LogException
sendLogsV2 in interface ProducerhashKey - 路由Shard的keytopicId - 日志主题idsource - 日志来源filename - 日志路径logs - 待写入日志callBack - 回调函数InterruptedExceptionLogExceptionpublic void resetAccessKeyToken(String accessKey, String secretKey, String securityToken) throws LogException
resetAccessKeyToken in interface ProduceraccessKey - 访问api的keysecretKey - 访问api的secretsecurityToken - 临时访问凭证tokenLogExceptionpublic void start()
throws LogException
Producerstart in interface ProducerLogExceptionpublic void close()
throws InterruptedException,
LogException
Producerclose in interface ProducerInterruptedExceptionLogExceptionpublic void close(long timeoutMs)
throws InterruptedException,
LogException
Producerclose in interface ProducertimeoutMs - 超时等待时间InterruptedExceptionLogExceptionpublic void closeNow()
throws InterruptedException,
LogException
ProducercloseNow in interface ProducerInterruptedExceptionLogExceptionpublic void config(ProducerConfig producerConfig) throws LogException
Producerconfig in interface ProducerLogExceptionCopyright © 2025. All rights reserved.