From 67745f1372b44b06bd5b7702bf54a06e289a5b76 Mon Sep 17 00:00:00 2001 From: wenweihuang Date: Mon, 30 Dec 2024 19:20:25 +0800 Subject: [PATCH] [INLONG-11624][Agent] Rename variables to prevent misunderstandings --- .../org/apache/inlong/agent/plugin/sources/SQLSource.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java index 02a5e2f0a8..e73db1be90 100755 --- a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java +++ b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java @@ -79,7 +79,7 @@ protected static class FileOffset { public static final String OFFSET_SEP = ":"; protected final Integer WAIT_TIMEOUT_MS = 10; - private String fileName; + private String finalSQL; private String jdbcUrl; private String username; private String password; @@ -109,7 +109,7 @@ protected void initSource(InstanceProfile profile) { AgentConfiguration conf = AgentConfiguration.getAgentConf(); int permit = conf.getInt(AGENT_GLOBAL_SQL_SOURCE_PERMIT, DEFAULT_AGENT_GLOBAL_SQL_SOURCE_PERMIT); MemoryManager.getInstance().addSemaphore(AGENT_GLOBAL_SQL_SOURCE_PERMIT, permit); - fileName = profile.getInstanceId(); + finalSQL = profile.getInstanceId(); jdbcUrl = profile.get(TaskConstants.SQL_TASK_JDBC_URL).trim().replace("\r", "") .replace("\n", ""); if (jdbcUrl.startsWith("jdbc:mysql:")) { @@ -123,7 +123,7 @@ protected void initSource(InstanceProfile profile) { EXECUTOR_SERVICE.execute(run()); } catch (Exception ex) { stopRunning(); - throw new FileException("error init stream for " + fileName, ex); + throw new FileException("error init stream for " + finalSQL, ex); } } @@ -179,7 +179,7 @@ protected void printCurrentState() { @Override protected String getThreadName() { - return "sql-source-" + taskId + "-" + fileName; + return "sql-source-" + taskId + "-" + finalSQL; } private Runnable run() {