public static Transcoder newTranscoder ( final BaseMemcachedProperties memcachedProperties , final Collection < Class > kryoSerializableClasses ) { switch ( StringUtils . trimToEmpty ( memcachedProperties . getTranscoder ( ) ) . toLowerCase ( ) ) { case "serial" : val serial = new SerializingTranscoder ( ) ; serial . setCompressionThreshold ( memcachedProperties . getTranscoderCompressionThreshold ( ) ) ; LOGGER . debug ( "Creating memcached transcoder [{}]" , serial . getClass ( ) . getName ( ) ) ; return serial ; case "whalin" : val whalin = new WhalinTranscoder ( ) ; whalin . setCompressionThreshold ( memcachedProperties . getTranscoderCompressionThreshold ( ) ) ; LOGGER . debug ( "Creating memcached transcoder [{}]" , whalin . getClass ( ) . getName ( ) ) ; return whalin ; case "whalinv1" : val whalinv1 = new WhalinV1Transcoder ( ) ; whalinv1 . setCompressionThreshold ( memcachedProperties . getTranscoderCompressionThreshold ( ) ) ; LOGGER . debug ( "Creating memcached transcoder [{}]" , whalinv1 . getClass ( ) . getName ( ) ) ; return whalinv1 ; case "kryo" : default : val kryoPool = new CasKryoPool ( kryoSerializableClasses , true , memcachedProperties . isKryoRegistrationRequired ( ) , memcachedProperties . isKryoObjectsByReference ( ) , memcachedProperties . isKryoAutoReset ( ) ) ; val kryo = new CasKryoTranscoder ( kryoPool ) ; LOGGER . debug ( "Creating memcached transcoder [{}]" , kryo . getClass ( ) . getName ( ) ) ; return kryo ; } }
New transcoder transcoder .