zoukankan      html  css  js  c++  java
  • spymemcache与spring结合

    <bean id="memcachedClient" class="net.spy.memcached.spring.MemcachedClientFactoryBean">
        <property name="servers" value="host1:11211,host2:11211,host3:11211"/>
        <property name="protocol" value="BINARY"/>
        <property name="transcoder">
          <bean class="net.spy.memcached.transcoders.SerializingTranscoder">
            <property name="compressionThreshold" value="1024"/>
          </bean>
        </property>
        <property name="opTimeout" value="1000"/>
        <property name="timeoutExceptionThreshold" value="1998"/>
        <property name="hashAlg" value="KETAMA_HASH"/>
        <property name="locatorType" value="CONSISTENT"/> 
        <property name="failureMode" value="Redistribute"/>
        <property name="useNagleAlgorithm" value="false"/>
      </bean>

    相关参数介绍:

    The MemcachedClientFactoryBean supports the same set of attributes as the net.spy.memcached.ConnectionFactoryBuilder and supplies the exact same semantics:

    Servers

    A string containing whitespace or comma separated host or IP addresses and port numbers of the form "host:port host2:port" or "host:port, host2:port".

    Daemon

    Set the daemon state of the IO thread (defaults to true).

    FailureMode

    Set the failure mode {Cancel | Redistribute | Retry} (defaults to Redistribute).

    HashAlg

    Set the hash algorithm (see net.spy.memcached.HashAlgorithm for the values).

    InitialObservers

    Set the initial connection observers (will observe initial connection).

    LocatorType

    Set the locator type {ARRAY_MOD | CONSISTENT} (defaults to ARRAY_MOD).

    MaxReconnectDelay

    Set the maximum reconnect delay.

    OpFact

    Set the operation factory.

    OpQueueFactory

    Set the operation queue factory.

    OpTimeout

    Set the default operation timeout in milliseconds.

    Protocol

    Convenience method to specify the protocol to use {BINARY | TEXT} (defaults to TEXT).

    ReadBufferSize

    Set the read buffer size.

    ReadOpQueueFactory

    Set the read queue factory.

    ShouldOptimize

    Set to false if the default operation optimization is not desirable (defaults to true).

    Transcoder

    Set the default transcoder (defaults to net.spy.memcached.transcoders.SerializingTranscoder).

    UseNagleAlgorithm

    Set to true if you'd like to enable the Nagle algorithm.

    WriteOpQueueFactory

    Set the write queue factory.

    AuthDescriptor

    Set the auth descriptor to enable authentication on new connections.

  • 相关阅读:
    LeetCode.5-最长回文子串(Longest Palindromic Substring)
    LeetCode.3-最长无重复字符子串(Longest Substring Without Repeating Characters)
    2013 最新的 play web framework 版本 1.2.3 框架学习文档整理
    play framework学习笔记之 模板引擎
    C# 枚举、字符串、值的相互转换
    styleCop
    配置VS代码生成工具ReSharper快捷键
    StackOverflow Update: 560M Pageviews A Month, 25 Servers, And It's All About Performance
    开启Windows Server 2008 R2上帝模式
    微信支付实战(与支付宝和其他一些支付有些不一样)
  • 原文地址:https://www.cnblogs.com/atyou/p/2840458.html
Copyright © 2011-2022 走看看