org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization Java Examples

The following examples show how to use org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization. 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: SerializationFactory.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Serializations are found by reading the <code>io.serializations</code>
 * property from <code>conf</code>, which is a comma-delimited list of
 * classnames.
 * </p>
 */
public SerializationFactory(Configuration conf) {
  super(conf);
  for (String serializerName : conf.getTrimmedStrings(
    CommonConfigurationKeys.IO_SERIALIZATIONS_KEY,
    new String[]{WritableSerialization.class.getName(),
      AvroSpecificSerialization.class.getName(),
      AvroReflectSerialization.class.getName()})) {
    add(conf, serializerName);
  }
}
 
Example #2
Source File: SerializationFactory.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Serializations are found by reading the <code>io.serializations</code>
 * property from <code>conf</code>, which is a comma-delimited list of
 * classnames.
 * </p>
 */
public SerializationFactory(Configuration conf) {
  super(conf);
  for (String serializerName : conf.getTrimmedStrings(
    CommonConfigurationKeys.IO_SERIALIZATIONS_KEY,
    new String[]{WritableSerialization.class.getName(),
      AvroSpecificSerialization.class.getName(),
      AvroReflectSerialization.class.getName()})) {
    add(conf, serializerName);
  }
}
 
Example #3
Source File: ProtobufSerialization.java    From hiped2 with Apache License 2.0 5 votes vote down vote up
public static void register(Configuration conf) {
  String[] serializations = conf.getStrings("io.serializations");
  if (ArrayUtils.isEmpty(serializations)) {
    serializations = new String[]{WritableSerialization.class.getName(),
        AvroSpecificSerialization.class.getName(),
        AvroReflectSerialization.class.getName()};
  }
  serializations = (String[]) ArrayUtils.add(serializations, ProtobufSerialization.class.getName());
  conf.setStrings("io.serializations", serializations);
}