Package oracle.pgx.api
Class AlgorithmProgress
- java.lang.Object
-
- oracle.pgx.api.FutureProgress
-
- oracle.pgx.api.AlgorithmProgress
-
public class AlgorithmProgress extends FutureProgress
Represents Algorithm progress stateExamples
PgxGraph graph = session.readGraphByName("myGraph", GraphSource.PG_SQL); PgxFuture<VertexProperty<Object, Double>> future = analyst.pagerankAsync(graph); FutureProgress futureProgress = future.getProgress(); Optional<AlgorithmProgress> algorithmProgress = futureProgress.asAlgorithmExecutionProgress(); if (algorithmProgress.isPresent()) { AlgorithmProgress progress = algorithmProgress.get(); long completedSteps = progress.getNumberOfStepsCompleted(); Long numberOfStepsEstimatedForCompletion = progress.getNumberOfStepsEstimatedForCompletion(); }
- Since:
- 24.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class oracle.pgx.api.FutureProgress
FutureProgress.FutureProgressType
-
-
Field Summary
-
Fields inherited from class oracle.pgx.api.FutureProgress
TYPE_ID_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AlgorithmProgress(long numberOfStepsCompleted, java.lang.Long numberOfStepsEstimatedForCompletion, oracle.pgx.common.Progress progress)
Create a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<AlgorithmProgress>
asAlgorithmExecutionProgress()
In case of algorithm execution future, return AlgorithmProgressjava.util.Optional<GraphLoadingProgress>
asGraphLoadingProgress()
In case of graph loading future, return stats about graph loading progresslong
getNumberOfStepsCompleted()
java.lang.Long
getNumberOfStepsEstimatedForCompletion()
-
Methods inherited from class oracle.pgx.api.FutureProgress
getFutureProgressType, getState
-
-
-
-
Constructor Detail
-
AlgorithmProgress
public AlgorithmProgress(long numberOfStepsCompleted, java.lang.Long numberOfStepsEstimatedForCompletion, oracle.pgx.common.Progress progress)
Create a new instance of this class. Do not use this constructor, useFutureProgress.asAlgorithmExecutionProgress()
to acquire an Optional of this class instead.- Parameters:
numberOfStepsCompleted
- The current number of steps executed by the algorithm.numberOfStepsEstimatedForCompletion
- Estimation of the total number of steps needed for completion.progress
- The current state of the PgxFuture.
-
-
Method Detail
-
asGraphLoadingProgress
public java.util.Optional<GraphLoadingProgress> asGraphLoadingProgress()
Description copied from class:FutureProgress
In case of graph loading future, return stats about graph loading progress- Specified by:
asGraphLoadingProgress
in classFutureProgress
- Returns:
- empty if the PgxFuture is not a graph loading future.
-
asAlgorithmExecutionProgress
public java.util.Optional<AlgorithmProgress> asAlgorithmExecutionProgress()
Description copied from class:FutureProgress
In case of algorithm execution future, return AlgorithmProgress- Overrides:
asAlgorithmExecutionProgress
in classFutureProgress
- Returns:
- empty if the PgxFuture is not an algorithm execution future.
-
getNumberOfStepsEstimatedForCompletion
public java.lang.Long getNumberOfStepsEstimatedForCompletion()
- Returns:
- an Estimation of the total number of steps needed for completion
- Since:
- 24.2.1
-
getNumberOfStepsCompleted
public long getNumberOfStepsCompleted()
- Returns:
- The current number of steps executed by the algorithm
- Since:
- 24.2.1
-
-