JAkutenshi commented on code in PR #5015:
URL: https://github.com/apache/ignite-3/pull/5015#discussion_r1910251589


##########
modules/core/src/main/java/org/apache/ignite/internal/logger/IgniteThrottledLogger.java:
##########
@@ -25,12 +25,16 @@
 /**
  * {@link IgniteLogger} throttle.
  *
- * <p>Messages are logged only if they were not logged for the last {@link 
#THROTTLE_TIMEOUT_MILLIS} milliseconds. Note that not only error
- * messages are checked for duplicates, but also exception classes if 
present.</p>
+ * <p>Messages are logged only if they were not logged recently. The interval 
of message appears is {@link this#DEFAULT_THROTTLE_TIMEOUT}
+ * by default or can be configured through the JVM property {@link 
this#THROTTLE_TIMEOUT_MILLIS}.
+ * Note that not only error messages are checked for duplicates, but also 
exception classes if present.</p>
  */
 public interface IgniteThrottledLogger extends IgniteLogger {
-    /** Throttle timeout in milliseconds (value is 5 min). */
-    long THROTTLE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(5);
+    /** JVM property to configure a throttle interval. */
+    String THROTTLE_TIMEOUT_MILLIS = "IGNITE_THROTTLE_TIMEOUT_MILLIS";

Review Comment:
   Should we provide any user documentation on the property?



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -80,7 +78,12 @@
  * <p>Additionally limits the lock map size.
  */
 public class HeapLockManager extends AbstractEventProducer<LockEvent, 
LockEventParameters> implements LockManager {
-    private static final IgniteLogger LOG = 
Loggers.forClass(HeapLockManager.class);
+    /** Throttled logger. */
+    private static final IgniteLogger THROTTLED_LOG = 
Loggers.toThrottledLogger(
+            Loggers.forClass(HeapLockManager.class),
+            // TODO: IGNITE-24181 Get rid of Common thread pool.
+            ForkJoinPool.commonPool()

Review Comment:
   Why `ForkJoinPool` there? May we pass `ThreadPoolsManager#commonScheduler` 
there from `IgniteImpl` in time? I saw `IGNITE-24181`, but just thought that 
common scheduler may be more reasonable for now.



##########
modules/core/src/main/java/org/apache/ignite/internal/logger/IgniteThrottledLogger.java:
##########
@@ -25,12 +25,16 @@
 /**
  * {@link IgniteLogger} throttle.
  *
- * <p>Messages are logged only if they were not logged for the last {@link 
#THROTTLE_TIMEOUT_MILLIS} milliseconds. Note that not only error
- * messages are checked for duplicates, but also exception classes if 
present.</p>
+ * <p>Messages are logged only if they were not logged recently. The interval 
of message appears is {@link this#DEFAULT_THROTTLE_TIMEOUT}
+ * by default or can be configured through the JVM property {@link 
this#THROTTLE_TIMEOUT_MILLIS}.
+ * Note that not only error messages are checked for duplicates, but also 
exception classes if present.</p>
  */
 public interface IgniteThrottledLogger extends IgniteLogger {
-    /** Throttle timeout in milliseconds (value is 5 min). */
-    long THROTTLE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(5);
+    /** JVM property to configure a throttle interval. */
+    String THROTTLE_TIMEOUT_MILLIS = "IGNITE_THROTTLE_TIMEOUT_MILLIS";
+
+    /** Default throttle timeout in milliseconds (value is 5 min). */
+    long DEFAULT_THROTTLE_TIMEOUT = TimeUnit.MINUTES.toMillis(5);

Review Comment:
   Also I would like to save `MILLIS` postfix for the default value and name 
the property name field:
   1. `static final`
   2. named as `THROTTLE_TIMEOUT_MILLIS_PROPERTY_NAME`, it's more verbose, but 
there is distinct between prop's name and it's value. 



-- 
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]

Reply via email to