public static void addToHadoopConfiguration ( Configuration conf ) { final String SERIALIZATION_KEY = "io.serializations" ; String existingSerializers = conf . get ( SERIALIZATION_KEY ) ; if ( existingSerializers != null ) { conf . set ( SERIALIZATION_KEY , existingSerializers + "," + WritableShimSerialization . class . getName ( ) ) ; } else { conf . set ( SERIALIZATION_KEY , "org.apache.hadoop.io.serializer.WritableSerialization," + WritableShimSerialization . class . getName ( ) ) ; } }
Helper method to add this serializer to an existing Hadoop config .