I am using avro-maven-plugin 1.8.1 to generate java code from schema,and all the fields are public and deprecated,like this:
public class data_elements extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = 2829359487251568000L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("......");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.lang.CharSequence timestamp;
@Deprecated public double value;
@Deprecated public java.lang.CharSequence op;
...
}
It makes confused and uncomfortable, does anyone know why it is like that?
Avro has a JSON like data model, but can be represented as either JSON or in a compact binary form. It comes with a very sophisticated schema description language that describes data. We think Avro is the best choice for a number of reasons: It has a direct mapping to and from JSON.
Avro is a language independent, schema-based data serialization library. It uses a schema to perform serialization and deserialization. Moreover, Avro uses a JSON format to specify the data structure which makes it more powerful.
@johndcal A namespace is not required within the avro schema source in Schema Registry.
If you pass in the fieldVisibility=private
parameter then the @Deprecated
should disappear and your fields will be private.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With