Package org.apache.avro.specific

Examples of org.apache.avro.specific.SpecificData$SchemaConstructable


  @Override
  public void setSchema(Schema actual) {
    // if expected is unset and actual is a specific record,
    // then default expected to schema of currently loaded class
    if (schema == null && actual != null && actual.getType() == Schema.Type.RECORD) {
      SpecificData data = getSpecificData();
      Class c = data.getClass(actual);
      if (c != null && SpecificRecord.class.isAssignableFrom(c)) {
        schema = data.getSchema(c);
      }
    }
    if (schema == null) {
      schema = actual;
    }
View Full Code Here


   */
  public static <E> GenericData getDataModelForType(Class<E> type) {
    // Need to check if SpecificRecord first because specific records also
    // implement GenericRecord
    if (SpecificRecord.class.isAssignableFrom(type)) {
      return new SpecificData(type.getClassLoader());
    } else if (IndexedRecord.class.isAssignableFrom(type)) {
      return GenericData.get();
    } else {
      return AllowNulls.get();
    }
View Full Code Here

public class SpecificRequestor extends Requestor implements InvocationHandler {
  SpecificData data;

  public SpecificRequestor(Class<?> iface, Transceiver transceiver)
    throws IOException {
    this(iface, transceiver, new SpecificData(iface.getClassLoader()));
  }
View Full Code Here

  /** Create a proxy instance whose methods invoke RPCs. */
  public static  <T> T getClient(Class<T> iface, Transceiver transciever)
    throws IOException {
    return getClient(iface, transciever,
                     new SpecificData(iface.getClassLoader()));
  }
View Full Code Here

TOP

Related Classes of org.apache.avro.specific.SpecificData$SchemaConstructable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.