You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2024/10/15 23:54:28 UTC
[PR] IGNITE-23058 : remove snapshot check tasks v3 [ignite]
Vladsz83 opened a new pull request, #11596:
URL: https://github.com/apache/ignite/pull/11596
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11596:
URL: https://github.com/apache/ignite/pull/11596#discussion_r1898909488
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java:
##########
@@ -474,70 +692,100 @@ private <T> GridFutureAdapter<T> phaseFuture() {
}
}
- /** A DTO used to transfer nodes' results for the both phases. */
- private static final class SnapshotCheckResponse implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
-
- /** @see #metas() */
- @Nullable private final List<SnapshotMetadata> metas;
+ /** A DTO base to transfer node's results for the both phases. */
+ private abstract static class AbstractSnapshotCheckResponse<T> implements Serializable {
Review Comment:
To avoid plenty of large generics in code like `CompletableFuture<SnapshotCheckResponse<Map<String, Map<PartitionKeyV2, PartitionHashRecordV2>>>>`.
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11596:
URL: https://github.com/apache/ignite/pull/11596#discussion_r1898909488
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java:
##########
@@ -474,70 +692,100 @@ private <T> GridFutureAdapter<T> phaseFuture() {
}
}
- /** A DTO used to transfer nodes' results for the both phases. */
- private static final class SnapshotCheckResponse implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
-
- /** @see #metas() */
- @Nullable private final List<SnapshotMetadata> metas;
+ /** A DTO base to transfer node's results for the both phases. */
+ private abstract static class AbstractSnapshotCheckResponse<T> implements Serializable {
Review Comment:
To avoid plenty of large generics in code like `CompletableFuture<SnapshotCheckResponse<Map<String, Map<PartitionKeyV2, PartitionHashRecordV2>>>>` and casting to them.
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #11596:
URL: https://github.com/apache/ignite/pull/11596#issuecomment-2678790002
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11596) **Quality Gate failed**
Failed conditions
 [3 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11596) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11596)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11596:
