You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@heron.apache.org by GitBox <gi...@apache.org> on 2018/04/02 21:05:31 UTC
[GitHub] ajorgensen opened a new pull request #2842: Add json format for dry-run
ajorgensen opened a new pull request #2842: Add json format for dry-run
URL: https://github.com/apache/incubator-heron/pull/2842
This adds json as an optional format for the dry-run output. Json is
more easily machine readable than the other output formats and can be
used to make deploy decisions based on the resources required and the
resources available at deploy time.
An example output for submit:
```
{"packingClass":"com.twitter.heron.packing.roundrobin.ResourceCompliantRRPacking","topology":"acking-topology","containers":[{"id":1,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"exclaim1","id":1,"index":0,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":2,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"exclaim1","id":2,"index":1,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":3,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"word","id":3,"index":0,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":4,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"word","id":4,"index":1,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]}]}
```
The update command produces a similar output but it simply outputs both
the old and the new packing plan in json format. It is up to the caller
to determine how they want to compare the two and what parts of the
difference they care about:
```
New packing plan:
{"packingClass":"com.twitter.heron.packing.roundrobin.ResourceCompliantRRPacking","topology":"acking-topology","containers":[{"id":1,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"exclaim1","id":1,"index":0,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":3,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"word","id":3,"index":0,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":4,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"word","id":4,"index":1,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]}]}
Old packing plan:
{"packingClass":"com.twitter.heron.packing.roundrobin.ResourceCompliantRRPacking","topology":"acking-topology","containers":[{"id":2,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"exclaim1","id":2,"index":1,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":1,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"exclaim1","id":1,"index":0,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":3,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"word","id":3,"index":0,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]},{"id":4,"resources":{"cpu":1.0,"ram":590558003,"disk":1181116006},"components":[{"component":"word","id":4,"index":1,"resources":{"cpu":1.0,"ram":536870912,"disk":1073741824}}]}]}
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services