From 280ab98ab068078ad7643775e0cdff3cfaae04ea Mon Sep 17 00:00:00 2001 From: Mats Rydberg Date: Thu, 8 Feb 2024 14:49:10 +0100 Subject: [PATCH 1/2] Fix progress logging for remote projections Prior to this commit, an adaptive scheme was used, that increased the task volume with each processed batch. That scheme resulted in progress reaching 100% after one batch, 50% after two batches, 33% after three, and so on. Generally, the progress would be 1/b where b is the batch ordinal. For a large amount of batches, progress would reach 0%. Instead, we now use the Iterative.OPEN task mode. We do not know the total amount of incoming rows. Instead, we log progress after completing each batch. --- .../main/java/org/neo4j/gds/assertj/Extractors.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core-test-utils/src/main/java/org/neo4j/gds/assertj/Extractors.java b/core-test-utils/src/main/java/org/neo4j/gds/assertj/Extractors.java index dd8c9d6384e..267f31916b8 100644 --- a/core-test-utils/src/main/java/org/neo4j/gds/assertj/Extractors.java +++ b/core-test-utils/src/main/java/org/neo4j/gds/assertj/Extractors.java @@ -31,6 +31,17 @@ public final class Extractors { private Extractors() {} + public static ThrowingExtractor removingServerAddress() { + return Extractors::removingServerAddress; + } + + private static String removingServerAddress(String message) { + if (message.contains("localhost:")) { + return removingServerAddress(message.replaceFirst("localhost:\\d+", "
")); + } + return message; + } + public static ThrowingExtractor removingThreadId() { return Extractors::removeThreadId; } From 9fabe07718f224e8304abeddc17c5889a114fff8 Mon Sep 17 00:00:00 2001 From: Mats Rydberg Date: Thu, 8 Feb 2024 15:19:10 +0100 Subject: [PATCH 2/2] Refactor ArrowDatabaseGraphImporter - make progress logger a field - remove other fields replaced by progress logger - add factory to simplify constructor - replace databaseId with databaseInfo to simplify doImport() --- core/src/main/java/org/neo4j/gds/api/DatabaseInfo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/neo4j/gds/api/DatabaseInfo.java b/core/src/main/java/org/neo4j/gds/api/DatabaseInfo.java index 98aa1362d35..e184449baaf 100644 --- a/core/src/main/java/org/neo4j/gds/api/DatabaseInfo.java +++ b/core/src/main/java/org/neo4j/gds/api/DatabaseInfo.java @@ -31,6 +31,10 @@ static DatabaseInfo of(DatabaseId databaseId, DatabaseLocation databaseLocation) return ImmutableDatabaseInfo.of(databaseId, databaseLocation, Optional.empty()); } + static DatabaseInfo of(DatabaseId databaseId, DatabaseLocation databaseLocation, DatabaseId remoteDatabaseId) { + return ImmutableDatabaseInfo.of(databaseId, databaseLocation, remoteDatabaseId); + } + DatabaseId databaseId(); DatabaseLocation databaseLocation();