"Fossies" - the Fresh Open Source Software Archive

Member "keystone-17.0.0/keystone/conf/memcache.py" (13 May 2020, 2381 Bytes) of package /linux/misc/openstack/keystone-17.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "memcache.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 16.0.1_vs_17.0.0.

    1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    2 # not use this file except in compliance with the License. You may obtain
    3 # a copy of the License at
    4 #
    5 #      http://www.apache.org/licenses/LICENSE-2.0
    6 #
    7 # Unless required by applicable law or agreed to in writing, software
    8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   10 # License for the specific language governing permissions and limitations
   11 # under the License.
   12 
   13 from oslo_config import cfg
   14 from oslo_log import versionutils
   15 
   16 from keystone.conf import utils
   17 
   18 
   19 dead_retry = cfg.IntOpt(
   20     'dead_retry',
   21     default=5 * 60,
   22     help=utils.fmt("""
   23 Number of seconds memcached server is considered dead before it is tried again.
   24 This is used by the key value store system.
   25 """))
   26 
   27 socket_timeout = cfg.IntOpt(
   28     'socket_timeout',
   29     default=3,
   30     deprecated_for_removal=True,
   31     deprecated_reason='This option is duplicated with oslo.cache. '
   32                       'Configure ``keystone.conf [cache] '
   33                       'memcache_socket_timeout`` option to set the '
   34                       'socket_timeout of memcached instead. ',
   35     deprecated_since=versionutils.deprecated.TRAIN,
   36     help=utils.fmt("""
   37 Timeout in seconds for every call to a server. This is used by the key value
   38 store system.
   39 """))
   40 
   41 pool_maxsize = cfg.IntOpt(
   42     'pool_maxsize',
   43     default=10,
   44     help=utils.fmt("""
   45 Max total number of open connections to every memcached server. This is used by
   46 the key value store system.
   47 """))
   48 
   49 pool_unused_timeout = cfg.IntOpt(
   50     'pool_unused_timeout',
   51     default=60,
   52     help=utils.fmt("""
   53 Number of seconds a connection to memcached is held unused in the pool before
   54 it is closed. This is used by the key value store system.
   55 """))
   56 
   57 pool_connection_get_timeout = cfg.IntOpt(
   58     'pool_connection_get_timeout',
   59     default=10,
   60     help=utils.fmt("""
   61 Number of seconds that an operation will wait to get a memcache client
   62 connection. This is used by the key value store system.
   63 """))
   64 
   65 
   66 GROUP_NAME = __name__.split('.')[-1]
   67 ALL_OPTS = [
   68     dead_retry,
   69     socket_timeout,
   70     pool_maxsize,
   71     pool_unused_timeout,
   72     pool_connection_get_timeout,
   73 ]
   74 
   75 
   76 def register_opts(conf):
   77     conf.register_opts(ALL_OPTS, group=GROUP_NAME)
   78 
   79 
   80 def list_opts():
   81     return {GROUP_NAME: ALL_OPTS}