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/24 07:37:23 UTC
[GitHub] [ignite-3] rpuch opened a new pull request, #1239: IGNITE-17955 Reduce memory consumption during OrderingFuture completion
rpuch opened a new pull request, #1239:
URL: https://github.com/apache/ignite-3/pull/1239
https://issues.apache.org/jira/browse/IGNITE-17955
--
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-3] tkalkirill merged pull request #1239: IGNITE-17955 Reduce memory consumption during OrderingFuture completion
Posted by GitBox <gi...@apache.org>.
tkalkirill merged PR #1239:
URL: https://github.com/apache/ignite-3/pull/1239
--
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-3] rpuch commented on a diff in pull request #1239: IGNITE-17955 Reduce memory consumption during OrderingFuture completion
Posted by GitBox <gi...@apache.org>.
rpuch commented on code in PR #1239:
URL: https://github.com/apache/ignite-3/pull/1239#discussion_r1005688348
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -559,4 +569,16 @@ private enum Phase {
*/
COMPLETED
}
+
+ private static class NotificationContext {
Review Comment:
Added documentation
--
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-3] rpuch commented on a diff in pull request #1239: IGNITE-17955 Reduce memory consumption during OrderingFuture completion
Posted by GitBox <gi...@apache.org>.
rpuch commented on code in PR #1239:
URL: https://github.com/apache/ignite-3/pull/1239#discussion_r1005663286
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -529,12 +537,14 @@ public void notifyHeadToTail(T result, Throwable exception, ListNode<T> lastNoti
stack.addFirst(node);
}
+ NotificationContext context = new NotificationContext();
Review Comment:
We need to create the exception lazily because not all dependents need it, so it might happen that no dependent needs the exception. Context allows us to implement that lazy creation logic. Please note that it is much more expensive to create an exception that a context object.
--
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-3] tkalkirill commented on a diff in pull request #1239: IGNITE-17955 Reduce memory consumption during OrderingFuture completion
Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #1239:
URL: https://github.com/apache/ignite-3/pull/1239#discussion_r1005697640
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -49,20 +47,49 @@
* @see CompletableFuture
*/
public class OrderingFuture<T> {
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<OrderingFuture, State> STATE = newUpdater(OrderingFuture.class, State.class, "state");
+ /**
+ * Integer representation of {@code false}.
+ */
+ private static final int INT_FALSE = 0;
+
+ /**
+ * Integer representation of {@code true}.
+ */
+ private static final int INT_TRUE = 1;
Review Comment:
```suggestion
/** Integer representation of {@code true}. */
private static final int INT_TRUE = 1;
```
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -49,20 +47,49 @@
* @see CompletableFuture
*/
public class OrderingFuture<T> {
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<OrderingFuture, State> STATE = newUpdater(OrderingFuture.class, State.class, "state");
+ /**
+ * Integer representation of {@code false}.
+ */
+ private static final int INT_FALSE = 0;
Review Comment:
```suggestion
/** Integer representation of {@code false}. */
private static final int INT_FALSE = 0;
```
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -529,12 +537,14 @@ public void notifyHeadToTail(T result, Throwable exception, ListNode<T> lastNoti
stack.addFirst(node);
}
+ NotificationContext context = new NotificationContext();
Review Comment:
In a local variable, the exception will also be calculated lazily, I think a class is not needed for this.
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -49,20 +47,49 @@
* @see CompletableFuture
*/
public class OrderingFuture<T> {
- @SuppressWarnings("rawtypes")
- private static final AtomicReferenceFieldUpdater<OrderingFuture, State> STATE = newUpdater(OrderingFuture.class, State.class, "state");
+ /**
+ * Integer representation of {@code false}.
+ */
+ private static final int INT_FALSE = 0;
+
+ /**
+ * Integer representation of {@code true}.
+ */
+ private static final int INT_TRUE = 1;
+
+ private static final VarHandle STATE;
Review Comment:
I think it is possible to place all `VarHandle` side by side and make registration in one static block.
--
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-3] tkalkirill commented on a diff in pull request #1239: IGNITE-17955 Reduce memory consumption during OrderingFuture completion
Posted by GitBox <gi...@apache.org>.
tkalkirill commented on code in PR #1239:
URL: https://github.com/apache/ignite-3/pull/1239#discussion_r1005389731
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -559,4 +569,16 @@ private enum Phase {
*/
COMPLETED
}
+
+ private static class NotificationContext {
Review Comment:
Lack of documentation for the class and method
##########
modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java:
##########
@@ -529,12 +537,14 @@ public void notifyHeadToTail(T result, Throwable exception, ListNode<T> lastNoti
stack.addFirst(node);
}
+ NotificationContext context = new NotificationContext();
Review Comment:
Why not just store the exception in a local variable and just pass it to `org.apache.ignite.internal.future.OrderingFuture.DependentAction#onCompletion`?
--
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