Java Code Examples for org.apache.avro.Schema#getJsonProps()

The following examples show how to use org.apache.avro.Schema#getJsonProps() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AvroUtils.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
/***
 * Copy properties from old Avro Schema to new Avro Schema
 * @param oldSchema Old Avro Schema to copy properties from
 * @param newSchema New Avro Schema to copy properties to
 */
private static void copyProperties(Schema oldSchema, Schema newSchema) {
  Preconditions.checkNotNull(oldSchema);
  Preconditions.checkNotNull(newSchema);

  Map<String, JsonNode> props = oldSchema.getJsonProps();
  copyProperties(props, newSchema);
}
 
Example 2
Source File: AvroFlattener.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
/***
 * Copy properties from old Avro Schema to new Avro Schema
 * @param oldSchema Old Avro Schema to copy properties from
 * @param newSchema New Avro Schema to copy properties to
 */
private static void copyProperties(Schema oldSchema, Schema newSchema) {
  Preconditions.checkNotNull(oldSchema);
  Preconditions.checkNotNull(newSchema);

  Map<String, JsonNode> props = oldSchema.getJsonProps();
  copyProperties(props, newSchema);
}