Class AlgorithmProgress

java.lang.Object
oracle.pgx.api.FutureProgress
oracle.pgx.api.AlgorithmProgress

public class AlgorithmProgress extends FutureProgress
Represents Algorithm progress state

Examples

 
 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
  • Constructor Details

    • AlgorithmProgress

      public AlgorithmProgress(long numberOfStepsCompleted, Long numberOfStepsEstimatedForCompletion, oracle.pgx.common.Progress progress)
      Create a new instance of this class. Do not use this constructor, use FutureProgress.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 Details

    • asGraphLoadingProgress

      public Optional<GraphLoadingProgress> asGraphLoadingProgress()
      Description copied from class: FutureProgress
      In case of graph loading future, return stats about graph loading progress
      Specified by:
      asGraphLoadingProgress in class FutureProgress
      Returns:
      empty if the PgxFuture is not a graph loading future.
    • asAlgorithmExecutionProgress

      public Optional<AlgorithmProgress> asAlgorithmExecutionProgress()
      Description copied from class: FutureProgress
      In case of algorithm execution future, return AlgorithmProgress
      Overrides:
      asAlgorithmExecutionProgress in class FutureProgress
      Returns:
      empty if the PgxFuture is not an algorithm execution future.
    • getNumberOfStepsEstimatedForCompletion

      public 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