Module Import alias Import alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias If BoolOpOr CompareEq Call AttributeLoad NameLoad attr Str CompareEq Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str Import alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Str NameLoad NameLoad NameLoad body If NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Str Str Assign AttributeStore NameLoad attr ListLoad If CompareIsNot NameLoad NameLoad body For NameStore Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr Print Str AttributeLoad NameLoad attr Print Str AttributeLoad NameLoad attr Print Str AttributeLoad NameLoad attr Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr attr If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareIn Str NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Num If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr orelse If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpAdd Str AttributeLoad NameLoad attr Str If AttributeLoad NameLoad attr body Print Str NameLoad orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Str If AttributeLoad NameLoad attr body Print Str NameLoad orelse Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num If CompareNotEq AttributeLoad NameLoad attr Str body Assign NameStore NameLoad While UnaryOpNot NameLoad body For NameStore AttributeLoad NameLoad attr body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If AttributeLoad NameLoad attr body Print Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body If AttributeLoad NameLoad attr body Print Str NameLoad Break orelse If AttributeLoad NameLoad attr body Print Str NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr NameLoad If AttributeLoad NameLoad attr body Print Str NameLoad Print Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Num For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad If AttributeLoad NameLoad attr body Print Str NameLoad If UnaryOpNot AttributeLoad NameLoad attr body For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr orelse While NameLoad body Assign NameStore NameLoad Assign NameStore Call NameLoad Num Call NameLoad NameLoad If AttributeLoad NameLoad attr body Print Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword Num keyword Num keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If AttributeLoad NameLoad attr body Print Str AttributeLoad NameLoad attr Assign NameStore NameLoad Break handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Continue If UnaryOpNot NameLoad body Print BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr Num decorator_list decorator_list FunctionDef arguments args defaults body Print Str Assign NameStore Call NameLoad keyword Num keyword Str Expr Call AttributeLoad NameLoad attr Print Str Assign NameStore Call NameLoad keyword Num keyword Str Expr Call AttributeLoad NameLoad attr Print Str Assign NameStore Call NameLoad keyword Num keyword Str Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A os N/A sys random randrange N/A platform N/A site N/A redis N/A time N/A signal N/A N/A N/A N/A N/A platform machine sun4v N/A N/A N/A platform machine sun4u N/A N/A N/A N/A site addsitedir /export/apps/amfstats/lib/python2.6/site-packages N/A N/A N/A N/A site addsitedir /usr/local/linkedin/lib/python2.6/site-packages N/A seco.range timeout_exception N/A Exception N/A N/A N/A RedisFinder N/A N/A N/A 
    scope can be set to 3 different levels.
    local (default) = query only the MPS local to this machine (primary mps) -- this should already be balanced via select_class in cfe.
    site = query all cores for a given datacenter.  some datacenters will only have one core.  other sites can have 10x cores.
    global = query all cores at all sites (expensive)
     __init__ N/A N/A self verbose scope site range_servers return_randomized_servers N/A 0 local None None True N/A N/A scope N/A N/A N/A self _scope scope N/A N/A N/A self _scope local N/A N/A self _redis_corelist N/A N/A N/A self _site site N/A N/A self _return_randomized_servers return_randomized_servers N/A N/A self _cm_conf N/A open /etc/cm.conf r N/A N/A self _range_servers N/A N/A N/A range_servers None N/A N/A rs N/A N/A range_servers split , N/A N/A N/A N/A N/A self _range_servers append rs N/A N/A self _verbose verbose N/A N/A self _verbose N/A N/A (+) RedisFinder __init__ scope N/A self _scope N/A (+) RedisFinder __init__  redis_corelist N/A self _redis_corelist N/A (+) RedisFinder __init__  site N/A self _site N/A (+) RedisFinder __init__  cm.conf N/A self _cm_conf N/A (+) RedisFinder __init__  range_servers N/A self _range_servers N/A timeout_handler N/A N/A signum frame N/A N/A N/A N/A timeout_exception N/A get_verbose N/A N/A self N/A N/A N/A N/A self _verbose N/A set_verbose N/A N/A self verbose N/A N/A N/A N/A self _verbose verbose N/A N/A self _verbose N/A N/A (+) RedisFinder.set_verbose() is being set to N/A self _verbose N/A get_scope N/A N/A self N/A N/A N/A N/A self _scope N/A set_scope N/A N/A self scope N/A N/A N/A N/A self _scope scope N/A N/A self _verbose N/A N/A (+) RedisFinder.set_scope() is being set to N/A self _scope N/A get_return_randomized_servers N/A N/A self N/A N/A N/A N/A self _return_randomized_servers N/A set_return_randomized_servers N/A N/A self return_randomized_servers N/A N/A N/A N/A self _return_randomized_servers return_randomized_servers N/A N/A self _verbose N/A N/A (+) RedisFinder.set_return_randomized_servers() is being set to return_randomized_servers N/A get_site N/A N/A self N/A N/A N/A N/A self _site N/A set_site N/A N/A self site N/A N/A N/A N/A self _site site N/A N/A self _verbose N/A N/A (+) RedisFinder.set_site() is being set to site N/A discover_site N/A N/A self N/A N/A N/A N/A N/A N/A self _cm_conf seek 0 N/A line N/A N/A N/A self _cm_conf readlines N/A N/A N/A ENV_SITE line N/A N/A N/A self _site N/A N/A N/A N/A N/A N/A N/A line split @ N/A 1 lower rstrip N/A N/A self _verbose N/A N/A (+) RedisFinder.discover_site() is being set to N/A self _site N/A get_range_servers N/A N/A self N/A N/A N/A N/A self _range_servers N/A set_range_servers N/A N/A self range_servers N/A N/A N/A N/A self _range_servers range_servers N/A N/A self _verbose N/A N/A (+) RedisFinder.set_range_servers() is being set to N/A self _range_servers N/A discover_range_servers N/A N/A self N/A N/A N/A N/A N/A N/A self _cm_conf seek 0 N/A line N/A N/A N/A self _cm_conf readlines N/A N/A N/A MPS line N/A N/A N/A N/A N/A self _range_servers append N/A N/A N/A N/A N/A line split : N/A 1 rstrip N/A N/A self _verbose N/A N/A (+) RedisFinder.discover_range_servers() is being set to N/A self _range_servers N/A get_redis_corelist N/A N/A self N/A N/A N/A N/A self _redis_corelist N/A set_redis_corelist N/A N/A self redis_corelist N/A N/A N/A N/A self _redis_corelist redis_corelist N/A N/A self _verbose N/A N/A (+) RedisFinder.set_redis_corelist() redis_corelist being set to N/A slef _redis_corelist N/A query_range_for_redis_corelist N/A N/A self N/A N/A N/A 
        If we make a successful range query, then break out of the loop as there is no point to query range multiple times.
        We provide the loop here so if the first range server is down, hopefully the latter will succeed.
        If "site" isn't provided, but the scope is set to site, we assume the local datacenter that the query is occuring from.

        A single deference to *-mps-cores returns the cores for that site.  A double deference to *-mps-cores returns the actual redis
        servers for that site.  i.e.
        msvoboda-mn:trunk msvoboda$ eh -e %cf3.promises.esv4-mps-cores
        cf3.promises.esv4-2360-mps

        msvoboda-mn:trunk msvoboda$ eh -e %%cf3.promises.esv4-mps-cores
        esv4-2360-mps01.corp.linkedin.com
        esv4-2360-mps02.corp.linkedin.com
        esv4-cfe-test.corp.linkedin.com
         N/A N/A N/A self _range_servers N/A N/A N/A N/A self discover_range_servers N/A N/A N/A self _scope local N/A N/A N/A N/A N/A self _redis_corelist append N/A N/A self _range_servers N/A 0 N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() setting redis_corelist to N/A self _redis_corelist N/A N/A N/A N/A self _scope site N/A N/A N/A N/A self _site N/A N/A N/A N/A self discover_site N/A N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() self._site is set to N/A self _site N/A range_query N/A N/A %cf3.promises. N/A self _site -mps-cores N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() range_query is set to range_query N/A N/A N/A N/A self _scope global N/A N/A range_query %cf3.promises.all-mps-cores N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() range_query is set to range_query N/A N/A N/A self _redis_corelist None N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() undefined scope N/A self _scope N/A N/A N/A sys exit 1 N/A N/A N/A self _scope local N/A N/A total_redis_corelist None N/A N/A total_redis_corelist N/A N/A range_server N/A self _range_servers N/A N/A N/A N/A range_connection N/A N/A N/A seco range Range range_server N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() making a range connection to range_server N/A total_redis_corelist N/A N/A range_connection expand range_query N/A total_redis_corelist N/A N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() total redis corelist is total_redis_corelist N/A N/A N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() no redis corelist was returned from range server range_server N/A N/A N/A N/A N/A seco range RangeException N/A N/A N/A self _redis_corelist None N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() range exception returned from range server range_server N/A (+) RedisFinder.query_range_for_redis_corelist() attempting to query the next range server N/A N/A total_redis_corelist N/A N/A N/A N/A sys exit 1 N/A single_redis_core total_redis_corelist N/A N/A redis_servers_single_core N/A N/A range_connection expand N/A % single_redis_core N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() redis servers single core is  redis_servers_single_core N/A N/A N/A self _return_randomized_servers N/A N/A single_redis_server redis_servers_single_core N/A N/A N/A N/A N/A self _redis_corelist append single_redis_server N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() pushed redis server is  N/A self _redis_corelist N/A N/A redis_servers_single_core N/A N/A corelist_valid False N/A random_redis_server_index N/A randrange 0 N/A len redis_servers_single_core N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() random_redis_server_index is  random_redis_server_index N/A redis_server N/A N/A redis_servers_single_core pop random_redis_server_index N/A N/A N/A redis_connection N/A N/A redis Redis host redis_server port 6379 db 0 socket_timeout 1 charset utf-8 errors strict N/A redis_info N/A N/A redis_connection info N/A redis_info N/A N/A N/A N/A N/A self _redis_corelist append redis_server N/A N/A self _verbose N/A N/A (+) RedisFinder.query_range_for_redis_corelist() pushed redis server is  N/A self _redis_corelist N/A corelist_valid True N/A N/A N/A N/A N/A N/A redis exceptions ConnectionError N/A N/A N/A N/A corelist_valid N/A N/A N/A N/A (+) RedisFinder.query_range_for_redis_corelist() All redis servers in  single_redis_core  were unresponsive.  Its possible that you are being firewalled by Network ACLs.  Please attempt to run this utility from a production host, which should have network connectivity to all the Redis servers. This utility is exiting, as the results would be from an incomplete dataset. N/A N/A N/A sys exit 1 N/A N/A main N/A N/A N/A N/A N/A local scope N/A redisResults N/A RedisFinder verbose 1 scope local N/A N/A N/A redisResults query_range_for_redis_corelist N/A site scope N/A redisResults N/A RedisFinder verbose 1 scope site N/A N/A N/A redisResults query_range_for_redis_corelist N/A global scope N/A redisResults N/A RedisFinder verbose 1 scope global N/A N/A N/A redisResults query_range_for_redis_corelist N/A N/A N/A __name__ __main__ N/A N/A N/A main