This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new d6961367fd [INLONG-9702][Agent] Change the data transmission interval
to depend on local file configuration (#9703)
d6961367fd is described below
commit d6961367fdaab0e79dd4eaedfc32e2df1df83ba7
Author: justinwwhuang <[email protected]>
AuthorDate: Tue Feb 20 16:05:22 2024 +0800
[INLONG-9702][Agent] Change the data transmission interval to depend on
local file configuration (#9703)
---
.../main/java/org/apache/inlong/agent/plugin/sinks/AbstractSink.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/AbstractSink.java
b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/AbstractSink.java
index cc962538be..ac2908ecf5 100644
---
a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/AbstractSink.java
+++
b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/AbstractSink.java
@@ -17,6 +17,7 @@
package org.apache.inlong.agent.plugin.sinks;
+import org.apache.inlong.agent.conf.AgentConfiguration;
import org.apache.inlong.agent.conf.InstanceProfile;
import org.apache.inlong.agent.message.file.ProxyMessageCache;
import org.apache.inlong.agent.metrics.AgentMetricItem;
@@ -58,6 +59,7 @@ public abstract class AbstractSink implements Sink {
protected int batchFlushInterval;
// key is stream id, value is a batch of messages belong to the same
stream id
protected ProxyMessageCache cache;
+ private static final AgentConfiguration agentConf =
AgentConfiguration.getAgentConf();
@Override
public void setSourceName(String sourceFileName) {
@@ -71,7 +73,7 @@ public abstract class AbstractSink implements Sink {
inlongGroupId = profile.getInlongGroupId();
inlongStreamId = profile.getInlongStreamId();
cache = new ProxyMessageCache(this.profile, inlongGroupId,
inlongStreamId);
- batchFlushInterval = profile.getInt(PROXY_BATCH_FLUSH_INTERVAL,
DEFAULT_PROXY_BATCH_FLUSH_INTERVAL);
+ batchFlushInterval = agentConf.getInt(PROXY_BATCH_FLUSH_INTERVAL,
DEFAULT_PROXY_BATCH_FLUSH_INTERVAL);
this.dimensions = new HashMap<>();
dimensions.put(KEY_PLUGIN_ID, this.getClass().getSimpleName());