github-advanced-security[bot] commented on code in PR #18613:
URL: https://github.com/apache/druid/pull/18613#discussion_r2416118408


##########
server/src/main/java/org/apache/druid/discovery/DiscoveryDruidNode.java:
##########
@@ -65,20 +69,36 @@
    */
   private final Map<String, DruidService> services = new HashMap<>();
 
+  /**
+   * Constructor for tests. In production, the @Inject constructor is used 
instead.
+   */
+  @VisibleForTesting
+  public DiscoveryDruidNode(
+      DruidNode druidNode,
+      NodeRole nodeRole,
+      Map<String, DruidService> services,
+      DateTime startTime
+  )
+  {
+    this(druidNode, nodeRole, services, startTime, 
JvmUtils.getRuntimeInfo().getAvailableProcessors(), JvmUtils.getTotalMemory());
+  }
+
   public DiscoveryDruidNode(
       DruidNode druidNode,
       NodeRole nodeRole,
       Map<String, DruidService> services
   )
   {
-    this(druidNode, nodeRole, services, DateTimes.nowUtc());
+    this(druidNode, nodeRole, services, DateTimes.nowUtc(), 
JvmUtils.getRuntimeInfo().getAvailableProcessors(), JvmUtils.getTotalMemory());

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [JvmUtils.getRuntimeInfo](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10505)



##########
server/src/main/java/org/apache/druid/discovery/DiscoveryDruidNode.java:
##########
@@ -65,20 +69,36 @@
    */
   private final Map<String, DruidService> services = new HashMap<>();
 
+  /**
+   * Constructor for tests. In production, the @Inject constructor is used 
instead.
+   */
+  @VisibleForTesting
+  public DiscoveryDruidNode(
+      DruidNode druidNode,
+      NodeRole nodeRole,
+      Map<String, DruidService> services,
+      DateTime startTime
+  )
+  {
+    this(druidNode, nodeRole, services, startTime, 
JvmUtils.getRuntimeInfo().getAvailableProcessors(), JvmUtils.getTotalMemory());

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [JvmUtils.getRuntimeInfo](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10504)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to