protected ConnectionFactoryBuilder createConnectionFactoryBuilder ( OverridableReadOnlyProperties properties ) { ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder ( ) ; // BINARY Only!!! spymemcached incr/decr correctly supports only BINARY mode. builder . setProtocol ( ConnectionFactoryBuilder . Protocol . BINARY ) ; builder . setLocatorType ( ConnectionFactoryBuilder . Locator . CONSISTENT ) ; builder . setUseNagleAlgorithm ( false ) ; builder . setFailureMode ( FailureMode . Redistribute ) ; String hashAlgorithmProeprty = properties . getRequiredProperty ( HASH_ALGORITHM_PROPERTY_KEY ) ; builder . setHashAlg ( DefaultHashAlgorithm . valueOf ( hashAlgorithmProeprty ) ) ; String operationTimeoutProperty = properties . getRequiredProperty ( OPERATION_TIMEOUT_MILLIS_PROPERTY_KEY ) ; builder . setOpTimeout ( Long . parseLong ( operationTimeoutProperty ) ) ; String transcoderClassProperty = properties . getRequiredProperty ( TRANSCODER_PROPERTY_KEY ) ; builder . setTranscoder ( createTranscoder ( properties , transcoderClassProperty ) ) ; authenticate ( builder , properties ) ; return builder ; }
creating ConnectionFactoryBuilder object . Override thid method if you need .