zoukankan      html  css  js  c++  java
  • Redis使用

    一、定义

    redis是nosql产品之一,nosql就是无需编写复杂的sql语句。是Remote Dictionary Server(远程字典数据服务)的缩写。

    由意大利人 antirez(Salvatore Sanfilippo)  开发的一款 内存高速缓存数据库。该软件使用C语言编写,它的数据模型为 key-value。

    它支持丰富的数据结构(类型),比如 String  list  hash   set  sorted set

    可持久化(随时把数据备份到硬盘中一份),保证了数据安全。

    简单应用场景:同一个select 查询语句,每天需要被执行查询100万次(获得数据数据其实都是一样的,只是在做重复的查询工作而已),为了减轻数据库的负载,就把查询好的数据给缓存起来(存储在内存中),每天的第一个用户的第一次查询就从mysql中获得数据并存储到内存中,第二个 到 第100万次请求就直接从内存中获得数据。

    作用:  

      使用缓存减轻数据库的负载。

      在开发网站的时候如果有一些数据在短时间之内不会发生变化,而它们还要被频繁访问,为了提高用户的请求速度和降低网站的负载,就把这些数据放到一个读取速度更快的介质上(或者是通过较少的计算量就可以获得该数据) ,该行为就称作对该数据的缓存。

    缓存的两种形式:(一些不常更新的数据)

      ①页面缓存经常用在CMS(content manage system)内存管理系统里边(Smarty缓存),如新闻类信息

      ②数据缓存经常会用在页面的具体数据里边

    二、安装 跳转

    linux下简单使用:

    三、具体使用

    redis中的数据模型为:key/value。
    类似在php中的定义变量:名称 = 值。
    1.key的操作
    在redis里边,除了” ”和空格不能作为名字的组成内容外,其他内容都可以作为key的名字部分。名字长度不做要求。

    linux中使用:

    新增模糊删除:redisCliPath keys "*keywords" | xargs redisCliPath del

    php中使用:

    //连接本地redis服务
    $redis = new Redis();
    //var_dump($redis);die;
    $redis->connect('127.0.0.1',6379);
    echo 'Connect to server successfully.<br>';
    
    //查看redis服务是否在运行
    echo ' Server is running '.$redis->ping();
    echo '<br><br>';
    
    echo '设置key:'.$redis->set('demo','123');
    echo '<br>';
    echo '测试指定key是否存在:'.$redis->exists('demo');
    echo '<br>';
    echo '删除给定key:'.$redis->del('demo','demo1');
    echo '<br>';
    echo '返回给定key的value类型:'.$redis->type('demo');
    echo '<br>';
    echo '返回匹配指定模式的所有key(*模糊查找全部;*a*模糊查找;?;[];):';
    var_dump($redis->keys('*'));
    var_dump($redis->keys('d*mo'));
    var_dump($redis->keys('d?mo'));
    var_dump($redis->keys('d[ea]mo'));
    echo '<br>';
    echo '改名字:'.$redis->rename('demo1','demo11');
    echo '<br>';
    echo '返回当前数据库的key数量:'.$redis->dbsize();
    echo '<br>';
    echo '为key指定过期时间:'.$redis->expire('demo','30');
    echo '<br>';
    echo '返回key的剩余过期秒数:'.$redis->ttl('demo');
    echo '<br>';
    echo '选择数据库(redis一共有16个数据库可同时操作,名字0-15。配置文件中databases值):'.$redis->select('0');
    echo '<br>';
    echo '将key从当前数据库移动到指定数据库:'.$redis->move('demo','1');
    echo '<br>';
    echo '删除当前数据库中所有的key:'.$redis->flushdb();
    echo '<br>';
    echo '删除所有数据库中的所有key:'.$redis->flushall();
    echo '<br>';

      输出

    Connect to server successfully.
    Server is running +PONG
    
    设置key:1
    测试指定key是否存在:1
    
    返回给定key的value类型:1
    返回匹配指定模式的所有key(*模糊查找全部;*a*模糊查找;?;[];):array(1) {[0]=>string(4) "demo" } array(1) {[0]=>string(4) "demo" } array(1) {[0]=>string(4) "demo" } array(1) {[0]=>string(4) "demo" } 
    改名字:
    返回当前数据库的key数量:1
    为key指定过期时间:1
    返回key的剩余过期秒数:30
    选择数据库(redis一共有16个数据库可同时操作,名字0-15。配置文件中databases值):1
    将key从当前数据库移动到指定数据库:1
    删除当前数据库中所有的key:1
    删除所有数据库中的所有key:1

    2.string的操作

      redis最基本的类型,可以包含任何数据。包括jpg图片或者序列化的对象。单个value值最大上限是1G字节。

    linux下使用:

     php中使用:

    //连接本地redis服务
    $redis = new Redis();
    //var_dump($redis);die;
    $redis->connect('127.0.0.1',6379);
    echo 'Connect to server successfully.<br>';
    
    //查看redis服务是否在运行
    echo ' Server is running '.$redis->ping();
    echo '<br><br>';
    
    echo '设置key的value值:'.$redis->set('demo','0');
    echo '<br>';
    echo '一次设置多个key的值:'.$redis->mset(array('first_key'=>'first_val','second_key'=>'second_val','third_key'=>'third_val'));
    echo '<br>';
    echo '一次获取多个key的值:';
    var_dump($redis->mget(array('first_key','second_key','third_key')));
    echo '<br>';
    echo '对key的值做++操作,并返回新的值:'.$redis->incr('demo');
    echo '<br>';
    echo '对key的值做--操作,并返回新的值:'.$redis->decr('demo');
    echo '<br>';
    echo '对key+指定的值:'.$redis->incrby('demo','5');
    echo '<br>';
    echo '对key-指定的值:'.$redis->decrby('demo','4');
    echo '<br>';
    echo '给指定key的字符串追加value:'.$redis->append('demo','2');
    echo '<br>';
    echo '返回截取过的key的字符串值:'.$redis->substr('demo','0','1');

      输出

    Connect to server successfully.
    Server is running +PONG
    
    设置key的value值:1
    一次设置多个key的值:1
    一次获取多个key的值:
    array(3) {[0]=>string(9) "first_val"[1]=>string(10) "second_val"[2]=>string(9) "third_val" } 
    对key的值做++操作,并返回新的值:1
    对key的值做--操作,并返回新的值:0
    对key+指定的值:5
    对key-指定的值:1
    给指定key的字符串追加value:2
    返回截取过的key的字符串值:12

    注意:

    incr :  increment 增加操作,类似程序的i++,累加1操作,

       ① 这对新key操作,创建该key,并设置值为1。

       ② 针对已有key操作,已有key的信息只进行累加(要求:已有key的值类型必须为整型)。

    decr: decrement  递减操作, i--,与incr相反。

    substr: key  开始位置  结尾位置(字符串的下标从0开始,截取的内容包括开始、结尾位置)。

     3.数据类型list链表的操作

      list类型其实就是一个双向链表。通过push,pop操作从链表的头部或者尾部添加删除元素。  

      这使得list既可以用作栈,也可以用作队列。

        上进上出 :  ,特点:数据 先进后出。

        上进下出 :队列,特点:数据 先进先出。

    linux下使用:

     php下使用:

    echo '在key对用的list的头部添加字符串元素:'.$redis->lpush('list-info','0');
    echo '<br>';
    echo '从list的尾部删除元素,并返回删除的元素:'.$redis->rpop('list-info');
    echo '<br>';
    echo '对应list的长度,key不存在返回0;如果key对应类型不是list返回错误:'.$redis->llen('list-info');
    echo '<br>';
    echo '返回指定区间内的元素,下标从0开始:';
    var_dump($redis->lrange('list-info','0','1'));
    echo '<br>';
    echo '在key对用的list的尾部添加字符串元素:'.$redis->rpush('list-info','9');
    echo '<br>';
    echo '从list的头部删除元素,并返回删除元素:'.$redis->lpop('list-info');
    echo '<br>';
    echo '截取list,保留指定区间内元素:';
    var_dump($redis->ltrim('list-info','0','1'));

      输出

    Connect to server successfully.
     Server is running +PONG
    
    在key对用的list的头部添加字符串元素:1
    从list的尾部删除元素,并返回删除的元素:0
    对应list的长度,key不存在返回0;如果key对应类型不是list返回错误:0
    返回指定区间内的元素,下标从0开始:array(0) { } 
    在key对用的list的尾部添加字符串元素:1
    从list的头部删除元素,并返回删除元素:9
    截取list,保留指定区间内元素:bool(true) 

    例如:该list链表类型应用场合:获得最新的10个登录用户信息: select * from user order by logintime desc limit 10;

    以往sql语句就可以实现这个需求,但是数据多的时候,全部数据都要受到影响查询,对数据库的负载比较高。必要情况还需要给关键字段(id或logintime)设置索引,索引也比较耗费系统资源。

    如果通过list链表实现以上功能,可以在list链表中只保留最新的10个数据,每进来一个新数据就删除一个旧数据。每次就可以从链表中直接获得需要的数据。极大节省各方面资源消耗。

     

    最终,通过list链表保存登录系统的最新10个用户信息。

    php简单实现:

    //简单的登入系统,保存最新的10个用户信息
    $list_arr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n'];
    foreach($list_arr as $v){
        $len = $redis->llen('newLogin');
        if($len == 0){
            $redis->lpush('newLogin',$v);
        }elseif ($len === false) {
            echo 'newLogin 错误';
        }elseif($len == 10){
            //已满足10个用户,删除最老的,再添加
            $redis->rpop('newLogin');
            $redis->lpush('newLogin',$v);
        }else {
            $redis->lpush('newLogin',$v);
        }
    }
    var_dump($redis->lrange('newLogin','0','100'));

      输出

    Connect to server successfully.
     Server is running +PONG
    
    array(10) {[0]=>string(1) "n"[1]=>string(1) "m"[2]=>string(1) "l"[3]=>string(1) "k"[4]=>string(1) "j"[5]=>string(1) "i"[6]=>string(1) "h"[7]=>string(1) "g"[8]=>string(1) "f"[9]=>string(1) "e" } 

     4.set集合类型的操作

      redis的set是string类型的无序集合。set元素最大可以包含(2的32次方-1)(整型最大值)个元素。

    linus下使用:

    php下使用:

    echo '添加一个string元素到key对应的set集合中,成功返回1;如果元素已经存在集合中,返回0;key对应的set不存在则返回错误:'.$redis->sadd('set-key1','member');
    $redis->sadd('set-key2','member1');
    echo '<br>';
    echo '从key对应set中移除给定元素,成功返回1:'.$redis->srem('set-key1','member');
    echo '<br>';
    echo '从p1对应set中移除member并添加到p2对应的集合中:'.$redis->smove('set-key1','set-key2','member');
    echo '<br>';
    echo '返回set的元素个数:'.$redis->scard('set-key1');
    echo '<br>';
    echo '判断member是否在set中:'.$redis->sismember('set-key1','member');
    echo '<br>';
    echo '返回所有给定key的交集:';
    var_dump($redis->sinter('set-key1','set-key2'));
    echo '<br>';
    echo '返回所有给定key的并集:';
    var_dump($redis->sunion('set-key1','set-key2'));
    echo '<br>';
    echo '返回所有给定key的差集:';
    var_dump($redis->sdiff('set-key1','set-key2'));
    echo '<br>';
    echo '返回key对应set的所有元素,结果是无序的:';
    var_dump($redis->smembers('set-key1'));

      输出

    Connect to server successfully.
     Server is running +PONG
    
    添加一个string元素到key对应的set集合中,成功返回1;如果元素已经存在集合中,返回0;key对应的set不存在则返回错误:1
    从key对应set中移除给定元素,成功返回1:1
    从p1对应set中移除member并添加到p2对应的集合中:
    返回set的元素个数:0
    判断member是否在set中:
    返回所有给定key的交集:array(0) { } 
    返回所有给定key的并集:array(1) {[0]=>string(7) "member1" } 
    返回所有给定key的差集:array(0) { } 
    返回key对应set的所有元素,结果是无序的:array(0) { } 

    关于set集合类型除了基本的添加、删除操作,其他有用的操作还包含集合的取并集(union)交集(intersection)差集(difference)。每个集合的元素不能重复。

    例如:通过这些操作可以很容易的实现sns中的好友推荐功能。qq好友推荐。

      tom朋友圈(与某某是好友):mary  jack  xiaoming  wang5  wang6。

      linken朋友圈(与某某是好友):yuehan  daxiong  luce  wang5  wang6。

    php简单实现:

    //好友推荐功能
    $tom_s = ['mary','jack','xiaoming','wang5','wang6'];
    $linken_s = ['yuehan','daxiong','luce','wang5','wang6'];
    //添加集合
    foreach($tom_s as $v){
        $redis->sadd('tom_s',$v);
    }
    foreach($linken_s as $v){
        $redis->sadd('linken_s',$v);
    }
    $sinter = $redis->sinter('tom_s','linken_s');
    if(!empty($sinter)){
        //说明有共同好友
        //求tom_s对linken_s的差集
        $toms_d = $redis->sdiff('tom_s','linken_s');
        if(!empty($toms_d)){
            foreach($toms_d as $v){
                $redis->smove('tom_s','linken_s',$v);
            }
        }
        $linkens_d = $redis->sdiff('linken_s','tom_s');
        if(!empty($linkens_d)){
            foreach($linkens_d as $v){
                $redis->smove('linken_s','tom_s',$v);
            }
        }
    }
    var_dump($redis->smembers('tom_s'));
    var_dump($redis->smembers('linken_s'));

      输出

    Connect to server successfully.
     Server is running +PONG
    
    array(8) {[0]=>string(8) "xiaoming"[1]=>string(4) "luce"[2]=>string(6) "yuehan"[3]=>string(4) "mary"[4]=>string(7) "daxiong"[5]=>string(5) "wang5"[6]=>string(4) "jack"[7]=>string(5) "wang6" } 
    array(2) {[0]=>string(5) "wang5"[1]=>string(5) "wang6" } 

    可以看到,最后已经将linken的好友推荐给了tom。

     5.Sort Set排序集合类型的操作

      该Sort Set是两种类型(list和set)的集中体现,称为排序集合类型。和set一样sorted set也是string类型元素的集合,不同的是每个元素都会关联一个。通过权/值可以有序的获取集合中的元素。(注意,这里的值可以理解为数据库中的id

       区别:

        list:链表类型,排序功能,允许重复数据。

        set:集合类型,没有排序功能,没有重复数据。

    linux下使用:

    php下使用:

    echo '添加元素到集合,元素在集合中存在则更新对应的score(权)(key,权,值):'.$redis->zadd('sort-key','1','id');
    echo '<br>';
    echo '删除指定元素,1表示成功,如果元素不存在返回0:'.$redis->zrem('sort-key','id1');
    echo '<br>';
    echo '按照incr幅度增加对应member的score(权)值,返回score(权)值:'.$redis->zincrby('sort-key','1','id');
    echo '<br>';
    echo '返回指定元素在集合中的排名(下标),集合中元素是按score(权)从小到大排序的:'.$redis->zrank('sort-key','id');
    echo '<br>';
    echo '同上,但是集合中的元素是按score(权)从大到小排序:'.$redis->zrevrank('sort-key','id');
    echo '<br>';
    echo '类似lrange操作从集合中去指定区间的元素,返回的是带有 score 值(可选)的有序结果集:';
    var_dump($redis->zrange('sort-key','0','1'));
    echo '<br>';
    echo '同上,但是返回的结果集是按score(权)逆序的:';
    var_dump($redis->zrevrange('sort-key','0','1'));
    echo '<br>';
    echo '返回ScoreSet集合元素总数:'.$redis->zcard('sort-key');
    echo '<br>';
    echo '返回给定元素对应的score(权):'.$redis->zscore('sort-key','id');
    echo '<br>';
    echo '删除集合中排名在给定区间的元素:'.$redis->zremrangebyrank('sort-key','0','1');

      输出

    Connect to server successfully.
     Server is running +PONG
    
    添加元素到集合,元素在集合中存在则更新对应的score(权):1
    删除指定元素,1表示成功,如果元素不存在返回0:0
    按照incr幅度增加对应member的score(权)值,返回score(权)值:2
    返回指定元素在集合中的排名(下标),集合中元素是按score(权)从小到大排序的:0
    同上,但是集合中的元素是按score(权)从大到小排序:0
    类似lrange操作从集合中去指定区间的元素,返回的是有序结果集:array(1) {[0]=>string(4) "val1" } 
    同上,但是返回的结果集是按score(权)逆序的:array(1) {[0]=>string(4) "val1" } 
    返回集合元素个数:1
    返回给定元素对应的score(权):2
    删除集合中排名在给定区间的元素:1

    eg.获得最热门(回复量)前5个帖子信息:

      ①. select * from message order by backnum desc limit 5;此需求可以通过简单sql语句实现,但是sql语句比较耗费mysql数据库资源。

      ②. 利用sort set实现获取最热门的前5帖子信息

    每个帖子都有机会进入该“热门帖子集合”中,但是只保留回复量最高的5个帖子。

    排序集合中的每个元素都是值(id)、权(value)的组合(之前的set集合类型每个元素就只是一个 值)

    我们只做一个sort set排序集合,里边只保留5个元素信息,该5个元素是回复量最高的,每个帖子被回复的时候,都有机会进入该集合里边,但是只有回复量最高的前5个帖子会存在于在集合,回复量低的就被删除。

    php简单实现:

    //获得最热门(回复量)前5个帖子信息:
    $data = [
        ['id'=>11,'value'=>102],
        ['id'=>12,'value'=>141],
        ['id'=>13,'value'=>72],
        ['id'=>14,'value'=>203],
        ['id'=>15,'value'=>189],
        ['id'=>16,'value'=>191],
        ['id'=>17,'value'=>159],
        ['id'=>18,'value'=>305],
        ['id'=>19,'value'=>184]];
    //创建一个hotmsg的排序集合
    foreach($data as $v){
        $redis->zadd('hotmsg',$v['value'],$v['id']);
        $count = $redis->zcard('hotmsg');
        if($count > 5){
            //按照’权‘由大到小顺序,获取元素信息
            $redis->zrevrange('hotmsg','0','100');
            //每增加一个新元素,就删除一个权值最小的旧元素,保留权值最高的5个元素
            $redis->zremrangebyrank('hotmsg','0','0');
        }
    }
    var_dump($redis->zrevrange('hotmsg','0','100'));

      输出

    Connect to server successfully.
     Server is running +PONG
    
    array(5) {[0]=>string(2) "18"[1]=>string(2) "14"[2]=>string(2) "16"[3]=>string(2) "15"[4]=>string(2) "19" } 

    6. hash(哈希)数据类型的操作 

      Redis hash 是一个string类型的field和value的映射表,存储的数据与mysql数据库中存储的一条记录极为相似,所以hash特别适合用于存储对象。

    linux下使用:

    php下使用:

    $redis->del('hash-key');
    echo '设置 hash field 为指定值,如果 key 不存在,则先创建:'.$redis->hset('hash-key','field','value');
    echo '<br>';
    echo '获取指定的 hash field:'.$redis->hget('hash-key','field');
    echo '<br>';
    echo '获取全部指定的 hash field:';
    var_dump($redis->hmget('hash-key',['field']));
    echo '<br>';
    echo '同时设置 hash 的多个 field,已存在会自动更新:'.$redis->hmset('hash-key',['field1'=>'value1','field2'=>'value2','field3'=>'3']);
    echo '<br>';
    echo '将指定的 hash field 加上给定值:'.$redis->hincrby('hash-key','field3',1);
    echo '<br>';
    echo '测试指定 field 是否存在:'.$redis->hexists('hash-key','field');
    echo '<br>';
    echo '删除指定的 hash fied :'.$redis->hdel('hash-key','field');
    echo '<br>';
    echo '返回指定 hash 的 field 数量:'.$redis->hlen('hash-key');
    echo '<br>';
    echo '返回 hash 的所有 field:';
    var_dump($redis->hkeys('hash-key'));
    echo '<br>';
    echo '返回 hash 的所有 value:';
    var_dump($redis->hvals('hash-key'));
    echo '<br>';
    echo '返回 hash 的所有 field 和 value:';
    var_dump($redis->hgetall('hash-key'));

      输出 

    Connect to server successfully.
     Server is running +PONG
    
    设置 hash field 为指定值,如果 key 不存在,则先创建:1
    获取指定的 hash field:value
    获取全部指定的 hash field:array(1) {["field"]=>string(5) "value" } 
    同时设置 hash 的多个 field:1
    将指定的 hash field 加上给定值:4
    测试指定 field 是否存在:1
    删除指定的 hash fied :1
    返回指定 hash 的 field 数量:3
    返回 hash 的所有 field:array(3) {[0]=>string(6) "field1"[1]=>string(6) "field2"[2]=>string(6) "field3" } 
    返回 hash 的所有 value:array(3) {[0]=>string(6) "value1"[1]=>string(6) "value2"[2]=>string(1) "4" } 
    返回 hash 的所有 field 和 value:array(3) {["field1"]=>string(6) "value1"["field2"]=>string(6) "value2"["field3"]=>string(1) "4" } 

    四、持久化功能

       定义:redis(nosql产品)为了内部数据的安全考虑,会把本身的数据以文件形式保存到硬盘中一份,在服务器重启之后会自动把硬盘的数据恢复到内存(redis)的里边。数据保存到硬盘的过程就称为“持久化”效果。

    1. snap shotting快照持久化

      该持久化默认开启,一次性把redis中全部的数据保存一份存储在硬盘中(备份文件名字默认是dump.rdb),如果数据非常多(10-20G)就不适合频繁进行该持久化操作。

    dump.rdb 是随着linux系统重新启动的时候,数据自动还原到redis内存的。

    配置文件redis.conf下:

    save 900 1 #900 秒内如果超过 1 个 key 被修改,则发起快照保存。

    save 300 10 #300秒超过10个key被修改,发起快照。

    save 60 10000 #60秒超过10000个key被修改,发起快照。

    以上3个save,都要使用:
      key变化的非常快,就使用第3个save,保证数据安全
      key变化的比较慢,就使用第1/2个save,保证服务器性能

     1.1 手动发起快照持久化

    [root@vbox-nginx redis]# ./redis-cli bgsave

    2. append only file (AOF精细持久化)

      本质:把用户执行的每个“写”指令(添加、修改、删除)都备份到文件中,还原数据的时候就是执行具体写指令而已。

     

    在配置redis.conf文件下:

    # appendfsync always //每次收到写命令就立即强制写入磁盘,最慢的,但是保证完全的持久化,不推荐使用

    appendfsync everysec //每秒钟强制写入磁盘一次,在性能和持久化方面做了很好的折中,推荐

    # appendfsync no //完全依赖 os,性能最好,持久化没保证

     区别:

      第一种:数据最安全,服务器性能最低
      第二种:数据较安全,服务器性能较好 推荐
      第三种:数据最不安全,服务器性能最好

    注意,aof持久化修改配置文件开启时,要先停掉旧进程,然后根据最新的额配置启动新进程

    写好的信息会立即备份到文件中:

    2.1 为aof备份文件做优化压缩处理

      例如:可以把多个incr指令换为一个set指令

    [root@vbox-nginx redis]# ./redis-cli bgrewriteaof
    Background append only file rewriting started

    redis持久化相关指令:

      bgsave 异步保存数据到磁盘(快照保存)

      lastsave 返回上次成功保存到磁盘的unix时间戳

      shutdown 同步保存到服务器并关闭redis服务器

      bgrewriteaof 当日志文件过长时优化AOF日志文件存储

      ./redis-cli bgrewriteaof

      ./redis-cli bgsave

      ./redis-cli -h 127.0.0.1 -p 6379 bgsave #手动发起快照

     五、redis的主从模式

      背景:网站运行,mysql的写入、读取操作的sql语句比例:1:7。mysql为了降低每个服务器负载,可以设置读写分离(有写服务器、有读取服务器)

       redis实现:

        为了降低每个redis服务器的负载,可以多设置几个,并做主从模式 。
        一个服务器负载“写”(添加、修改、删除)数据,其他服务器负载“读”数据。
        主服务器数据会“自动”同步给从服务器。

    在redis.conf下配置:

     六、php与redis

    因为redis在php中本身就是一个功能模块,所以在安装好扩展的前提下,只需实例化就可以调用了。另外想查看php-redis都有哪些方法,可以使用php的 反射Reflection 进行查看。

    $redis_action = new ReflectionClass('Redis');
    print_r($redis_action->getMethods());

      输出

    Connect to server successfully.
     Server is running +PONG
    
    Array ([0] => ReflectionMethod Object([name] => __construct[class] => Redis)[1] => ReflectionMethod Object([name] => __destruct[class] => Redis)[2] => ReflectionMethod Object([name] => _prefix[class] => Redis)[3] => ReflectionMethod Object([name] => _serialize[class] => Redis)[4] => ReflectionMethod Object([name] => _unserialize[class] => Redis)[5] => ReflectionMethod Object([name] => append[class] => Redis)[6] => ReflectionMethod Object([name] => auth[class] => Redis)[7] => ReflectionMethod Object([name] => bgSave[class] => Redis)[8] => ReflectionMethod Object([name] => bgrewriteaof[class] => Redis)[9] => ReflectionMethod Object([name] => bitcount[class] => Redis)[10] => ReflectionMethod Object([name] => bitop[class] => Redis)[11] => ReflectionMethod Object([name] => bitpos[class] => Redis)[12] => ReflectionMethod Object([name] => blPop[class] => Redis)[13] => ReflectionMethod Object([name] => brPop[class] => Redis)[14] => ReflectionMethod Object([name] => brpoplpush[class] => Redis)[15] => ReflectionMethod Object([name] => bzPopMax[class] => Redis)[16] => ReflectionMethod Object([name] => bzPopMin[class] => Redis)[17] => ReflectionMethod Object([name] => clearLastError[class] => Redis)[18] => ReflectionMethod Object([name] => client[class] => Redis)[19] => ReflectionMethod Object([name] => close[class] => Redis)[20] => ReflectionMethod Object([name] => command[class] => Redis)[21] => ReflectionMethod Object([name] => config[class] => Redis)[22] => ReflectionMethod Object([name] => connect[class] => Redis)[23] => ReflectionMethod Object([name] => dbSize[class] => Redis)[24] => ReflectionMethod Object([name] => debug[class] => Redis)[25] => ReflectionMethod Object([name] => decr[class] => Redis)[26] => ReflectionMethod Object([name] => decrBy[class] => Redis)[27] => ReflectionMethod Object([name] => delete[class] => Redis)[28] => ReflectionMethod Object([name] => discard[class] => Redis)[29] => ReflectionMethod Object([name] => dump[class] => Redis)[30] => ReflectionMethod Object([name] => echo[class] => Redis)[31] => ReflectionMethod Object([name] => eval[class] => Redis)[32] => ReflectionMethod Object([name] => evalsha[class] => Redis)[33] => ReflectionMethod Object([name] => exec[class] => Redis)[34] => ReflectionMethod Object([name] => exists[class] => Redis)[35] => ReflectionMethod Object([name] => expireAt[class] => Redis)[36] => ReflectionMethod Object([name] => flushAll[class] => Redis)[37] => ReflectionMethod Object([name] => flushDB[class] => Redis)[38] => ReflectionMethod Object([name] => geoadd[class] => Redis)[39] => ReflectionMethod Object([name] => geodist[class] => Redis)[40] => ReflectionMethod Object([name] => geohash[class] => Redis)[41] => ReflectionMethod Object([name] => geopos[class] => Redis)[42] => ReflectionMethod Object([name] => georadius[class] => Redis)[43] => ReflectionMethod Object([name] => georadius_ro[class] => Redis)[44] => ReflectionMethod Object([name] => georadiusbymember[class] => Redis)[45] => ReflectionMethod Object([name] => georadiusbymember_ro[class] => Redis)[46] => ReflectionMethod Object([name] => get[class] => Redis)[47] => ReflectionMethod Object([name] => getAuth[class] => Redis)[48] => ReflectionMethod Object([name] => getBit[class] => Redis)[49] => ReflectionMethod Object([name] => getDBNum[class] => Redis)[50] => ReflectionMethod Object([name] => getHost[class] => Redis)[51] => ReflectionMethod Object([name] => getKeys[class] => Redis)[52] => ReflectionMethod Object([name] => getLastError[class] => Redis)[53] => ReflectionMethod Object([name] => getMode[class] => Redis)[54] => ReflectionMethod Object([name] => getMultiple[class] => Redis)[55] => ReflectionMethod Object([name] => getOption[class] => Redis)[56] => ReflectionMethod Object([name] => getPersistentID[class] => Redis)[57] => ReflectionMethod Object([name] => getPort[class] => Redis)[58] => ReflectionMethod Object([name] => getRange[class] => Redis)[59] => ReflectionMethod Object([name] => getReadTimeout[class] => Redis)[60] => ReflectionMethod Object([name] => getSet[class] => Redis)[61] => ReflectionMethod Object([name] => getTimeout[class] => Redis)[62] => ReflectionMethod Object([name] => hDel[class] => Redis)[63] => ReflectionMethod Object([name] => hExists[class] => Redis)[64] => ReflectionMethod Object([name] => hGet[class] => Redis)[65] => ReflectionMethod Object([name] => hGetAll[class] => Redis)[66] => ReflectionMethod Object([name] => hIncrBy[class] => Redis)[67] => ReflectionMethod Object([name] => hIncrByFloat[class] => Redis)[68] => ReflectionMethod Object([name] => hKeys[class] => Redis)[69] => ReflectionMethod Object([name] => hLen[class] => Redis)[70] => ReflectionMethod Object([name] => hMget[class] => Redis)[71] => ReflectionMethod Object([name] => hMset[class] => Redis)[72] => ReflectionMethod Object([name] => hSet[class] => Redis)[73] => ReflectionMethod Object([name] => hSetNx[class] => Redis)[74] => ReflectionMethod Object([name] => hStrLen[class] => Redis)[75] => ReflectionMethod Object([name] => hVals[class] => Redis)[76] => ReflectionMethod Object([name] => hscan[class] => Redis)[77] => ReflectionMethod Object([name] => incr[class] => Redis)[78] => ReflectionMethod Object([name] => incrBy[class] => Redis)[79] => ReflectionMethod Object([name] => incrByFloat[class] => Redis)[80] => ReflectionMethod Object([name] => info[class] => Redis)[81] => ReflectionMethod Object([name] => isConnected[class] => Redis)[82] => ReflectionMethod Object([name] => lGet[class] => Redis)[83] => ReflectionMethod Object([name] => lGetRange[class] => Redis)[84] => ReflectionMethod Object([name] => lInsert[class] => Redis)[85] => ReflectionMethod Object([name] => lPop[class] => Redis)[86] => ReflectionMethod Object([name] => lPush[class] => Redis)[87] => ReflectionMethod Object([name] => lPushx[class] => Redis)[88] => ReflectionMethod Object([name] => lRemove[class] => Redis)[89] => ReflectionMethod Object([name] => lSet[class] => Redis)[90] => ReflectionMethod Object([name] => lSize[class] => Redis)[91] => ReflectionMethod Object([name] => lastSave[class] => Redis)[92] => ReflectionMethod Object([name] => listTrim[class] => Redis)[93] => ReflectionMethod Object([name] => migrate[class] => Redis)[94] => ReflectionMethod Object([name] => move[class] => Redis)[95] => ReflectionMethod Object([name] => mset[class] => Redis)[96] => ReflectionMethod Object([name] => msetnx[class] => Redis)[97] => ReflectionMethod Object([name] => multi[class] => Redis)[98] => ReflectionMethod Object([name] => object[class] => Redis)[99] => ReflectionMethod Object([name] => pconnect[class] => Redis)[100] => ReflectionMethod Object([name] => persist[class] => Redis)[101] => ReflectionMethod Object([name] => pexpire[class] => Redis)[102] => ReflectionMethod Object([name] => pexpireAt[class] => Redis)[103] => ReflectionMethod Object([name] => pfadd[class] => Redis)[104] => ReflectionMethod Object([name] => pfcount[class] => Redis)[105] => ReflectionMethod Object([name] => pfmerge[class] => Redis)[106] => ReflectionMethod Object([name] => ping[class] => Redis)[107] => ReflectionMethod Object([name] => pipeline[class] => Redis)[108] => ReflectionMethod Object([name] => psetex[class] => Redis)[109] => ReflectionMethod Object([name] => psubscribe[class] => Redis)[110] => ReflectionMethod Object([name] => pttl[class] => Redis)[111] => ReflectionMethod Object([name] => publish[class] => Redis)[112] => ReflectionMethod Object([name] => pubsub[class] => Redis)[113] => ReflectionMethod Object([name] => punsubscribe[class] => Redis)[114] => ReflectionMethod Object([name] => rPop[class] => Redis)[115] => ReflectionMethod Object([name] => rPush[class] => Redis)[116] => ReflectionMethod Object([name] => rPushx[class] => Redis)[117] => ReflectionMethod Object([name] => randomKey[class] => Redis)[118] => ReflectionMethod Object([name] => rawcommand[class] => Redis)[119] => ReflectionMethod Object([name] => renameKey[class] => Redis)[120] => ReflectionMethod Object([name] => renameNx[class] => Redis)[121] => ReflectionMethod Object([name] => restore[class] => Redis)[122] => ReflectionMethod Object([name] => role[class] => Redis)[123] => ReflectionMethod Object([name] => rpoplpush[class] => Redis)[124] => ReflectionMethod Object([name] => sAdd[class] => Redis)[125] => ReflectionMethod Object([name] => sAddArray[class] => Redis)[126] => ReflectionMethod Object([name] => sContains[class] => Redis)[127] => ReflectionMethod Object([name] => sDiff[class] => Redis)[128] => ReflectionMethod Object([name] => sDiffStore[class] => Redis)[129] => ReflectionMethod Object([name] => sInter[class] => Redis)[130] => ReflectionMethod Object([name] => sInterStore[class] => Redis)[131] => ReflectionMethod Object([name] => sMembers[class] => Redis)[132] => ReflectionMethod Object([name] => sMove[class] => Redis)[133] => ReflectionMethod Object([name] => sPop[class] => Redis)[134] => ReflectionMethod Object([name] => sRandMember[class] => Redis)[135] => ReflectionMethod Object([name] => sRemove[class] => Redis)[136] => ReflectionMethod Object([name] => sSize[class] => Redis)[137] => ReflectionMethod Object([name] => sUnion[class] => Redis)[138] => ReflectionMethod Object([name] => sUnionStore[class] => Redis)[139] => ReflectionMethod Object([name] => save[class] => Redis)[140] => ReflectionMethod Object([name] => scan[class] => Redis)[141] => ReflectionMethod Object([name] => script[class] => Redis)[142] => ReflectionMethod Object([name] => select[class] => Redis)[143] => ReflectionMethod Object([name] => set[class] => Redis)[144] => ReflectionMethod Object([name] => setBit[class] => Redis)[145] => ReflectionMethod Object([name] => setOption[class] => Redis)[146] => ReflectionMethod Object([name] => setRange[class] => Redis)[147] => ReflectionMethod Object([name] => setTimeout[class] => Redis)[148] => ReflectionMethod Object([name] => setex[class] => Redis)[149] => ReflectionMethod Object([name] => setnx[class] => Redis)[150] => ReflectionMethod Object([name] => slaveof[class] => Redis)[151] => ReflectionMethod Object([name] => slowlog[class] => Redis)[152] => ReflectionMethod Object([name] => sort[class] => Redis)[153] => ReflectionMethod Object([name] => sortAsc[class] => Redis)[154] => ReflectionMethod Object([name] => sortAscAlpha[class] => Redis)[155] => ReflectionMethod Object([name] => sortDesc[class] => Redis)[156] => ReflectionMethod Object([name] => sortDescAlpha[class] => Redis)[157] => ReflectionMethod Object([name] => sscan[class] => Redis)[158] => ReflectionMethod Object([name] => strlen[class] => Redis)[159] => ReflectionMethod Object([name] => subscribe[class] => Redis)[160] => ReflectionMethod Object([name] => swapdb[class] => Redis)[161] => ReflectionMethod Object([name] => time[class] => Redis)[162] => ReflectionMethod Object([name] => ttl[class] => Redis)[163] => ReflectionMethod Object([name] => type[class] => Redis)[164] => ReflectionMethod Object([name] => unlink[class] => Redis)[165] => ReflectionMethod Object([name] => unsubscribe[class] => Redis)[166] => ReflectionMethod Object([name] => unwatch[class] => Redis)[167] => ReflectionMethod Object([name] => wait[class] => Redis)[168] => ReflectionMethod Object([name] => watch[class] => Redis)[169] => ReflectionMethod Object([name] => xack[class] => Redis)[170] => ReflectionMethod Object([name] => xadd[class] => Redis)[171] => ReflectionMethod Object([name] => xclaim[class] => Redis)[172] => ReflectionMethod Object([name] => xdel[class] => Redis)[173] => ReflectionMethod Object([name] => xgroup[class] => Redis)[174] => ReflectionMethod Object([name] => xinfo[class] => Redis)[175] => ReflectionMethod Object([name] => xlen[class] => Redis)[176] => ReflectionMethod Object([name] => xpending[class] => Redis)[177] => ReflectionMethod Object([name] => xrange[class] => Redis)[178] => ReflectionMethod Object([name] => xread[class] => Redis)[179] => ReflectionMethod Object([name] => xreadgroup[class] => Redis)[180] => ReflectionMethod Object([name] => xrevrange[class] => Redis)[181] => ReflectionMethod Object([name] => xtrim[class] => Redis)[182] => ReflectionMethod Object([name] => zAdd[class] => Redis)[183] => ReflectionMethod Object([name] => zCard[class] => Redis)[184] => ReflectionMethod Object([name] => zCount[class] => Redis)[185] => ReflectionMethod Object([name] => zDelete[class] => Redis)[186] => ReflectionMethod Object([name] => zDeleteRangeByRank[class] => Redis)[187] => ReflectionMethod Object([name] => zDeleteRangeByScore[class] => Redis)[188] => ReflectionMethod Object([name] => zIncrBy[class] => Redis)[189] => ReflectionMethod Object([name] => zInter[class] => Redis)[190] => ReflectionMethod Object([name] => zLexCount[class] => Redis)[191] => ReflectionMethod Object([name] => zRange[class] => Redis)[192] => ReflectionMethod Object([name] => zRangeByLex[class] => Redis)[193] => ReflectionMethod Object([name] => zRangeByScore[class] => Redis)[194] => ReflectionMethod Object([name] => zRank[class] => Redis)[195] => ReflectionMethod Object([name] => zRemRangeByLex[class] => Redis)[196] => ReflectionMethod Object([name] => zRevRange[class] => Redis)[197] => ReflectionMethod Object([name] => zRevRangeByLex[class] => Redis)[198] => ReflectionMethod Object([name] => zRevRangeByScore[class] => Redis)[199] => ReflectionMethod Object([name] => zRevRank[class] => Redis)[200] => ReflectionMethod Object([name] => zScore[class] => Redis)[201] => ReflectionMethod Object([name] => zUnion[class] => Redis)[202] => ReflectionMethod Object([name] => zscan[class] => Redis)[203] => ReflectionMethod Object([name] => zPopMax[class] => Redis)[204] => ReflectionMethod Object([name] => zPopMin[class] => Redis)[205] => ReflectionMethod Object([name] => del[class] => Redis)[206] => ReflectionMethod Object([name] => evaluate[class] => Redis)[207] => ReflectionMethod Object([name] => evaluateSha[class] => Redis)[208] => ReflectionMethod Object([name] => expire[class] => Redis)[209] => ReflectionMethod Object([name] => keys[class] => Redis)[210] => ReflectionMethod Object([name] => lLen[class] => Redis)[211] => ReflectionMethod Object([name] => lindex[class] => Redis)[212] => ReflectionMethod Object([name] => lrange[class] => Redis)[213] => ReflectionMethod Object([name] => lrem[class] => Redis)[214] => ReflectionMethod Object([name] => ltrim[class] => Redis)[215] => ReflectionMethod Object([name] => mget[class] => Redis)[216] => ReflectionMethod Object([name] => open[class] => Redis)[217] => ReflectionMethod Object([name] => popen[class] => Redis)[218] => ReflectionMethod Object([name] => rename[class] => Redis)[219] => ReflectionMethod Object([name] => sGetMembers[class] => Redis)[220] => ReflectionMethod Object([name] => scard[class] => Redis)[221] => ReflectionMethod Object([name] => sendEcho[class] => Redis)[222] => ReflectionMethod Object([name] => sismember[class] => Redis)[223] => ReflectionMethod Object([name] => srem[class] => Redis)[224] => ReflectionMethod Object([name] => substr[class] => Redis)[225] => ReflectionMethod Object([name] => zRem[class] => Redis)[226] => ReflectionMethod Object([name] => zRemRangeByRank[class] => Redis)[227] => ReflectionMethod Object([name] => zRemRangeByScore[class] => Redis)[228] => ReflectionMethod Object([name] => zRemove[class] => Redis)[229] => ReflectionMethod Object([name] => zRemoveRangeByScore[class] => Redis)[230] => ReflectionMethod Object([name] => zReverseRange[class] => Redis)[231] => ReflectionMethod Object([name] => zSize[class] => Redis)[232] => ReflectionMethod Object([name] => zinterstore[class] => Redis)[233] => ReflectionMethod Object([name] => zunionstore[class] => Redis) ) 

  • 相关阅读:
    Leetcode Binary Tree Preorder Traversal
    Leetcode Minimum Depth of Binary Tree
    Leetcode 148. Sort List
    Leetcode 61. Rotate List
    Leetcode 86. Partition List
    Leetcode 21. Merge Two Sorted Lists
    Leetcode 143. Reorder List
    J2EE项目应用开发过程中的易错点
    JNDI初认识
    奔腾的代码
  • 原文地址:https://www.cnblogs.com/two-bees/p/10752585.html
Copyright © 2011-2022 走看看