Class CompiledProgram

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class CompiledProgram
    extends PgxManagedObject
    A compiled Green-Marl program.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static oracle.pgx.api.internal.Argument convertArg​(java.lang.Object obj, ArgumentType type, int idx)  
      PgxFuture<java.lang.Void> destroyAsync()
      Requests destruction of this object.
      boolean equals​(java.lang.Object obj)  
      ArgumentType[] getArgumentTypes()
      Gets the argument types.
      java.lang.String getCompilerOutput()
      Gets the compiler output.
      java.lang.String getId()
      Gets the ID of this program.
      java.lang.String getName()
      Alias for getId().
      ReturnType getReturnType()
      Gets the return type.
      PgxSession getSession()
      Gets the session.
      int hashCode()  
      <T> oracle.pgx.api.internal.AnalysisResult<T> run​(java.lang.Object... args)
      Blocking version of runAsync(Object...).
      <T> oracle.pgx.api.internal.AnalysisResult<T> run​(java.util.Collection<oracle.pgx.api.internal.characteristic.WorkloadCharacteristic> characteristics, java.lang.Object... args)
      Blocking version of runAsync(Collection, Object...).
      <T> oracle.pgx.api.internal.AnalysisResult<T> run​(oracle.pgx.api.internal.characteristic.WorkloadCharacteristicPreset characteristics, java.lang.Object... args)
      <T> PgxFuture<oracle.pgx.api.internal.AnalysisResult<T>> runAsync​(java.lang.Object... args)
      Runs the compiled program with the given parameters.
      <T> PgxFuture<oracle.pgx.api.internal.AnalysisResult<T>> runAsync​(java.util.Collection<oracle.pgx.api.internal.characteristic.WorkloadCharacteristic> characteristics, java.lang.Object... args)
      Runs the compiled program with the given parameters.
      <T> PgxFuture<oracle.pgx.api.internal.AnalysisResult<T>> runAsync​(oracle.pgx.api.internal.characteristic.WorkloadCharacteristicPreset characteristics, java.lang.Object... args)
      Runs the compiled program with the given parameters.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getId

        public java.lang.String getId()
        Gets the ID of this program.
        Returns:
        the ID of this program.
      • getCompilerOutput

        public java.lang.String getCompilerOutput()
        Gets the compiler output.
        Returns:
        the compiler output (NULL if none).
      • getSession

        public PgxSession getSession()
        Gets the session.
        Returns:
        the session this program belongs to.
      • destroyAsync

        public PgxFuture<java.lang.Void> destroyAsync()
        Description copied from class: Destroyable
        Requests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.
        Specified by:
        destroyAsync in class Destroyable
        Returns:
        a future which will be completed once the destruction request finishes.
      • runAsync

        public <T> PgxFuture<oracle.pgx.api.internal.AnalysisResult<T>> runAsync​(java.lang.Object... args)
        Runs the compiled program with the given parameters. If the Green-Marl procedure of this compiled program looks like this:

         procedure pagerank(graph G, e double, max int, nodePorp<double>){...}
        
         After, this method can be called
        
         PgxGraph g = ...
         VertexProperty<ID, Double> rank = ...
         runAsync(g, 0.01, 0.85, 100, rank)
         

        Parameters:
        args - all the arguments required by specified procedure
        Returns:
        result of analysis as an AnalysisResult
      • runAsync

        public <T> PgxFuture<oracle.pgx.api.internal.AnalysisResult<T>> runAsync​(java.util.Collection<oracle.pgx.api.internal.characteristic.WorkloadCharacteristic> characteristics,
                                                                                 java.lang.Object... args)
        Runs the compiled program with the given parameters. If the Green-Marl procedure of this compiled program looks like this:

         procedure pagerank(graph G, e double, max int, nodePorp<double>){...}
        
         After, this method can be called
        
         PgxGraph g = ...
         VertexProperty<ID, Double> rank = ...
         runAsync(PoolType.ANALYSIS_POOL, g, 0.01, 0.85, 100, rank)
         

        Parameters:
        characteristics - the characteristics of this analysis
        args - all the arguments required by specified procedure
        Returns:
        result of analysis as an AnalysisResult
        Since:
        2.5.0
        See Also:
        WorkloadCharacteristic
      • runAsync

        public <T> PgxFuture<oracle.pgx.api.internal.AnalysisResult<T>> runAsync​(oracle.pgx.api.internal.characteristic.WorkloadCharacteristicPreset characteristics,
                                                                                 java.lang.Object... args)
        Runs the compiled program with the given parameters. If the Green-Marl procedure of this compiled program looks like this:

         procedure pagerank(graph G, e double, max int, nodePorp<double>){...}
        
         After, this method can be called
        
         PgxGraph g = ...
         VertexProperty<ID, Double> rank = ...
         runAsync(g, 0.01, 0.85, 100, rank)
         

        Parameters:
        characteristics - the characteristics of this analysis
        args - all the arguments required by specified procedure
        Returns:
        result of analysis as an AnalysisResult
        Since:
        2.5.0
        See Also:
        WorkloadCharacteristicPreset
      • convertArg

        public static oracle.pgx.api.internal.Argument convertArg​(java.lang.Object obj,
                                                                  ArgumentType type,
                                                                  int idx)
                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getReturnType

        public ReturnType getReturnType()
        Gets the return type.
        Returns:
        the return type
      • getArgumentTypes

        public ArgumentType[] getArgumentTypes()
        Gets the argument types.
        Returns:
        the argument types
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • run

        public <T> oracle.pgx.api.internal.AnalysisResult<T> run​(java.lang.Object... args)
                                                          throws java.util.concurrent.ExecutionException,
                                                                 java.lang.InterruptedException
        Blocking version of runAsync(Object...). Calls runAsync(Object...) and waits for the returned PgxFuture to complete.
        Throws:
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
      • run

        public <T> oracle.pgx.api.internal.AnalysisResult<T> run​(java.util.Collection<oracle.pgx.api.internal.characteristic.WorkloadCharacteristic> characteristics,
                                                                 java.lang.Object... args)
                                                          throws java.util.concurrent.ExecutionException,
                                                                 java.lang.InterruptedException
        Blocking version of runAsync(Collection, Object...). Calls runAsync(Collection, Object...) and waits for returned PgxFuture to complete.
        Throws:
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
      • run

        public <T> oracle.pgx.api.internal.AnalysisResult<T> run​(oracle.pgx.api.internal.characteristic.WorkloadCharacteristicPreset characteristics,
                                                                 java.lang.Object... args)
                                                          throws java.util.concurrent.ExecutionException,
                                                                 java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.