1 Star 0 Fork 41

楠木可依 / redisx

forked from draper / redisx 
Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

RedisX

什么是redisx?

1、包含几乎所有redis线程池实现以及用法;

2、包含redis Master Slave 主备实现;

3、包含redis 读写分离;

4、包含redis Sentinel 线程池;

5、包含redis Sentinel Salve 线程池;

5、包含redis Sentinel Sharded Master Slave 线程池;

6、包含redis 对象序列化压缩算法,gz和lzma等;

具体用法:

public class TestRedisUtils
{
    public static String value="2017年春运来得早,又赶上火车票预售期由60天调整至30天,购票期相对集中。对准备回家过年的人们而言,回家的火车票还好买吗?";

    public static void main(String[] args) throws InterruptedException
    {
        
        for (int i = 0; i < 500; i++)
        {
            new ThreadTest("treahd"+i).start();

        }      
}

class ThreadTest extends Thread
{
    private String name;

    public ThreadTest()
    {
        super();
    }

    public ThreadTest(String name)
    {
        super();
        this.name = name;
    }

    @Override
    public void run()
    {
        for (int i = 0; i < 10; i++)
        {
            String string = RedisSharedMasterSlaveSentinelUtil.setObject(name+i,TestRedisUtils.value+name+i);             
                    System.out.println(string + "=" + i);

        }

        for (int i = 0; i < 10; i++)
        {
            String value = RedisSharedMasterSlaveSentinelUtil.getObject(name + i, String.class);
            if(null != value)
            {
                System.out.println(value);
            }
            long l = RedisSharedMasterSlaveSentinelUtil.del(name + i);
            System.out.println(l + "=" + i);

        }
    }
}

RedisX交流群: 输入图片说明

推荐开源项目zbus,talent-aio,nredis-proxy

Repository Comments ( 0 )

Sign in to post a comment

About

最全redis线程池实现,读写分离,sentenl线程池等。 expand collapse
Java
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/wntp/redisx.git
git@gitee.com:wntp/redisx.git
wntp
redisx
redisx
master

Search