You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "justinwwhuang (via GitHub)" <gi...@apache.org> on 2025/02/24 03:30:07 UTC

[PR] [INLONG-11774][Agent] Modify the lifecycle of the DataProxy SDK object [inlong]

justinwwhuang opened a new pull request, #11775:
URL: https://github.com/apache/inlong/pull/11775

   Fixes #11774 
   
   ### Motivation
   
   Modify the lifecycle of the DataProxy SDK object
   
   ### Modifications
   
   Modify the lifecycle of the dataproxy SDK object to match the task
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
   No doc needed
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-11774][Agent] Modify the lifecycle of the DataProxy SDK object [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang merged PR #11775:
URL: https://github.com/apache/inlong/pull/11775


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-11774][Agent] Modify the lifecycle of the DataProxy SDK object [inlong]

Posted by "justinwwhuang (via GitHub)" <gi...@apache.org>.
justinwwhuang commented on code in PR #11775:
URL: https://github.com/apache/inlong/pull/11775#discussion_r1967239984


##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java:
##########
@@ -61,13 +61,13 @@ public class TaskManager extends AbstractDaemon {
     private static final int ACTION_QUEUE_CAPACITY = 1000;
     private long lastPrintTime = 0;
     // task basic store
-    private final Store taskBasicStore;
+    private static Store taskBasicStore;

Review Comment:
   Only in AgentManager will a TaskManager object be created
       public AgentManager() {
           conf = AgentConfiguration.getAgentConf();
           agentConfMonitor = Executors.newSingleThreadExecutor();
           taskManager = new TaskManager();



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-11774][Agent] Modify the lifecycle of the DataProxy SDK object [inlong]

Posted by "luchunliang (via GitHub)" <gi...@apache.org>.
luchunliang commented on code in PR #11775:
URL: https://github.com/apache/inlong/pull/11775#discussion_r1967230192


##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java:
##########
@@ -61,13 +61,13 @@ public class TaskManager extends AbstractDaemon {
     private static final int ACTION_QUEUE_CAPACITY = 1000;
     private long lastPrintTime = 0;
     // task basic store
-    private final Store taskBasicStore;
+    private static Store taskBasicStore;

Review Comment:
   Since TaskManager is not a singleton, the static taskStore might be recreated multiple times.
   ```
       public TaskManager() {
           taskBasicStore = initStore(
                   agentConf.get(AgentConstants.AGENT_ROCKS_DB_PATH, AgentConstants.AGENT_STORE_PATH_TASK));
           taskStore = new TaskStore(taskBasicStore);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-11774][Agent] Modify the lifecycle of the DataProxy SDK object [inlong]

Posted by "justinwwhuang (via GitHub)" <gi...@apache.org>.
justinwwhuang commented on code in PR #11775:
URL: https://github.com/apache/inlong/pull/11775#discussion_r1967239984


##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java:
##########
@@ -61,13 +61,13 @@ public class TaskManager extends AbstractDaemon {
     private static final int ACTION_QUEUE_CAPACITY = 1000;
     private long lastPrintTime = 0;
     // task basic store
-    private final Store taskBasicStore;
+    private static Store taskBasicStore;

Review Comment:
   Only in AgentManager will a TaskManager object be created
       public AgentManager() {
           conf = AgentConfiguration.getAgentConf();
           agentConfMonitor = Executors.newSingleThreadExecutor();
           taskManager = new TaskManager();



##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java:
##########
@@ -61,13 +61,13 @@ public class TaskManager extends AbstractDaemon {
     private static final int ACTION_QUEUE_CAPACITY = 1000;
     private long lastPrintTime = 0;
     // task basic store
-    private final Store taskBasicStore;
+    private static Store taskBasicStore;

Review Comment:
   > Since TaskManager is not a singleton, the static taskStore might be recreated multiple times.
   > 
   > ```
   >     public TaskManager() {
   >         taskBasicStore = initStore(
   >                 agentConf.get(AgentConstants.AGENT_ROCKS_DB_PATH, AgentConstants.AGENT_STORE_PATH_TASK));
   >         taskStore = new TaskStore(taskBasicStore);
   > ```
   
   Only in AgentManager will a TaskManager object be created
       public AgentManager() {
           conf = AgentConfiguration.getAgentConf();
           agentConfMonitor = Executors.newSingleThreadExecutor();
           taskManager = new TaskManager();



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org