Skip to content

Commit 0bacb34

Browse files
Delete existing pregel implementation
1 parent 7e246ba commit 0bacb34

File tree

13 files changed

+361
-453
lines changed

13 files changed

+361
-453
lines changed

alpha/alpha-proc/src/main/java/org/neo4j/gds/pregel/DeprecatedAlphaHits.java renamed to algorithm-specifications/src/main/java/org/neo4j/gds/hits/Constants.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
* You should have received a copy of the GNU General Public License
1818
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*/
20-
package org.neo4j.gds.pregel;
20+
package org.neo4j.gds.hits;
2121

22-
import org.neo4j.gds.beta.pregel.annotation.PregelProcedure;
22+
public class Constants {
2323

24-
@PregelProcedure(
25-
name = "gds.alpha.hits",
26-
description = "Hyperlink-Induced Topic Search (HITS) is a link analysis algorithm that rates nodes",
27-
deprecatedBy = "gds.hits"
28-
)
29-
public class DeprecatedAlphaHits extends Hits {}
24+
public static final String HITS_DESCRIPTION = "Hyperlink-Induced Topic Search (HITS) is a link analysis algorithm that rates nodes";
25+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.hits;
21+
22+
import org.neo4j.gds.GraphAlgorithmFactory;
23+
import org.neo4j.gds.NullComputationResultConsumer;
24+
import org.neo4j.gds.api.Graph;
25+
import org.neo4j.gds.beta.pregel.PregelResult;
26+
import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker;
27+
import org.neo4j.gds.executor.AlgorithmSpec;
28+
import org.neo4j.gds.executor.ComputationResultConsumer;
29+
import org.neo4j.gds.executor.ExecutionContext;
30+
import org.neo4j.gds.executor.ExecutionMode;
31+
import org.neo4j.gds.executor.GdsCallable;
32+
import org.neo4j.gds.mem.MemoryEstimation;
33+
import org.neo4j.gds.procedures.algorithms.centrality.HitsMutateResult;
34+
import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction;
35+
36+
import java.util.stream.Stream;
37+
38+
@GdsCallable(
39+
name = "gds.hits.mutate",
40+
aliases = {"gds.alpha.hits.mutate"},
41+
description = Constants.HITS_DESCRIPTION,
42+
executionMode = ExecutionMode.MUTATE_NODE_PROPERTY
43+
)
44+
public class HitsMutateSpec implements AlgorithmSpec<Hits, PregelResult, HitsConfig, Stream<HitsMutateResult>, HitsMutateSpec.Factory> {
45+
46+
@Override
47+
public String name() {
48+
return "HitsStream";
49+
}
50+
51+
@Override
52+
public Factory algorithmFactory(ExecutionContext executionContext) {
53+
return new Factory();
54+
}
55+
56+
@Override
57+
public NewConfigFunction<HitsConfig> newConfigFunction() {
58+
return (___,config) -> HitsConfig.of(config);
59+
}
60+
61+
@Override
62+
public ComputationResultConsumer<Hits, PregelResult, HitsConfig, Stream<HitsMutateResult>> computationResultConsumer() {
63+
return new NullComputationResultConsumer<>();
64+
}
65+
66+
67+
static class Factory extends GraphAlgorithmFactory<Hits,HitsConfig> {
68+
69+
@Override
70+
public Hits build(
71+
Graph graphOrGraphStore,
72+
HitsConfig configuration,
73+
ProgressTracker progressTracker
74+
) {
75+
return null;
76+
}
77+
78+
@Override
79+
public String taskName() {
80+
return "";
81+
}
82+
83+
@Override
84+
public MemoryEstimation memoryEstimation(HitsConfig config) {
85+
return new HitsMemoryEstimateDefinition().memoryEstimation();
86+
}
87+
}
88+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.hits;
21+
22+
import org.neo4j.gds.GraphAlgorithmFactory;
23+
import org.neo4j.gds.NullComputationResultConsumer;
24+
import org.neo4j.gds.api.Graph;
25+
import org.neo4j.gds.beta.pregel.PregelResult;
26+
import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker;
27+
import org.neo4j.gds.executor.AlgorithmSpec;
28+
import org.neo4j.gds.executor.ComputationResultConsumer;
29+
import org.neo4j.gds.executor.ExecutionContext;
30+
import org.neo4j.gds.executor.ExecutionMode;
31+
import org.neo4j.gds.executor.GdsCallable;
32+
import org.neo4j.gds.mem.MemoryEstimation;
33+
import org.neo4j.gds.procedures.algorithms.centrality.HitsStatsResult;
34+
import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction;
35+
36+
import java.util.stream.Stream;
37+
38+
@GdsCallable(
39+
name = "gds.hits.stats",
40+
aliases = {"gds.alpha.hits.stats"},
41+
description = Constants.HITS_DESCRIPTION,
42+
executionMode = ExecutionMode.STATS
43+
)
44+
public class HitsStatsSpec implements AlgorithmSpec<Hits, PregelResult, HitsConfig, Stream<HitsStatsResult>, HitsStatsSpec.Factory> {
45+
46+
@Override
47+
public String name() {
48+
return "HitsStream";
49+
}
50+
51+
@Override
52+
public Factory algorithmFactory(ExecutionContext executionContext) {
53+
return new Factory();
54+
}
55+
56+
@Override
57+
public NewConfigFunction<HitsConfig> newConfigFunction() {
58+
return (___,config) -> HitsConfig.of(config);
59+
}
60+
61+
@Override
62+
public ComputationResultConsumer<Hits, PregelResult, HitsConfig, Stream<HitsStatsResult>> computationResultConsumer() {
63+
return new NullComputationResultConsumer<>();
64+
}
65+
66+
67+
static class Factory extends GraphAlgorithmFactory<Hits,HitsConfig> {
68+
69+
@Override
70+
public Hits build(
71+
Graph graphOrGraphStore,
72+
HitsConfig configuration,
73+
ProgressTracker progressTracker
74+
) {
75+
return null;
76+
}
77+
78+
@Override
79+
public String taskName() {
80+
return "";
81+
}
82+
83+
@Override
84+
public MemoryEstimation memoryEstimation(HitsConfig config) {
85+
return new HitsMemoryEstimateDefinition().memoryEstimation();
86+
}
87+
}
88+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.hits;
21+
22+
import org.neo4j.gds.GraphAlgorithmFactory;
23+
import org.neo4j.gds.NullComputationResultConsumer;
24+
import org.neo4j.gds.api.Graph;
25+
import org.neo4j.gds.beta.pregel.PregelResult;
26+
import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker;
27+
import org.neo4j.gds.executor.AlgorithmSpec;
28+
import org.neo4j.gds.executor.ComputationResultConsumer;
29+
import org.neo4j.gds.executor.ExecutionContext;
30+
import org.neo4j.gds.executor.ExecutionMode;
31+
import org.neo4j.gds.executor.GdsCallable;
32+
import org.neo4j.gds.mem.MemoryEstimation;
33+
import org.neo4j.gds.procedures.algorithms.centrality.HitsStreamResult;
34+
import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction;
35+
36+
import java.util.stream.Stream;
37+
38+
@GdsCallable(
39+
name = "gds.hits.stream",
40+
aliases = {"gds.alpha.hits.stream"},
41+
description = Constants.HITS_DESCRIPTION,
42+
executionMode = ExecutionMode.STREAM
43+
)
44+
public class HitsStreamSpec implements AlgorithmSpec<Hits, PregelResult, HitsConfig, Stream<HitsStreamResult>, HitsStreamSpec.Factory> {
45+
46+
@Override
47+
public String name() {
48+
return "HitsStream";
49+
}
50+
51+
@Override
52+
public Factory algorithmFactory(ExecutionContext executionContext) {
53+
return new Factory();
54+
}
55+
56+
@Override
57+
public NewConfigFunction<HitsConfig> newConfigFunction() {
58+
return (___,config) -> HitsConfig.of(config);
59+
}
60+
61+
@Override
62+
public ComputationResultConsumer<Hits, PregelResult, HitsConfig, Stream<HitsStreamResult>> computationResultConsumer() {
63+
return new NullComputationResultConsumer<>();
64+
}
65+
66+
67+
static class Factory extends GraphAlgorithmFactory<Hits,HitsConfig> {
68+
69+
@Override
70+
public Hits build(
71+
Graph graphOrGraphStore,
72+
HitsConfig configuration,
73+
ProgressTracker progressTracker
74+
) {
75+
return null;
76+
}
77+
78+
@Override
79+
public String taskName() {
80+
return "";
81+
}
82+
83+
@Override
84+
public MemoryEstimation memoryEstimation(HitsConfig config) {
85+
return new HitsMemoryEstimateDefinition().memoryEstimation();
86+
}
87+
}
88+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.hits;
21+
22+
import org.neo4j.gds.GraphAlgorithmFactory;
23+
import org.neo4j.gds.NullComputationResultConsumer;
24+
import org.neo4j.gds.api.Graph;
25+
import org.neo4j.gds.beta.pregel.PregelResult;
26+
import org.neo4j.gds.core.utils.progress.tasks.ProgressTracker;
27+
import org.neo4j.gds.executor.AlgorithmSpec;
28+
import org.neo4j.gds.executor.ComputationResultConsumer;
29+
import org.neo4j.gds.executor.ExecutionContext;
30+
import org.neo4j.gds.executor.ExecutionMode;
31+
import org.neo4j.gds.executor.GdsCallable;
32+
import org.neo4j.gds.mem.MemoryEstimation;
33+
import org.neo4j.gds.procedures.algorithms.centrality.HitsWriteResult;
34+
import org.neo4j.gds.procedures.algorithms.configuration.NewConfigFunction;
35+
36+
import java.util.stream.Stream;
37+
38+
@GdsCallable(
39+
name = "gds.hits.write",
40+
aliases = {"gds.alpha.hits.write"},
41+
description = Constants.HITS_DESCRIPTION,
42+
executionMode = ExecutionMode.WRITE_NODE_PROPERTY
43+
)
44+
public class HitsWriteSpec implements AlgorithmSpec<Hits, PregelResult, HitsConfig, Stream<HitsWriteResult>, HitsWriteSpec.Factory> {
45+
46+
@Override
47+
public String name() {
48+
return "HitsStream";
49+
}
50+
51+
@Override
52+
public Factory algorithmFactory(ExecutionContext executionContext) {
53+
return new Factory();
54+
}
55+
56+
@Override
57+
public NewConfigFunction<HitsConfig> newConfigFunction() {
58+
return (___,config) -> HitsConfig.of(config);
59+
}
60+
61+
@Override
62+
public ComputationResultConsumer<Hits, PregelResult, HitsConfig, Stream<HitsWriteResult>> computationResultConsumer() {
63+
return new NullComputationResultConsumer<>();
64+
}
65+
66+
67+
static class Factory extends GraphAlgorithmFactory<Hits,HitsConfig> {
68+
69+
@Override
70+
public Hits build(
71+
Graph graphOrGraphStore,
72+
HitsConfig configuration,
73+
ProgressTracker progressTracker
74+
) {
75+
return null;
76+
}
77+
78+
@Override
79+
public String taskName() {
80+
return "";
81+
}
82+
83+
@Override
84+
public MemoryEstimation memoryEstimation(HitsConfig config) {
85+
return new HitsMemoryEstimateDefinition().memoryEstimation();
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)