Class CompiledProgram

java.lang.Object
oracle.pgx.api.internal.ApiObject
All Implemented Interfaces:
AutoCloseable

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

    • getName

      public String getName()
      Alias for getId().
      Specified by:
      getName in class PgxManagedObject
      Returns:
      the ID of this program.
    • getId

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

      public 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<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(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){...}
      
       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(Collection<oracle.pgx.api.internal.characteristic.WorkloadCharacteristic> characteristics, 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){...}
      
       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, 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){...}
      
       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
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class PgxManagedObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class PgxManagedObject
    • convertArg

      public static oracle.pgx.api.internal.Argument convertArg(Object obj, ArgumentType type, int idx) throws Exception
      Throws:
      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 String toString()
      Overrides:
      toString in class Object
    • run

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

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