sanpwc commented on code in PR #3629:
URL: https://github.com/apache/ignite-3/pull/3629#discussion_r1579640666
##########
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java:
##########
@@ -1175,24 +1176,58 @@ public static byte[] byteBufferToByteArray(ByteBuffer
buffer) {
}
}
+ private static CompletableFuture<Void> startAsync(Stream<? extends
IgniteComponent> components) {
+ return allOf(components
+ .filter(Objects::nonNull)
+ .map(IgniteComponent::startAsync)
+ .toArray(CompletableFuture[]::new));
+ }
+
+ /**
+ * Asynchronously starts all ignite components.
+ *
+ * @param components Array of ignite components to start.
+ * @return CompletableFuture that will be completed when all components
are started.
+ */
+ public static CompletableFuture<Void> startAsync(IgniteComponent...
components) {
+ return startAsync(Stream.of(components));
+ }
+
+ /**
+ * Asynchronously starts all ignite components.
+ *
+ * @param components Collection of ignite components to start.
+ * @return CompletableFuture that will be completed when all components
are started.
+ */
+ public static CompletableFuture<Void> startAsync(Collection<? extends
IgniteComponent> components) {
+ return startAsync(components.stream());
+ }
+
+ private static CompletableFuture<Void> stopAsync(Stream<? extends
IgniteComponent> components) {
Review Comment:
Please check my comment in
modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerRecoveryTest.java
--
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]