Package com.gpudb.protocol
Class GetJobResponse
- java.lang.Object
-
- com.gpudb.protocol.GetJobResponse
-
- All Implemented Interfaces:
org.apache.avro.generic.GenericContainer,org.apache.avro.generic.IndexedRecord
public class GetJobResponse extends Object implements org.apache.avro.generic.IndexedRecord
A set of results returned byGPUdb.getJob.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGetJobResponse.JobStatusA set of string constants for theGetJobResponseparameterjobStatus.static classGetJobResponse.ResponseEncodingA set of string constants for theGetJobResponseparameterresponseEncoding.static classGetJobResponse.StatusMapA set of string constants for theGetJobResponseparameterstatusMap.
-
Constructor Summary
Constructors Constructor Description GetJobResponse()Constructs a GetJobResponse object with default parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Objectget(int index)This method supports the Avro framework and is not intended to be called directly by the user.static org.apache.avro.SchemagetClassSchema()This method supports the Avro framework and is not intended to be called directly by the user.StringgetEndpoint()The endpoint which is being executed asynchronously.Map<String,String>getInfo()Additional information.ByteBuffergetJobResponse()The binary-encoded response of the job.StringgetJobResponseStr()The json-encoded response of the job.StringgetJobStatus()Status of the submitted job.intgetProgress()Approximate percentage of the job completed.StringgetResponseEncoding()The encoding of the job result (contained injobResponseorjobResponseStr.booleangetRunning()True if the end point is still executing.org.apache.avro.SchemagetSchema()This method supports the Avro framework and is not intended to be called directly by the user.Map<String,String>getStatusMap()Map of various status strings for the executed job.booleangetSuccessful()True if the job execution completed and no errors were encountered.inthashCode()voidput(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.GetJobResponsesetEndpoint(String endpoint)The endpoint which is being executed asynchronously.GetJobResponsesetInfo(Map<String,String> info)Additional information.GetJobResponsesetJobResponse(ByteBuffer jobResponse)The binary-encoded response of the job.GetJobResponsesetJobResponseStr(String jobResponseStr)The json-encoded response of the job.GetJobResponsesetJobStatus(String jobStatus)Status of the submitted job.GetJobResponsesetProgress(int progress)Approximate percentage of the job completed.GetJobResponsesetResponseEncoding(String responseEncoding)The encoding of the job result (contained injobResponseorjobResponseStr.GetJobResponsesetRunning(boolean running)True if the end point is still executing.GetJobResponsesetStatusMap(Map<String,String> statusMap)Map of various status strings for the executed job.GetJobResponsesetSuccessful(boolean successful)True if the job execution completed and no errors were encountered.StringtoString()
-
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
This method supports the Avro framework and is not intended to be called directly by the user.- Returns:
- The schema for the class.
-
getEndpoint
public String getEndpoint()
The endpoint which is being executed asynchronously. E.g. '/alter/table'.- Returns:
- The current value of
endpoint.
-
setEndpoint
public GetJobResponse setEndpoint(String endpoint)
The endpoint which is being executed asynchronously. E.g. '/alter/table'.- Parameters:
endpoint- The new value forendpoint.- Returns:
thisto mimic the builder pattern.
-
getJobStatus
public String getJobStatus()
Status of the submitted job. Supported values:RUNNING: The job is currently executing.DONE: The job execution has successfully completed and the response is included in thejobResponseorjobResponseStrfieldERROR: The job was attempted, but an error was encountered. ThestatusMapcontains the details of the error in error_messageCANCELLED: Job cancellation was requested while the execution was in progress.
- Returns:
- The current value of
jobStatus.
-
setJobStatus
public GetJobResponse setJobStatus(String jobStatus)
Status of the submitted job. Supported values:RUNNING: The job is currently executing.DONE: The job execution has successfully completed and the response is included in thejobResponseorjobResponseStrfieldERROR: The job was attempted, but an error was encountered. ThestatusMapcontains the details of the error in error_messageCANCELLED: Job cancellation was requested while the execution was in progress.
- Parameters:
jobStatus- The new value forjobStatus.- Returns:
thisto mimic the builder pattern.
-
getRunning
public boolean getRunning()
True if the end point is still executing.- Returns:
- The current value of
running.
-
setRunning
public GetJobResponse setRunning(boolean running)
True if the end point is still executing.- Parameters:
running- The new value forrunning.- Returns:
thisto mimic the builder pattern.
-
getProgress
public int getProgress()
Approximate percentage of the job completed.- Returns:
- The current value of
progress.
-
setProgress
public GetJobResponse setProgress(int progress)
Approximate percentage of the job completed.- Parameters:
progress- The new value forprogress.- Returns:
thisto mimic the builder pattern.
-
getSuccessful
public boolean getSuccessful()
True if the job execution completed and no errors were encountered.- Returns:
- The current value of
successful.
-
setSuccessful
public GetJobResponse setSuccessful(boolean successful)
True if the job execution completed and no errors were encountered.- Parameters:
successful- The new value forsuccessful.- Returns:
thisto mimic the builder pattern.
-
getResponseEncoding
public String getResponseEncoding()
The encoding of the job result (contained injobResponseorjobResponseStr. Supported values:BINARY: The job result is binary-encoded. It is contained injobResponse.JSON: The job result is json-encoded. It is contained injobResponseStr.
- Returns:
- The current value of
responseEncoding.
-
setResponseEncoding
public GetJobResponse setResponseEncoding(String responseEncoding)
The encoding of the job result (contained injobResponseorjobResponseStr. Supported values:BINARY: The job result is binary-encoded. It is contained injobResponse.JSON: The job result is json-encoded. It is contained injobResponseStr.
- Parameters:
responseEncoding- The new value forresponseEncoding.- Returns:
thisto mimic the builder pattern.
-
getJobResponse
public ByteBuffer getJobResponse()
The binary-encoded response of the job. This field is populated only when the job has completed andresponseEncodingisBINARY- Returns:
- The current value of
jobResponse.
-
setJobResponse
public GetJobResponse setJobResponse(ByteBuffer jobResponse)
The binary-encoded response of the job. This field is populated only when the job has completed andresponseEncodingisBINARY- Parameters:
jobResponse- The new value forjobResponse.- Returns:
thisto mimic the builder pattern.
-
getJobResponseStr
public String getJobResponseStr()
The json-encoded response of the job. This field is populated only when the job has completed andresponseEncodingisJSON- Returns:
- The current value of
jobResponseStr.
-
setJobResponseStr
public GetJobResponse setJobResponseStr(String jobResponseStr)
The json-encoded response of the job. This field is populated only when the job has completed andresponseEncodingisJSON- Parameters:
jobResponseStr- The new value forjobResponseStr.- Returns:
thisto mimic the builder pattern.
-
getStatusMap
public Map<String,String> getStatusMap()
Map of various status strings for the executed job.ERROR_MESSAGE: Explains what error occurred while running the job asynchronously. This entry only exists when the job status isERROR.
- Returns:
- The current value of
statusMap.
-
setStatusMap
public GetJobResponse setStatusMap(Map<String,String> statusMap)
Map of various status strings for the executed job.ERROR_MESSAGE: Explains what error occurred while running the job asynchronously. This entry only exists when the job status isERROR.
- Parameters:
statusMap- The new value forstatusMap.- Returns:
thisto mimic the builder pattern.
-
getInfo
public Map<String,String> getInfo()
Additional information.- Returns:
- The current value of
info.
-
setInfo
public GetJobResponse setInfo(Map<String,String> info)
Additional information.- Parameters:
info- The new value forinfo.- Returns:
thisto mimic the builder pattern.
-
getSchema
public org.apache.avro.Schema getSchema()
This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Returns:
- The schema object describing this class.
-
get
public Object get(int index)
This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to get- Returns:
- value of the field with the given index.
- Throws:
IndexOutOfBoundsException
-
put
public void put(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to setvalue- the value to set- Throws:
IndexOutOfBoundsException
-
-