Skip to content

Commit

Permalink
[INLONG-11624][Agent] Rename variables to prevent misunderstandings
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwwhuang committed Dec 30, 2024
1 parent 898b45e commit 67745f1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:")) {
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -179,7 +179,7 @@ protected void printCurrentState() {

@Override
protected String getThreadName() {
return "sql-source-" + taskId + "-" + fileName;
return "sql-source-" + taskId + "-" + finalSQL;
}

private Runnable run() {
Expand Down

0 comments on commit 67745f1

Please sign in to comment.