Package oracle.pgx.api
Class CompiledProgram
- java.lang.Object
-
- oracle.pgx.api.internal.ApiObject
-
- oracle.pgx.api.Destroyable
-
- oracle.pgx.api.PgxManagedObject
-
- oracle.pgx.api.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.ArgumentconvertArg(java.lang.Object obj, ArgumentType type, int idx)PgxFuture<java.lang.Void>destroyAsync()Requests destruction of this object.booleanequals(java.lang.Object obj)ArgumentType[]getArgumentTypes()Gets the argument types.java.lang.StringgetCompilerOutput()Gets the compiler output.java.lang.StringgetId()Gets the ID of this program.java.lang.StringgetName()Alias forgetId().ReturnTypegetReturnType()Gets the return type.PgxSessiongetSession()Gets the session.inthashCode()<T> oracle.pgx.api.internal.AnalysisResult<T>run(java.lang.Object... args)Blocking version ofrunAsync(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 ofrunAsync(Collection, Object...).<T> oracle.pgx.api.internal.AnalysisResult<T>run(oracle.pgx.api.internal.characteristic.WorkloadCharacteristicPreset characteristics, java.lang.Object... args)Blocking version ofrunAsync(WorkloadCharacteristicPreset, Object...).<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.StringtoString()-
Methods inherited from class oracle.pgx.api.Destroyable
close, destroy
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Alias forgetId().- Specified by:
getNamein classPgxManagedObject- Returns:
- the ID of this program.
-
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:DestroyableRequests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.- Specified by:
destroyAsyncin classDestroyable- 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 analysisargs- 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 analysisargs- 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(java.lang.Object obj)
- Overrides:
equalsin classPgxManagedObject
-
hashCode
public int hashCode()
- Overrides:
hashCodein classPgxManagedObject
-
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:
toStringin classjava.lang.Object
-
run
public <T> oracle.pgx.api.internal.AnalysisResult<T> run(java.lang.Object... args) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionBlocking version ofrunAsync(Object...). CallsrunAsync(Object...)and waits for the returnedPgxFutureto 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.InterruptedExceptionBlocking version ofrunAsync(Collection, Object...). CallsrunAsync(Collection, Object...)and waits for returnedPgxFutureto 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.InterruptedExceptionBlocking version ofrunAsync(WorkloadCharacteristicPreset, Object...). CallsrunAsync(WorkloadCharacteristicPreset, Object...)and waits for returnedPgxFutureto 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.
-
-