sk0x50 commented on code in PR #10352:
URL: https://github.com/apache/ignite/pull/10352#discussion_r1011407589


##########
modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java:
##########
@@ -1894,6 +1899,20 @@ public static String compact(Collection<Integer> col) {
         return compact(col, i -> i + 1);
     }
 
+    /**
+     * Perform compaction of partition lists in logs.
+     * Conversion of consecutively arranged partitions to the corresponding 
range will be performed only if
+     * system property {@link 
IgniteSystemProperties#IGNITE_PRINT_PARTITION_RANGES_IN_LOGS} is set to 
<code>true</code>.
+     *
+     * @param col Collection of partitions.
+     * @return Compacted string representation of collection with partition 
numbers.
+     */
+    public static String compactPartitions(Collection<Integer> col) {
+        boolean printRanges = 
getBoolean(IGNITE_PRINT_PARTITION_RANGES_IN_LOGS, 
DFLT_IGNITE_PRINT_PARTITION_RANGES_IN_LOGS);

Review Comment:
   I don't think that we should read this system property every time the 
`compactPartitions` is called.
   Potentially it can be a bottleneck just because that `java.util.Properties` 
is a `Hastable` and so 'Properties.getProperty()` implemented via 
`Hashtable.get` which is a `synchronized` method.



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