URL: https://github.com/apache/ignite/pull/11596#discussion_r1898905476
##########
modules/core/src/main/java/org/apache/ignite/internal/management/cache/VerifyBackupPartitionsTaskV2.java:
##########
@@ -140,27 +157,6 @@ public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVe
}
}
- /**
- * @param results Received results of broadcast remote requests.
- * @return Idle verify job result constructed from results of remote executions.
- */
- public static IdleVerifyResultV2 reduce0(List<ComputeJobResult> results) {
Review Comment:
Why do you remove this method?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java:
##########
@@ -634,23 +634,16 @@ else if (!res.exceptions().isEmpty())
/** */
public static IdleVerifyResultV2 reduceHashesResults(
- Map<ClusterNode, Map<PartitionKeyV2, PartitionHashRecordV2>> results,
+ Map<ClusterNode, Map<PartitionKeyV2, List<PartitionHashRecordV2>>> results,
Map<ClusterNode, Exception> ex
) {
- Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes = new HashMap<>();
-
- results.forEach((node, nodeHashes) -> {
- assert ex.get(node) == null;
+ Map<PartitionKeyV2, List<PartitionHashRecordV2>> hashesRes = new HashMap<>();
Review Comment:
Doesn't fixed
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java:
##########
@@ -474,70 +692,100 @@ private <T> GridFutureAdapter<T> phaseFuture() {
}
}
- /** A DTO used to transfer nodes' results for the both phases. */
- private static final class SnapshotCheckResponse implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
-
- /** @see #metas() */
- @Nullable private final List<SnapshotMetadata> metas;
+ /** A DTO base to transfer node's results for the both phases. */
+ private abstract static class AbstractSnapshotCheckResponse<T> implements Serializable {
Review Comment:
Why this class abstract, when all inheritors just use constructor. Why do you need all this classes?
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim commented on code in PR #11596:
URL: https://github.com/apache/ignite/pull/11596#discussion_r1898402464
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java:
##########
@@ -634,23 +634,16 @@ else if (!res.exceptions().isEmpty())
/** */
public static IdleVerifyResultV2 reduceHashesResults(
- Map<ClusterNode, Map<PartitionKeyV2, PartitionHashRecordV2>> results,
+ Map<ClusterNode, Map<PartitionKeyV2, List<PartitionHashRecordV2>>> results,
Map<ClusterNode, Exception> ex
) {
- Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes = new HashMap<>();
-
- results.forEach((node, nodeHashes) -> {
- assert ex.get(node) == null;
+ Map<PartitionKeyV2, List<PartitionHashRecordV2>> hashesRes = new HashMap<>();
- for (Map.Entry<PartitionKeyV2, PartitionHashRecordV2> e : nodeHashes.entrySet()) {
- List<PartitionHashRecordV2> records = clusterHashes.computeIfAbsent(e.getKey(), k -> new ArrayList<>());
-
- records.add(e.getValue());
- }
- });
+ results.forEach((node, partsHashes) -> partsHashes.forEach((partKey, partHashLst) -> hashesRes.computeIfAbsent(partKey,
Review Comment:
Could you please replace it with for-loop? Three `->` in single construction is hard to read.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotChecker.java:
##########
@@ -634,23 +634,16 @@ else if (!res.exceptions().isEmpty())
/** */
public static IdleVerifyResultV2 reduceHashesResults(
- Map<ClusterNode, Map<PartitionKeyV2, PartitionHashRecordV2>> results,
+ Map<ClusterNode, Map<PartitionKeyV2, List<PartitionHashRecordV2>>> results,
Map<ClusterNode, Exception> ex
) {
- Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes = new HashMap<>();
-
- results.forEach((node, nodeHashes) -> {
- assert ex.get(node) == null;
+ Map<PartitionKeyV2, List<PartitionHashRecordV2>> hashesRes = new HashMap<>();
Review Comment:
Let's not rename the variable.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java:
##########
@@ -474,70 +690,112 @@ private <T> GridFutureAdapter<T> phaseFuture() {
}
}
- /** A DTO used to transfer nodes' results for the both phases. */
- private static final class SnapshotCheckResponse implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
+ /** A DTO base to transfer node's results for the both phases. */
+ private abstract static class AbstractSnapshotCheckResponse implements Serializable {
Review Comment:
Looks like, all implementations differ only by result type. Can be replaced with
```
<T> T result() {
return (T)result;
}
```
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "timoninmaxim (via GitHub)" <gi...@apache.org>.
timoninmaxim merged PR #11596:
URL: https://github.com/apache/ignite/pull/11596
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11596:
URL: https://github.com/apache/ignite/pull/11596#discussion_r1898907161
##########
modules/core/src/main/java/org/apache/ignite/internal/management/cache/VerifyBackupPartitionsTaskV2.java:
##########
@@ -140,27 +157,6 @@ public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVe
}
}
- /**
- * @param results Received results of broadcast remote requests.
- * @return Idle verify job result constructed from results of remote executions.
- */
- public static IdleVerifyResultV2 reduce0(List<ComputeJobResult> results) {
Review Comment:
Oh, was public static for an external usage. Forgot
--
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
Re: [PR] IGNITE-23483 : Restore snapshot check from lesser topology for snapshot check distributed process. [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #11596:
URL: https://github.com/apache/ignite/pull/11596#discussion_r1898909488
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java:
##########
@@ -474,70 +692,100 @@ private <T> GridFutureAdapter<T> phaseFuture() {
}
}
- /** A DTO used to transfer nodes' results for the both phases. */
- private static final class SnapshotCheckResponse implements Serializable {
- /** Serial version uid. */
- private static final long serialVersionUID = 0L;
-
- /** @see #metas() */
- @Nullable private final List<SnapshotMetadata> metas;
+ /** A DTO base to transfer node's results for the both phases. */
+ private abstract static class AbstractSnapshotCheckResponse<T> implements Serializable {
Review Comment:
To avoid plenty of large generics in code like 'SnapshotCheckResponse<Map<String, Map<PartitionKeyV2, PartitionHashRecordV2>>>'.
--
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