public static void enableSerialization ( Configuration conf ) { String serClass = TupleSerialization . class . getName ( ) ; Collection < String > currentSers = conf . getStringCollection ( "io.serializations" ) ; if ( currentSers . size ( ) == 0 ) { conf . set ( "io.serializations" , serClass ) ; return ; } // Check if it is already present if ( ! currentSers . contains ( serClass ) ) { currentSers . add ( serClass ) ; conf . setStrings ( "io.serializations" , currentSers . toArray ( new String [ ] { } ) ) ; } }
Use this method to enable this serialization in Hadoop