You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/12/10 01:45:15 UTC

[GitHub] [shardingsphere-elasticjob] jackycchen opened a new issue #1767: YamlEngine function dumpAsMap data format incompatible

jackycchen opened a new issue #1767:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1767


   ## Feature Request
   ### Is your feature request related to a problem?
   Code location: YamlEngine.java#marshal
   `public static String marshal(final Object value) {
           return new Yaml(new ElasticJobYamlRepresenter()).dumpAsMap(value);
       }`
   The function dumpAsMap detail is :
   `public String dumpAsMap(Object data) {
           return this.dumpAs(data, Tag.MAP, FlowStyle.BLOCK);
       }`
   
   Problem is **data format incompatible**
   When the third parameter is FlowStyle.BLOCKļ¼Œthe result of function dumpAsMap is yaml format string
   When set third parameter to null, the the result of function dumpAsMap is json format string
   
   I found that elasticjob client store the config of a task in zookeeper is json format string in the older version(**like 2.1.5**), this will lead to incompatible with the current version.
   
   ### Describe the feature you would like.
   **should modify the function dumpAsMap like this:**
   `public String dumpAsMap(Object data) {
           return this.dumpAs(data, Tag.MAP, null);
       }`
   
   I think the data format should not be incompatible, thus will cause difficult to upgrade.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN closed issue #1767: YamlEngine function dumpAsMap data format incompatible

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #1767:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1767


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #1767: YamlEngine function dumpAsMap data format incompatible

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #1767:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1767#issuecomment-742182394


   The API has already changed in `3.0.0`. It's still incompatible even if using a same format to marshal/unmarshal configuration.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN edited a comment on issue #1767: YamlEngine function dumpAsMap data format incompatible

Posted by GitBox <gi...@apache.org>.
TeslaCN edited a comment on issue #1767:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1767#issuecomment-742182394


   The API has already changed in `3.0.0`. It's still incompatible with 2.x even if using a same format to marshal/unmarshal configuration.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org