-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d9fd89
commit c3041a7
Showing
10 changed files
with
173 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...line/src/main/java/org/neo4j/gds/ml/pipeline/stubs/SingleSourceShortestPathDeltaStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) "Neo4j" | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.gds.ml.pipeline.stubs; | ||
|
||
import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaMutateConfig; | ||
import org.neo4j.gds.procedures.algorithms.AlgorithmsProcedureFacade; | ||
import org.neo4j.gds.procedures.algorithms.pathfinding.MutateStub; | ||
import org.neo4j.gds.procedures.algorithms.pathfinding.PathFindingMutateResult; | ||
|
||
public class SingleSourceShortestPathDeltaStub extends AbstractStub<AllShortestPathsDeltaMutateConfig, PathFindingMutateResult> { | ||
protected MutateStub<AllShortestPathsDeltaMutateConfig, PathFindingMutateResult> stub(AlgorithmsProcedureFacade facade) { | ||
return facade.pathFinding().deltaSteppingMutateStub(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...n/java/org/neo4j/gds/procedures/algorithms/pathfinding/stubs/DeltaSteppingMutateStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright (c) "Neo4j" | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.gds.procedures.algorithms.pathfinding.stubs; | ||
|
||
import org.neo4j.gds.applications.algorithms.pathfinding.PathFindingAlgorithmsEstimationModeBusinessFacade; | ||
import org.neo4j.gds.applications.algorithms.pathfinding.PathFindingAlgorithmsMutateModeBusinessFacade; | ||
import org.neo4j.gds.core.utils.mem.MemoryEstimation; | ||
import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaMutateConfig; | ||
import org.neo4j.gds.procedures.algorithms.pathfinding.MutateStub; | ||
import org.neo4j.gds.procedures.algorithms.pathfinding.PathFindingMutateResult; | ||
import org.neo4j.gds.procedures.algorithms.pathfinding.PathFindingResultBuilderForMutateMode; | ||
import org.neo4j.gds.results.MemoryEstimateResult; | ||
|
||
import java.util.Map; | ||
import java.util.stream.Stream; | ||
|
||
public class DeltaSteppingMutateStub implements MutateStub<AllShortestPathsDeltaMutateConfig, PathFindingMutateResult> { | ||
private final GenericStub genericStub; | ||
private final PathFindingAlgorithmsEstimationModeBusinessFacade estimationFacade; | ||
private final PathFindingAlgorithmsMutateModeBusinessFacade mutateFacade; | ||
|
||
public DeltaSteppingMutateStub( | ||
GenericStub genericStub, | ||
PathFindingAlgorithmsEstimationModeBusinessFacade estimationFacade, | ||
PathFindingAlgorithmsMutateModeBusinessFacade mutateFacade | ||
) { | ||
this.estimationFacade = estimationFacade; | ||
this.mutateFacade = mutateFacade; | ||
this.genericStub = genericStub; | ||
} | ||
|
||
@Override | ||
public void validateConfiguration(Map<String, Object> configuration) { | ||
genericStub.validateConfiguration(AllShortestPathsDeltaMutateConfig::of, configuration); | ||
} | ||
|
||
@Override | ||
public AllShortestPathsDeltaMutateConfig parseConfiguration(Map<String, Object> configuration) { | ||
return genericStub.parseConfiguration(AllShortestPathsDeltaMutateConfig::of, configuration); | ||
} | ||
|
||
@Override | ||
public MemoryEstimation getMemoryEstimation(String username, Map<String, Object> configuration) { | ||
return genericStub.getMemoryEstimation( | ||
username, | ||
configuration, | ||
AllShortestPathsDeltaMutateConfig::of, | ||
__ -> estimationFacade.deltaSteppingEstimation() | ||
); | ||
} | ||
|
||
@Override | ||
public Stream<MemoryEstimateResult> estimate(Object graphName, Map<String, Object> rawConfiguration) { | ||
return genericStub.estimate( | ||
graphName, | ||
rawConfiguration, | ||
AllShortestPathsDeltaMutateConfig::of, | ||
__ -> estimationFacade.deltaSteppingEstimation() | ||
); | ||
} | ||
|
||
@Override | ||
public Stream<PathFindingMutateResult> execute(String graphName, Map<String, Object> configuration) { | ||
return genericStub.execute( | ||
graphName, | ||
configuration, | ||
AllShortestPathsDeltaMutateConfig::of, | ||
mutateFacade::deltaStepping, | ||
new PathFindingResultBuilderForMutateMode<>() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters