packages feed

memcache-0.5.0.0: test/KetamaVectors.hs

-- | Server choices made by the real libmemcached, for checking that our ring
-- routes every key the same way.
--
-- Generated with libmemcached-awesome 1.1.4 (commit aafec5e) with
-- @MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED@ set, by asking
-- @memcached_generate_hash@ for each key. The weighted keys and the
-- @VDEAAAAA@ wrap-around case are libmemcached's own test fixture
-- (@test/fixtures/ketama.hpp@).
module KetamaVectors (Scenario, scenarios) where

-- | A name, the servers as (host, port, weight) in configured order, and each
-- key with the @host:port@ libmemcached chose for it.
type Scenario = (String, [(String, Int, Int)], [(String, String)])

scenarios :: [Scenario]
scenarios =
  [ ( "fixture8_weighted"
    , [("10.0.1.1", 11211, 600), ("10.0.1.2", 11211, 300), ("10.0.1.3", 11211, 200), ("10.0.1.4", 11211, 350), ("10.0.1.5", 11211, 1000), ("10.0.1.6", 11211, 800), ("10.0.1.7", 11211, 950), ("10.0.1.8", 11211, 100)]
    ,
      [ ("SVa_]_V41)", "10.0.1.7:11211")
      , ("*/Z;?V(.\\8", "10.0.1.1:11211")
      , ("30C1*Z*S/_", "10.0.1.2:11211")
      , ("ERR:EC58G>", "10.0.1.7:11211")
      , ("1I=cTMNTKF", "10.0.1.5:11211")
      , ("]VG<`I*Z8)", "10.0.1.5:11211")
      , ("UUTC`-V159", "10.0.1.5:11211")
      , ("@7RU6C6T+Z", "10.0.1.5:11211")
      , ("/XLN0@+36;", "10.0.1.1:11211")
      , ("4(`X;\\V.^c", "10.0.1.1:11211")
      , ("726bW=9*a4", "10.0.1.7:11211")
      , ("\\`)<B)UE,c", "10.0.1.1:11211")
      , ("P1[Ma3=K1/", "10.0.1.8:11211")
      , ("C89I.-V?cT", "10.0.1.8:11211")
      , ("D[HE+cFXDK", "10.0.1.3:11211")
      , ("P1L?NAB[)K", "10.0.1.1:11211")
      , ("cDT0)Z5P6,", "10.0.1.5:11211")
      , ("@JW`+[WAO8", "10.0.1.5:11211")
      , ("\\39DKW^)N_", "10.0.1.3:11211")
      , ("EM75N0+[X1", "10.0.1.4:11211")
      , ("`,SS]NBP,b", "10.0.1.1:11211")
      , ("XX1a9LT+F?", "10.0.1.5:11211")
      , ("Zc\\-,F-c6V", "10.0.1.5:11211")
      , ("1*RTMC7,03", "10.0.1.8:11211")
      , ("*Xc+V0P>32", "10.0.1.7:11211")
      , ("U))Fb-(`,.", "10.0.1.7:11211")
      , ("R-08RNTaRT", "10.0.1.5:11211")
      , ("(LHcO203I3", "10.0.1.5:11211")
      , ("=256P+;Qc8", "10.0.1.5:11211")
      , ("OI5XZ_BBT(", "10.0.1.7:11211")
      , ("2TLRL/UL;:", "10.0.1.7:11211")
      , ("WHD\\O1`ZRW", "10.0.1.5:11211")
      , (".=54)_c;=T", "10.0.1.1:11211")
      , (";G<W-XWZ@b", "10.0.1.5:11211")
      , ("(,>E`)FT\\4", "10.0.1.2:11211")
      , ("HZAU*;P*N]", "10.0.1.7:11211")
      , ("NZ@ZE=O84_", "10.0.1.7:11211")
      , ("6,cEI`F_P>", "10.0.1.6:11211")
      , ("c,5AQ/T5)6", "10.0.1.8:11211")
      , (".O,>>BT)RX", "10.0.1.5:11211")
      , ("XY\\X::LX50", "10.0.1.6:11211")
      , ("+550F^/.01", "10.0.1.6:11211")
      , ("<.X9E2S5+9", "10.0.1.7:11211")
      , ("]\\.UH8_0a1", "10.0.1.4:11211")
      , ("8(6=(T0/Z0", "10.0.1.7:11211")
      , ("8*6a;Sc*X+", "10.0.1.2:11211")
      , ("<QW:;3K6;H", "10.0.1.5:11211")
      , ("7C@EY@-Y?_", "10.0.1.5:11211")
      , ("aPb3E1WD4K", "10.0.1.1:11211")
      , ("?@12R<=1BH", "10.0.1.8:11211")
      , ("QR(a+Q=1FU", "10.0.1.6:11211")
      , ("`C9^FV,960", "10.0.1.6:11211")
      , ("UNHVP..^8H", "10.0.1.4:11211")
      , (":Y.2W2[(35", "10.0.1.7:11211")
      , ("M/HV^_HZ4O", "10.0.1.7:11211")
      , ("ZY16KQ<ICD", "10.0.1.4:11211")
      , ("bV2,`a.PY9", "10.0.1.1:11211")
      , ("U;9:-+5N]9", "10.0.1.1:11211")
      , ("1S/:aJ[1(;", "10.0.1.2:11211")
      , ("Nb-X^]M)I:", "10.0.1.6:11211")
      , ("2;M;ES>J5/", "10.0.1.7:11211")
      , ("[>RZHG97Q9", "10.0.1.6:11211")
      , ("J3/G[)9<^Z", "10.0.1.7:11211")
      , ("N-)88>[O`,", "10.0.1.5:11211")
      , ("NP:=FR\\OaA", "10.0.1.7:11211")
      , ("`@L+W;a,O[", "10.0.1.6:11211")
      , ("W2`P:-+1T[", "10.0.1.5:11211")
      , ("-6G7K^YDIN", "10.0.1.7:11211")
      , ("U>*>9ZI6V5", "10.0.1.6:11211")
      , (".I?^6Ic9RK", "10.0.1.6:11211")
      , ("0OZH^9BKM[", "10.0.1.8:11211")
      , ("5?50UGZ:ML", "10.0.1.5:11211")
      , ("?K2NF@3=IU", "10.0.1.1:11211")
      , ("YI@G-2X?UB", "10.0.1.5:11211")
      , ("7cY</BSaL=", "10.0.1.6:11211")
      , ("A(`KF:[RH8", "10.0.1.6:11211")
      , (";=ZT\\W^P+H", "10.0.1.4:11211")
      , ("b2?WFF56;R", "10.0.1.4:11211")
      , ("CTR74,J+N.", "10.0.1.8:11211")
      , ("<b;*R+QDST", "10.0.1.5:11211")
      , ("\\R^7=9UCG`", "10.0.1.5:11211")
      , ("1bQS5]WOXB", "10.0.1.4:11211")
      , ("M(@X^b[L:K", "10.0.1.1:11211")
      , ("431cBF8,YO", "10.0.1.7:11211")
      , ("(bEIQJ:E./", "10.0.1.6:11211")
      , ("WS/3H*)7F;", "10.0.1.5:11211")
      , ("ZJF[Ia6Q)+", "10.0.1.7:11211")
      , ("<]*QCK8U,>", "10.0.1.7:11211")
      , ("\\[a\\^=V_M0", "10.0.1.6:11211")
      , ("7;RM+8J9YC", "10.0.1.7:11211")
      , ("4*=.SPR[AV", "10.0.1.1:11211")
      , ("-2F+^88P4U", "10.0.1.7:11211")
      , ("X;-F`(N?9D", "10.0.1.7:11211")
      , ("R=F_D-K2a]", "10.0.1.7:11211")
      , ("X*+2aaC.EG", "10.0.1.5:11211")
      , ("[1ZXONX2]a", "10.0.1.4:11211")
      , ("FL;\\GWacaV", "10.0.1.4:11211")
      , ("\\MQ_XNT7L-", "10.0.1.7:11211")
      , ("VD6D0]ba_\\", "10.0.1.1:11211")
      , ("VDEAAAAA", "10.0.1.3:11211")
      ]
    )
  , ( "eq3_mixed_ports"
    , [("10.0.0.1", 11211, 1), ("10.0.0.2", 11211, 1), ("10.0.0.3", 11212, 1)]
    ,
      [ ("a", "10.0.0.2:11211")
      , ("b", "10.0.0.2:11211")
      , ("c", "10.0.0.1:11211")
      , ("foo", "10.0.0.2:11211")
      , ("bar", "10.0.0.2:11211")
      , ("baz", "10.0.0.1:11211")
      , ("hello", "10.0.0.2:11211")
      , ("world", "10.0.0.3:11212")
      , ("user:1", "10.0.0.2:11211")
      , ("user:2", "10.0.0.2:11211")
      , ("user:3", "10.0.0.1:11211")
      , ("user:42", "10.0.0.1:11211")
      , ("session:abcdef", "10.0.0.3:11212")
      , ("counter", "10.0.0.3:11212")
      , ("memcache-hs", "10.0.0.3:11212")
      , ("key1", "10.0.0.3:11212")
      , ("key2", "10.0.0.1:11211")
      , ("key3", "10.0.0.2:11211")
      , ("key4", "10.0.0.1:11211")
      , ("0", "10.0.0.3:11212")
      , ("1", "10.0.0.3:11212")
      , ("2", "10.0.0.3:11212")
      , ("3", "10.0.0.2:11211")
      , ("4", "10.0.0.3:11212")
      , ("5", "10.0.0.2:11211")
      , ("6", "10.0.0.2:11211")
      , ("7", "10.0.0.1:11211")
      , ("8", "10.0.0.1:11211")
      , ("9", "10.0.0.1:11211")
      , ("10", "10.0.0.2:11211")
      ]
    )
  , ( "host4"
    , [("cache1.example.com", 11211, 1), ("cache2.example.com", 11211, 1), ("cache3.example.com", 11211, 1), ("cache4.example.com", 11211, 1)]
    ,
      [ ("a", "cache2.example.com:11211")
      , ("b", "cache4.example.com:11211")
      , ("c", "cache1.example.com:11211")
      , ("foo", "cache2.example.com:11211")
      , ("bar", "cache3.example.com:11211")
      , ("baz", "cache4.example.com:11211")
      , ("hello", "cache4.example.com:11211")
      , ("world", "cache4.example.com:11211")
      , ("user:1", "cache4.example.com:11211")
      , ("user:2", "cache3.example.com:11211")
      , ("user:3", "cache4.example.com:11211")
      , ("user:42", "cache3.example.com:11211")
      , ("session:abcdef", "cache4.example.com:11211")
      , ("counter", "cache4.example.com:11211")
      , ("memcache-hs", "cache2.example.com:11211")
      , ("key1", "cache2.example.com:11211")
      , ("key2", "cache1.example.com:11211")
      , ("key3", "cache3.example.com:11211")
      , ("key4", "cache3.example.com:11211")
      , ("0", "cache1.example.com:11211")
      , ("1", "cache1.example.com:11211")
      , ("2", "cache2.example.com:11211")
      , ("3", "cache3.example.com:11211")
      , ("4", "cache2.example.com:11211")
      , ("5", "cache3.example.com:11211")
      , ("6", "cache4.example.com:11211")
      , ("7", "cache3.example.com:11211")
      , ("8", "cache2.example.com:11211")
      , ("9", "cache1.example.com:11211")
      , ("10", "cache1.example.com:11211")
      ]
    )
  , ( "host4_minus_cache3"
    , [("cache1.example.com", 11211, 1), ("cache2.example.com", 11211, 1), ("cache4.example.com", 11211, 1)]
    ,
      [ ("a", "cache2.example.com:11211")
      , ("b", "cache4.example.com:11211")
      , ("c", "cache1.example.com:11211")
      , ("foo", "cache2.example.com:11211")
      , ("bar", "cache1.example.com:11211")
      , ("baz", "cache4.example.com:11211")
      , ("hello", "cache4.example.com:11211")
      , ("world", "cache4.example.com:11211")
      , ("user:1", "cache4.example.com:11211")
      , ("user:2", "cache2.example.com:11211")
      , ("user:3", "cache4.example.com:11211")
      , ("user:42", "cache1.example.com:11211")
      , ("session:abcdef", "cache4.example.com:11211")
      , ("counter", "cache4.example.com:11211")
      , ("memcache-hs", "cache2.example.com:11211")
      , ("key1", "cache2.example.com:11211")
      , ("key2", "cache1.example.com:11211")
      , ("key3", "cache1.example.com:11211")
      , ("key4", "cache2.example.com:11211")
      , ("0", "cache1.example.com:11211")
      , ("1", "cache1.example.com:11211")
      , ("2", "cache2.example.com:11211")
      , ("3", "cache1.example.com:11211")
      , ("4", "cache2.example.com:11211")
      , ("5", "cache2.example.com:11211")
      , ("6", "cache4.example.com:11211")
      , ("7", "cache4.example.com:11211")
      , ("8", "cache2.example.com:11211")
      , ("9", "cache1.example.com:11211")
      , ("10", "cache1.example.com:11211")
      ]
    )
  , ( "eq25"
    , [("10.0.0.1", 11211, 1), ("10.0.0.2", 11211, 1), ("10.0.0.3", 11211, 1), ("10.0.0.4", 11211, 1), ("10.0.0.5", 11211, 1), ("10.0.0.6", 11211, 1), ("10.0.0.7", 11211, 1), ("10.0.0.8", 11211, 1), ("10.0.0.9", 11211, 1), ("10.0.0.10", 11211, 1), ("10.0.0.11", 11211, 1), ("10.0.0.12", 11211, 1), ("10.0.0.13", 11211, 1), ("10.0.0.14", 11211, 1), ("10.0.0.15", 11211, 1), ("10.0.0.16", 11211, 1), ("10.0.0.17", 11211, 1), ("10.0.0.18", 11211, 1), ("10.0.0.19", 11211, 1), ("10.0.0.20", 11211, 1), ("10.0.0.21", 11211, 1), ("10.0.0.22", 11211, 1), ("10.0.0.23", 11211, 1), ("10.0.0.24", 11211, 1), ("10.0.0.25", 11211, 1)]
    ,
      [ ("a", "10.0.0.4:11211")
      , ("b", "10.0.0.16:11211")
      , ("c", "10.0.0.15:11211")
      , ("foo", "10.0.0.19:11211")
      , ("bar", "10.0.0.8:11211")
      , ("baz", "10.0.0.25:11211")
      , ("hello", "10.0.0.21:11211")
      , ("world", "10.0.0.9:11211")
      , ("user:1", "10.0.0.16:11211")
      , ("user:2", "10.0.0.6:11211")
      , ("user:3", "10.0.0.18:11211")
      , ("user:42", "10.0.0.1:11211")
      , ("session:abcdef", "10.0.0.13:11211")
      , ("counter", "10.0.0.19:11211")
      , ("memcache-hs", "10.0.0.19:11211")
      , ("key1", "10.0.0.5:11211")
      , ("key2", "10.0.0.12:11211")
      , ("key3", "10.0.0.3:11211")
      , ("key4", "10.0.0.7:11211")
      , ("0", "10.0.0.5:11211")
      , ("1", "10.0.0.4:11211")
      , ("2", "10.0.0.15:11211")
      , ("3", "10.0.0.16:11211")
      , ("4", "10.0.0.12:11211")
      , ("5", "10.0.0.25:11211")
      , ("6", "10.0.0.21:11211")
      , ("7", "10.0.0.1:11211")
      , ("8", "10.0.0.9:11211")
      , ("9", "10.0.0.17:11211")
      , ("10", "10.0.0.6:11211")
      ]
    )
  , ( "localhost_2ports"
    , [("localhost", 11211, 1), ("localhost", 11212, 1)]
    ,
      [ ("a", "localhost:11212")
      , ("b", "localhost:11211")
      , ("c", "localhost:11211")
      , ("foo", "localhost:11211")
      , ("bar", "localhost:11212")
      , ("baz", "localhost:11212")
      , ("hello", "localhost:11211")
      , ("world", "localhost:11212")
      , ("user:1", "localhost:11212")
      , ("user:2", "localhost:11212")
      , ("user:3", "localhost:11211")
      , ("user:42", "localhost:11212")
      , ("session:abcdef", "localhost:11211")
      , ("counter", "localhost:11211")
      , ("memcache-hs", "localhost:11211")
      , ("key1", "localhost:11212")
      , ("key2", "localhost:11211")
      , ("key3", "localhost:11212")
      , ("key4", "localhost:11212")
      , ("0", "localhost:11212")
      , ("1", "localhost:11212")
      , ("2", "localhost:11211")
      , ("3", "localhost:11211")
      , ("4", "localhost:11211")
      , ("5", "localhost:11211")
      , ("6", "localhost:11211")
      , ("7", "localhost:11211")
      , ("8", "localhost:11212")
      , ("9", "localhost:11211")
      , ("10", "localhost:11211")
      ]
    )
  ]