Class 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 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, 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 Detail

      • 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