当前位置 : 主页 > 网络编程 > 其它编程 >

org.springframework.data.redis.connection.RedisConnection.scan()方法的使用及代码示例

来源:互联网 收集:自由互联 发布时间:2023-07-02
本文整理了Java中org.springframework.data.redis.connection.RedisConnection.scan方法的一些代码示例,展示 本文整理了Java中org.springframework.data.redis.connection.RedisConnection.scan方法的一些代码示例,展示了
本文整理了Java中org.springframework.data.redis.connection.RedisConnection.scan方法的一些代码示例,展示

本文整理了Java中org.springframework.data.redis.connection.RedisConnection.scan方法的一些代码示例,展示了RedisConnection.scan的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RedisConnection.scan方法的具体详情如下:包路径:org.springframework.data.redis.connection.RedisConnection类名称:RedisConnection方法名:scan

RedisConnection.scan介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Overridepublic Cursor scan(ScanOptions options) { return this.delegate.scan(options);}

代码示例来源:origin: crossoverJie/cim

@Overridepublic Map loadRouteRelated() { Map routes = new HashMap(64); RedisConnection cOnnection= redisTemplate.getConnectionFactory().getConnection(); ScanOptions optiOns= ScanOptions.scanOptions() .match(ROUTE_PREFIX + "*") .build(); Cursor scan = connection.scan(options); while (scan.hasNext()) { byte[] next = scan.next(); String key = new String(next, StandardCharsets.UTF_8); LOGGER.info("key={}", key); parseServerInfo(routes, key); } try { scan.close(); } catch (IOException e) { LOGGER.error("IOException",e); } return routes;}

代码示例来源:origin: apache/nifi

@Overridepublic long removeByPattern(final String regex) throws IOException { return withConnection(redisConnection -> { long deletedCount = 0; final List batchKeys = new ArrayList(); // delete keys in batches of 1000 using the cursor final Cursor cursor = redisConnection.scan(ScanOptions.scanOptions().count(100).match(regex).build()); while (cursor.hasNext()) { batchKeys.add(cursor.next()); if (batchKeys.size() == 1000) { deletedCount += redisConnection.del(getKeys(batchKeys)); batchKeys.clear(); } } // delete any left-over keys if some were added to the batch but never reached 1000 if (batchKeys.size() > 0) { deletedCount += redisConnection.del(getKeys(batchKeys)); batchKeys.clear(); } return deletedCount; });}

代码示例来源:origin: 1991wangliang/tx-lcn

@Overridepublic Cursor scan(ScanOptions options) { return redisConnection.scan(options);}

代码示例来源:origin: apache/servicemix-bundles

@Overridepublic Cursor scan(ScanOptions options) { return this.delegate.scan(options);}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Overridepublic Cursor scan(ScanOptions options) { return this.delegate.scan(options);}

代码示例来源:origin: xkcoding/spring-boot-demo

RedisConnectionFactory factory = stringRedisTemplate.getConnectionFactory();RedisConnection rc = factory.getConnection();Cursor cursor = rc.scan(options);

网友评论