[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13704750#comment-13704750 ] Hudson commented on AVRO-1261: -- Integrated in AvroJava #383 (See [https://builds.apache.org/job/AvroJava/383/]) AVRO-1261. Fix tests whose generated javadoc has changed. (Revision 1501842) AVRO-1261. Add missing escape that broke the build. Oops. (Revision 1501821) Result = SUCCESS cutting : Files : * /avro/trunk/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java * /avro/trunk/lang/java/tools/src/test/compiler/output/Player.java cutting : Files : * /avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Assignee: Doug Cutting >Priority: Minor > Fix For: 1.7.5 > > Attachments: AVRO-1261.patch > > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13704736#comment-13704736 ] ASF subversion and git services commented on AVRO-1261: --- Commit 1501842 from [~cutting] [ https://svn.apache.org/r1501842 ] AVRO-1261. Fix tests whose generated javadoc has changed. > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Assignee: Doug Cutting >Priority: Minor > Fix For: 1.7.5 > > Attachments: AVRO-1261.patch > > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13704704#comment-13704704 ] ASF subversion and git services commented on AVRO-1261: --- Commit 1501821 from [~cutting] [ https://svn.apache.org/r1501821 ] AVRO-1261. Add missing escape that broke the build. Oops. > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Assignee: Doug Cutting >Priority: Minor > Fix For: 1.7.5 > > Attachments: AVRO-1261.patch > > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13703937#comment-13703937 ] Hudson commented on AVRO-1261: -- Integrated in AvroJava #382 (See [https://builds.apache.org/job/AvroJava/382/]) AVRO-1261. Clarify in documentation that generated no-arg constructors do not use default values from schema. (Revision 1501581) Result = FAILURE cutting : Files : * /avro/trunk/CHANGES.txt * /avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Assignee: Doug Cutting >Priority: Minor > Fix For: 1.7.5 > > Attachments: AVRO-1261.patch > > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13703866#comment-13703866 ] ASF subversion and git services commented on AVRO-1261: --- Commit 1501581 from [~cutting] [ https://svn.apache.org/r1501581 ] AVRO-1261. Clarify in documentation that generated no-arg constructors do not use default values from schema. > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Assignee: Doug Cutting >Priority: Minor > Fix For: 1.7.5 > > Attachments: AVRO-1261.patch > > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645789#comment-13645789 ] Scott Carey commented on AVRO-1261: --- +1 > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Assignee: Doug Cutting >Priority: Minor > Fix For: 1.7.5 > > Attachments: AVRO-1261.patch > > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588699#comment-13588699 ] Christopher Conner commented on AVRO-1261: -- Thanks Doug, makes sense! I definitely think the documentation change would be nice. > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Priority: Minor > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (AVRO-1261) Honor schema defaults with the Constructor in addition to the builders.
[ https://issues.apache.org/jira/browse/AVRO-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588693#comment-13588693 ] Doug Cutting commented on AVRO-1261: The no-arg constructor is also used to create instances when reading. Setting field defaults in this case may harm performance, especially when new copies of mutable default values are allocated each time. Similarly, setting field values to defaults when writing may harm performance when the application overwrites the default. In general, there are cases where it's probably fastest to create instances without defaults set. Currently the no-arg constructor serves this purpose and the Builder API supports the case where defaults are desired. Perhaps we could better document this? The generated no-arg constructor might include javadoc cautioning that no default values are set and that the builder should be used if they're desired? > Honor schema defaults with the Constructor in addition to the builders. > --- > > Key: AVRO-1261 > URL: https://issues.apache.org/jira/browse/AVRO-1261 > Project: Avro > Issue Type: Bug > Components: java >Affects Versions: 1.7.4 >Reporter: Christopher Conner >Priority: Minor > > As I understand it, currently if you want to utilize defaults in a schema, ie: > { > "namespace": "com.chris.test", > "type": "record", > "name": "CHRISTEST", > "doc": "Chris Test", > "fields": [ > {"name": "firstname", "type": "string", "default": "Chris"}, > {"name": "lastname", "type": "string", "default": "Conner"}, > {"name": "username", "type": "string", "default": "cconner"} > ] > } > Then I have to use the builders to create my objects. IE: > public class ChrisAvroTest { > public static void main(String[] args) throws Exception { > CHRISTEST person = CHRISTEST.newBuilder() > .build(); > System.out.println("person:" + person); > } > } > Is my understanding correct? Is it possible to make it so the default > constructor as well? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira