[NO ISSUE][OTH] Handle Missing JobId in ClientRequest
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Return null for the job id for ClientRequest json
in case the request job id has not been assigned
yet.
Change-Id: Ida55b4802850e0921d167222f7d072343f84d198
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3204
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Contrib: Murtadha Hubail <mhubail@apache.org>
Integration-Tests: Murtadha Hubail <mhubail@apache.org>
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java
index fe6aeea..155b817 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java
@@ -28,10 +28,10 @@
public class ClientRequest extends BaseClientRequest {
- protected String statement;
- protected JobId jobId;
- protected Thread executor;
- protected String clientContextId;
+ protected final Thread executor;
+ protected final String statement;
+ protected final String clientContextId;
+ protected volatile JobId jobId;
public ClientRequest(ICommonRequestParameters requestParameters) {
super(requestParameters.getRequestReference());
@@ -73,7 +73,7 @@
@Override
protected ObjectNode asJson() {
ObjectNode json = super.asJson();
- json.put("jobId", jobId.toString());
+ json.put("jobId", jobId != null ? jobId.toString() : null);
json.put("statement", statement);
json.put("clientContextID", clientContextId);
return json;