org.redisson.command.CommandSyncService Java Examples

The following examples show how to use org.redisson.command.CommandSyncService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RedisReportMap.java    From extract with MIT License 5 votes vote down vote up
/**
 * Instantiate a new Redis-backed report using the provided connection manager and name.
 *
 * @param redissonClient instantiated using {@link RedissonClientFactory}
 * @param name the name of the report
 */
private RedisReportMap(final RedissonClient redissonClient, final String name,
					   final Charset charset) {
	super(new ReportCodec(charset), new CommandSyncService(((Redisson)redissonClient).getConnectionManager()),
			null == name ? DEFAULT_NAME : name, redissonClient, null, null);
	this.redissonClient = redissonClient;
}
 
Example #2
Source File: RedisDocumentQueue.java    From extract with MIT License 5 votes vote down vote up
/**
 * Instantiate a new Redis-backed queue using the provided connection manager and name.
 *
 * @param redissonClient instantiated using {@link RedissonClientFactory}
 * @param name the name of the queue
 * @param charset the character set for encoding and decoding paths
 */
private RedisDocumentQueue(final RedissonClient redissonClient,
                           final String name, final Charset charset) {
	this(new PathQueueCodec(charset),
			new CommandSyncService(((Redisson)redissonClient).getConnectionManager()),
			null == name ? DEFAULT_NAME : name, redissonClient);

}
 
Example #3
Source File: RedisBlockingQueue.java    From datashare with GNU Affero General Public License v3.0 4 votes vote down vote up
public RedisBlockingQueue(RedissonClient redissonClient, String queueName) {
    super(new StringCodec(), new CommandSyncService(((Redisson)redissonClient).getConnectionManager()), queueName, redissonClient);
    this.redissonClient = redissonClient;
}
 
Example #4
Source File: RedisDocumentSet.java    From extract with MIT License 4 votes vote down vote up
private RedisDocumentSet(RedissonClient redissonClient, String name, Charset charset) {
    super(new RedisDocumentQueue.PathQueueCodec(charset),
    				new CommandSyncService(((Redisson)redissonClient).getConnectionManager()),
    				null == name ? DEFAULT_NAME : name, redissonClient);
    this.redissonClient = redissonClient;
}
 
Example #5
Source File: RedisNode.java    From redisson with Apache License 2.0 4 votes vote down vote up
public RedisNode(RedisClient client, CommandSyncService commandExecutor, NodeType type) {
    super();
    this.client = client;
    this.commandExecutor = commandExecutor;
    this.type = type;
}
 
Example #6
Source File: RedisClientEntry.java    From redisson with Apache License 2.0 4 votes vote down vote up
public RedisClientEntry(RedisClient client, CommandSyncService commandExecutor, NodeType type) {
    super();
    this.client = client;
    this.commandExecutor = commandExecutor;
    this.type = type;
}
 
Example #7
Source File: MasterSlaveConnectionManager.java    From redisson with Apache License 2.0 4 votes vote down vote up
protected MasterSlaveConnectionManager(Config cfg, UUID id) {
    this.id = id.toString();
    Version.logVersion();

    if (cfg.getTransportMode() == TransportMode.EPOLL) {
        if (cfg.getEventLoopGroup() == null) {
            this.group = new EpollEventLoopGroup(cfg.getNettyThreads(), new DefaultThreadFactory("redisson-netty"));
        } else {
            this.group = cfg.getEventLoopGroup();
        }

        this.socketChannelClass = EpollSocketChannel.class;
        if (PlatformDependent.isAndroid()) {
            this.resolverGroup = DefaultAddressResolverGroup.INSTANCE;
        } else {
            this.resolverGroup = cfg.getAddressResolverGroupFactory().create(EpollDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
        }
    } else if (cfg.getTransportMode() == TransportMode.KQUEUE) {
        if (cfg.getEventLoopGroup() == null) {
            this.group = new KQueueEventLoopGroup(cfg.getNettyThreads(), new DefaultThreadFactory("redisson-netty"));
        } else {
            this.group = cfg.getEventLoopGroup();
        }

        this.socketChannelClass = KQueueSocketChannel.class;
        if (PlatformDependent.isAndroid()) {
            this.resolverGroup = DefaultAddressResolverGroup.INSTANCE;
        } else {
            this.resolverGroup = cfg.getAddressResolverGroupFactory().create(KQueueDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
        }
    } else {
        if (cfg.getEventLoopGroup() == null) {
            this.group = new NioEventLoopGroup(cfg.getNettyThreads(), new DefaultThreadFactory("redisson-netty"));
        } else {
            this.group = cfg.getEventLoopGroup();
        }

        this.socketChannelClass = NioSocketChannel.class;
        if (PlatformDependent.isAndroid()) {
            this.resolverGroup = DefaultAddressResolverGroup.INSTANCE;
        } else {
            this.resolverGroup = cfg.getAddressResolverGroupFactory().create(NioDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
        }
    }
    
    if (cfg.getExecutor() == null) {
        int threads = Runtime.getRuntime().availableProcessors() * 2;
        if (cfg.getThreads() != 0) {
            threads = cfg.getThreads();
        }
        executor = Executors.newFixedThreadPool(threads, new DefaultThreadFactory("redisson"));
    } else {
        executor = cfg.getExecutor();
    }

    this.cfg = cfg;
    this.codec = cfg.getCodec();
    this.commandExecutor = new CommandSyncService(this);
}
 
Example #8
Source File: MasterSlaveConnectionManager.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public CommandSyncService getCommandExecutor() {
    return commandExecutor;
}
 
Example #9
Source File: ConnectionManager.java    From redisson with Apache License 2.0 votes vote down vote up
CommandSyncService getCommandExecutor();