Skip to content

Commit 09e5bd4

Browse files
committed
Backport logging performance improvements to 1.1
1 parent c20baf3 commit 09e5bd4

File tree

15 files changed

+35
-34
lines changed

15 files changed

+35
-34
lines changed

algo/src/main/java/org/neo4j/graphalgo/beta/k1coloring/K1ColoringFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class K1ColoringFactory<T extends K1ColoringConfig> extends AlgorithmFact
3535

3636
@Override
3737
public K1Coloring build(Graph graph, T configuration, AllocationTracker tracker, Log log) {
38-
var progressLogger = new BatchingProgressLogger(
38+
ProgressLogger progressLogger = new BatchingProgressLogger(
3939
log,
4040
graph.nodeCount() * 2,
4141
"K1Coloring",

algo/src/main/java/org/neo4j/graphalgo/beta/modularity/ModularityOptimizationFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public ModularityOptimization build(Graph graph, T configuration, AllocationTrac
8080
}
8181

8282
public ModularityOptimization build(Graph graph, T configuration, NodeProperties seed, AllocationTracker tracker, Log log) {
83-
var progressLogger = new BatchingProgressLogger(
83+
ProgressLogger progressLogger = new BatchingProgressLogger(
8484
log,
8585
graph.relationshipCount(),
8686
"ModularityOptimization",

algo/src/main/java/org/neo4j/graphalgo/labelpropagation/LabelPropagationFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public LabelPropagation build(
5151
AllocationTracker tracker,
5252
Log log
5353
) {
54-
var progressLogger = new BatchingProgressLogger(
54+
ProgressLogger progressLogger = new BatchingProgressLogger(
5555
log,
5656
graph.relationshipCount(),
5757
"LabelPropagation",

algo/src/main/java/org/neo4j/graphalgo/louvain/LouvainFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.neo4j.graphalgo.core.concurrency.Pools;
2929
import org.neo4j.graphalgo.core.loading.NativeFactory;
3030
import org.neo4j.graphalgo.core.utils.BatchingProgressLogger;
31+
import org.neo4j.graphalgo.core.utils.ProgressLogger;
3132
import org.neo4j.graphalgo.core.utils.mem.MemoryEstimation;
3233
import org.neo4j.graphalgo.core.utils.mem.MemoryEstimations;
3334
import org.neo4j.graphalgo.core.utils.mem.MemoryRange;
@@ -46,7 +47,7 @@ public Louvain build(
4647
final AllocationTracker tracker,
4748
final Log log
4849
) {
49-
var progressLogger = new BatchingProgressLogger(log, 1, "Louvain",
50+
ProgressLogger progressLogger = new BatchingProgressLogger(log, 1, "Louvain",
5051
configuration.concurrency()
5152
);
5253

algo/src/main/java/org/neo4j/graphalgo/nodesim/NodeSimilarityFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.neo4j.graphalgo.api.Graph;
2525
import org.neo4j.graphalgo.core.concurrency.Pools;
2626
import org.neo4j.graphalgo.core.utils.BatchingProgressLogger;
27+
import org.neo4j.graphalgo.core.utils.ProgressLogger;
2728
import org.neo4j.graphalgo.core.utils.mem.MemoryEstimation;
2829
import org.neo4j.graphalgo.core.utils.mem.MemoryEstimations;
2930
import org.neo4j.graphalgo.core.utils.paged.AllocationTracker;
@@ -36,7 +37,7 @@ public class NodeSimilarityFactory<CONFIG extends NodeSimilarityBaseConfig> exte
3637

3738
@Override
3839
public NodeSimilarity build(Graph graph, CONFIG configuration, AllocationTracker tracker, Log log) {
39-
var progressLogger = new BatchingProgressLogger(
40+
ProgressLogger progressLogger = new BatchingProgressLogger(
4041
log,
4142
graph.relationshipCount(),
4243
"NodeSimilarity",

algo/src/main/java/org/neo4j/graphalgo/pagerank/PageRankFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public PageRank build(
5252
AllocationTracker tracker,
5353
Log log
5454
) {
55-
var progressLogger = new BatchingProgressLogger(
55+
ProgressLogger progressLogger = new BatchingProgressLogger(
5656
log,
5757
graph.relationshipCount(),
5858
getClass().getSimpleName(),

algo/src/test/java/org/neo4j/graphalgo/beta/k1coloring/K1ColoringTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,16 @@ void everyNodeShouldHaveBeenColored() {
237237

238238
@Test
239239
void shouldLogProgress(){
240-
var graph = RandomGraphGenerator.generate(
240+
Graph graph = RandomGraphGenerator.generate(
241241
100,
242242
10,
243243
RelationshipDistribution.UNIFORM,
244244
42L
245245
);
246246

247-
var testLogger = new TestProgressLogger(graph.relationshipCount() * 2, "K1Coloring", 8);
247+
TestProgressLogger testLogger = new TestProgressLogger(graph.relationshipCount() * 2, "K1Coloring", 8);
248248

249-
var k1Coloring = new K1Coloring(
249+
K1Coloring k1Coloring = new K1Coloring(
250250
graph,
251251
100,
252252
DEFAULT_BATCH_SIZE,

algo/src/test/java/org/neo4j/graphalgo/beta/modularity/ModularityOptimizationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,21 +215,21 @@ private long[] getCommunityIds(long nodeCount, ModularityOptimization pmo) {
215215

216216
@Test
217217
void testLogging() {
218-
var graph = new StoreLoaderBuilder()
218+
Graph graph = new StoreLoaderBuilder()
219219
.api(db)
220220
.loadAnyLabel()
221221
.putRelationshipProjectionsWithIdentifier("TYPE_OUT", RelationshipProjection.of("TYPE", Orientation.NATURAL))
222222
.putRelationshipProjectionsWithIdentifier("TYPE_IN", RelationshipProjection.of("TYPE", Orientation.REVERSE))
223223
.build()
224224
.graph(NativeFactory.class);
225225

226-
var testLogger = new TestProgressLogger(
226+
TestProgressLogger testLogger = new TestProgressLogger(
227227
graph.relationshipCount(),
228228
"ModularityOptimization",
229229
3
230230
);
231231

232-
var modularityOptimization = new ModularityOptimization(
232+
ModularityOptimization modularityOptimization = new ModularityOptimization(
233233
graph,
234234
3,
235235
TOLERANCE_DEFAULT,

algo/src/test/java/org/neo4j/graphalgo/labelpropagation/LabelPropagationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,16 @@ void shouldBoundMemEstimationToMaxSupportedDegree() {
262262

263263
@Test
264264
void shouldLogProgress(){
265-
var graph = new StoreLoaderBuilder()
265+
Graph graph = new StoreLoaderBuilder()
266266
.api(db)
267267
.addNodeLabel("User")
268268
.addRelationshipType("FOLLOW")
269269
.build()
270270
.graph(NativeFactory.class);
271271

272-
var testLogger = new TestProgressLogger(graph.relationshipCount(), "Louvain", defaultConfig().concurrency());
272+
TestProgressLogger testLogger = new TestProgressLogger(graph.relationshipCount(), "Louvain", defaultConfig().concurrency());
273273

274-
var lp = new LabelPropagation(
274+
LabelPropagation lp = new LabelPropagation(
275275
graph,
276276
defaultConfig(),
277277
Pools.DEFAULT,

algo/src/test/java/org/neo4j/graphalgo/louvain/LouvainTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,13 @@ void testCanBeInterruptedByTxCancelation() {
378378

379379
@Test
380380
void testLogging() {
381-
var graph = loadGraph(NativeFactory.class, DB_CYPHER);
381+
Graph graph = loadGraph(NativeFactory.class, DB_CYPHER);
382382

383-
var config = defaultConfigBuilder().build();
383+
LouvainStreamConfig config = defaultConfigBuilder().build();
384384

385-
var testLogger = new TestProgressLogger(0, "Louvain", config.concurrency());
385+
TestProgressLogger testLogger = new TestProgressLogger(0, "Louvain", config.concurrency());
386386

387-
var louvain = new Louvain(
387+
Louvain louvain = new Louvain(
388388
graph,
389389
config,
390390
Pools.DEFAULT,

0 commit comments

Comments
 (0)