You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@aurora.apache.org by Bill Farner <wf...@apache.org> on 2014/06/26 05:44:14 UTC

Review Request 22998: Generate wrapper classes for all thrift structs in api.thrift.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22998/
-----------------------------------------------------------

Review request for Aurora and Maxim Khutornenko.


Repository: aurora


Description
-------

Addressing TODO from build.gradle.

This change also causes two changes to existing generated classes:

- Accessor methods of type {List,Set,Map} now return Immutable{List,Set,Map}
- isSet* methods are generated for all fields (not sure why this wasn't the case before)

Here's a full diff of generated sources after this change:
$ for file in `find . -type f`; do   diff $file ../new/$file; done
117a118,121
>   public boolean isSetCronCollisionPolicy() {
>     return wrapped.isSetCronCollisionPolicy();
>   }
>
16,18d15
< import java.util.Map;
< import java.util.Set;
<
197c194
<   public Set<IConstraint> getConstraints() {
---
>   public ImmutableSet<IConstraint> getConstraints() {
205c202
<   public Set<String> getRequestedPorts() {
---
>   public ImmutableSet<String> getRequestedPorts() {
213c210
<   public Map<String, String> getTaskLinks() {
---
>   public ImmutableMap<String, String> getTaskLinks() {
237c234
<   public Set<IMetadata> getMetadata() {
---
>   public ImmutableSet<IMetadata> getMetadata() {
84a85,88
>   public boolean isSetValue() {
>     return wrapped.isSetValue();
>   }
>
88a93,96
>   public boolean isSetLimit() {
>     return wrapped.isSetLimit();
>   }
>
16,17d15
< import java.util.Set;
<
99c97
<   public Set<String> getValues() {
---
>   public ImmutableSet<String> getValues() {


Diffs
-----

  build.gradle bcecb43308a654e79db5cbd0ba973b2410b00de9 
  src/main/python/apache/aurora/tools/java/thrift_wrapper_codegen.py 9dc92fd486b1166bcf3d14b7806323002aa9f8d2 

Diff: https://reviews.apache.org/r/22998/diff/


Testing
-------

./gradlew build -Pq


Thanks,

Bill Farner


Re: Review Request 22998: Generate wrapper classes for all thrift structs in api.thrift.

Posted by Maxim Khutornenko <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22998/#review46759
-----------------------------------------------------------

Ship it!


Awesome!

- Maxim Khutornenko


On June 26, 2014, 3:44 a.m., Bill Farner wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22998/
> -----------------------------------------------------------
> 
> (Updated June 26, 2014, 3:44 a.m.)
> 
> 
> Review request for Aurora and Maxim Khutornenko.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Addressing TODO from build.gradle.
> 
> This change also causes two changes to existing generated classes:
> 
> - Accessor methods of type {List,Set,Map} now return Immutable{List,Set,Map}
> - isSet* methods are generated for all fields (not sure why this wasn't the case before)
> 
> Here's a full diff of generated sources after this change:
> $ for file in `find . -type f`; do   diff $file ../new/$file; done
> 117a118,121
> >   public boolean isSetCronCollisionPolicy() {
> >     return wrapped.isSetCronCollisionPolicy();
> >   }
> >
> 16,18d15
> < import java.util.Map;
> < import java.util.Set;
> <
> 197c194
> <   public Set<IConstraint> getConstraints() {
> ---
> >   public ImmutableSet<IConstraint> getConstraints() {
> 205c202
> <   public Set<String> getRequestedPorts() {
> ---
> >   public ImmutableSet<String> getRequestedPorts() {
> 213c210
> <   public Map<String, String> getTaskLinks() {
> ---
> >   public ImmutableMap<String, String> getTaskLinks() {
> 237c234
> <   public Set<IMetadata> getMetadata() {
> ---
> >   public ImmutableSet<IMetadata> getMetadata() {
> 84a85,88
> >   public boolean isSetValue() {
> >     return wrapped.isSetValue();
> >   }
> >
> 88a93,96
> >   public boolean isSetLimit() {
> >     return wrapped.isSetLimit();
> >   }
> >
> 16,17d15
> < import java.util.Set;
> <
> 99c97
> <   public Set<String> getValues() {
> ---
> >   public ImmutableSet<String> getValues() {
> 
> 
> Diffs
> -----
> 
>   build.gradle bcecb43308a654e79db5cbd0ba973b2410b00de9 
>   src/main/python/apache/aurora/tools/java/thrift_wrapper_codegen.py 9dc92fd486b1166bcf3d14b7806323002aa9f8d2 
> 
> Diff: https://reviews.apache.org/r/22998/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew build -Pq
> 
> 
> Thanks,
> 
> Bill Farner
> 
>