jon-wei commented on a change in pull request #6334: make 0.13 tasks API 
backwards compatible with 0.12  (#6333)
URL: https://github.com/apache/incubator-druid/pull/6334#discussion_r219340177
 
 

 ##########
 File path: api/src/main/java/org/apache/druid/indexer/TaskStatusPlus.java
 ##########
 @@ -49,6 +51,7 @@ public TaskStatusPlus(
       @JsonProperty("createdTime") DateTime createdTime,
       @JsonProperty("queueInsertionTime") DateTime queueInsertionTime,
       @JsonProperty("statusCode") @Nullable TaskState state,
+      @Deprecated @JsonProperty("status") @Nullable TaskState status,  // 
present for backwards compatibility
 
 Review comment:
   For deserialization safety, can you add something here like:
   - if "status" is null and "statusCode" is not null, set both to the value of 
"statusCode"
   - If "statusCode" is null and "status" is not null, set both to the value of 
"status"
   - if both are non-null, but have different values, log an error
   
   I don't think there should be a situation where new code would be trying to 
deserialize an old TaskStatusPlus if the rolling upgrade sequence is followed, 
but I think it'd be good to handle that situation

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to