[
https://issues.apache.org/jira/browse/AVRO-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Philip Zeyliger updated AVRO-154:
---------------------------------
Attachment: AVRO-154.patch.txt
1-line change to previous patch to get the singleton ReflectData instead of
constructing a new one.
{noformat}
[0]doorstop:induce:avro(213828)$git show
commit aa3c28c9ba2fc058fcd4b275eeff80090c54e8fc
Author: Philip Zeyliger <[email protected]>
Date: Fri Oct 16 15:26:52 2009 -0700
Grabbing singleton instance of ReflectData.
diff --git a/src/java/org/apache/avro/reflect/InduceSchemaTool.java
b/src/java/org/apache/avro/reflect/InduceSchemaTool.java
index de6121f..4245dff 100644
--- a/src/java/org/apache/avro/reflect/InduceSchemaTool.java
+++ b/src/java/org/apache/avro/reflect/InduceSchemaTool.java
@@ -54,6 +54,6 @@ public class InduceSchemaTool implements Tool {
}
Class<?> klass = classLoader.loadClass(className);
- System.out.println(new ReflectData().getSchema(klass).toString());
+ System.out.println(ReflectData.get().getSchema(klass).toString());
}
}
{noformat}
> Tool to induce schema using reflection
> --------------------------------------
>
> Key: AVRO-154
> URL: https://issues.apache.org/jira/browse/AVRO-154
> Project: Avro
> Issue Type: New Feature
> Reporter: Philip Zeyliger
> Assignee: Philip Zeyliger
> Attachments: AVRO-154.patch.txt, AVRO-154.patch.txt
>
>
> Patch that follows gives command-line access to ReflectData's getSchema()
> API, which creates an AVRO schema based on reflection.
> Here's an example:
> {noformat}
> $ src/scripts/avroj.sh induce build/test/classes org.apache.avro.BarRecord
>
> {"type":"record","name":"BarRecord","namespace":"org.apache.avro","fields":[{"name":"beerMsg","type":"string"}]}
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.