You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/10/27 18:34:40 UTC

[GitHub] [ignite] shishkovilja opened a new pull request, #10352: IGNITE-17865 Disable partition ranges in log messages by default

shishkovilja opened a new pull request, #10352:
URL: https://github.com/apache/ignite/pull/10352

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] sk0x50 commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] anton-vinogradov merged pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
anton-vinogradov merged PR #10352:
URL: https://github.com/apache/ignite/pull/10352


-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] shishkovilja commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
shishkovilja commented on code in PR #10352:
URL: https://github.com/apache/ignite/pull/10352#discussion_r1029131961


##########
modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java:
##########
@@ -2099,6 +2100,11 @@ public final class IgniteSystemProperties {
         defaults = "" + DFLT_IGNITE_USE_BINARY_ARRAYS)
     public static final String IGNITE_USE_BINARY_ARRAYS = "IGNITE_USE_BINARY_ARRAYS";
 
+    /** Enables partitions ranges in logs. */
+    @SystemProperty(value = "Enables replacing of consecutively arranged partition numbers by ranges in logs",
+        defaults = "" + DFLT_IGNITE_PRINT_PARTITION_RANGES_IN_LOGS)
+    public static final String IGNITE_PRINT_PARTITION_RANGES_IN_LOGS = "IGNITE_PRINT_PARTITION_RANGES_IN_LOGS";
+

Review Comment:
   Ok, I removed property.



-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] anton-vinogradov commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
anton-vinogradov commented on code in PR #10352:
URL: https://github.com/apache/ignite/pull/10352#discussion_r1011789969


##########
modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java:
##########
@@ -2099,6 +2100,11 @@ public final class IgniteSystemProperties {
         defaults = "" + DFLT_IGNITE_USE_BINARY_ARRAYS)
     public static final String IGNITE_USE_BINARY_ARRAYS = "IGNITE_USE_BINARY_ARRAYS";
 
+    /** Enables partitions ranges in logs. */
+    @SystemProperty(value = "Enables replacing of consecutively arranged partition numbers by ranges in logs",
+        defaults = "" + DFLT_IGNITE_PRINT_PARTITION_RANGES_IN_LOGS)
+    public static final String IGNITE_PRINT_PARTITION_RANGES_IN_LOGS = "IGNITE_PRINT_PARTITION_RANGES_IN_LOGS";
+

Review Comment:
   This is useless, I think.
   We must log parts properly each time.



-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] sk0x50 commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] shishkovilja commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
shishkovilja commented on code in PR #10352:
URL: https://github.com/apache/ignite/pull/10352#discussion_r1029130931


##########
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 removed property.



-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] sk0x50 commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] sk0x50 commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] sk0x50 commented on a diff in pull request #10352: IGNITE-17865 Disable partition ranges in log messages by default

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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