/** * <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); if (conf.get(CommonConfigurationKeys.IO_SERIALIZATIONS_KEY).equals("")) { LOG.warn("Serialization for various data types may not be available. Please configure " + CommonConfigurationKeys.IO_SERIALIZATIONS_KEY + " properly to have serialization support (it is currently not set)."); } else { for (String serializerName : conf.getTrimmedStrings( CommonConfigurationKeys.IO_SERIALIZATIONS_KEY, new String[] { WritableSerialization.class.getName(), AvroSpecificSerialization.class.getName(), AvroReflectSerialization.class.getName() })) { add(conf, serializerName); } } }
/** * <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); } }
/** * <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.getStrings( CommonConfigurationKeys.IO_SERIALIZATIONS_KEY, new String[]{WritableSerialization.class.getName(), AvroSpecificSerialization.class.getName(), AvroReflectSerialization.class.getName()})) { add(conf, serializerName); } }
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); }