static <T extends ScanCursor, K, V> Mono<T> clusterScan(StatefulRedisClusterConnectionImpl<K, V> connection,
            ScanCursor cursor, BiFunction<RedisKeyReactiveCommands<K, V>, ScanCursor, Mono<T>> scanFunction,
            ClusterScanSupport.ScanCursorMapper<Mono<T>> mapper) {

        List<String> nodeIds = ClusterScanSupport.getNodeIds(connection, cursor);
        String currentNodeId = ClusterScanSupport.getCurrentNodeId(cursor, nodeIds);
        ScanCursor continuationCursor = ClusterScanSupport.getContinuationCursor(cursor);

        AsyncClusterConnectionProvider connectionProvider = (AsyncClusterConnectionProvider) connection
                .getClusterDistributionChannelWriter().getClusterConnectionProvider();

        Mono<T> scanCursor = getMono(connectionProvider.<K, V> getConnectionAsync(Intent.WRITE, currentNodeId)).flatMap(
                conn -> scanFunction.apply(conn.reactive(), continuationCursor));
        return mapper.map(nodeIds, currentNodeId, scanCursor);
    }
static < T extends ScanCursor , K , V > Mono < T > clusterScan ( StatefulRedisClusterConnectionImpl < K , V > connection , ScanCursor cursor , BiFunction < RedisKeyReactiveCommands < K , V > , ScanCursor , Mono < T > > scanFunction , ClusterScanSupport . ScanCursorMapper < Mono < T > > mapper ) { List < String > nodeIds = ClusterScanSupport . getNodeIds ( connection , cursor ) ; String currentNodeId = ClusterScanSupport . getCurrentNodeId ( cursor , nodeIds ) ; ScanCursor continuationCursor = ClusterScanSupport . getContinuationCursor ( cursor ) ; AsyncClusterConnectionProvider connectionProvider = ( AsyncClusterConnectionProvider ) connection . getClusterDistributionChannelWriter ( ) . getClusterConnectionProvider ( ) ; Mono < T > scanCursor = getMono ( connectionProvider . < K , V > getConnectionAsync ( Intent . WRITE , currentNodeId ) ) . flatMap ( conn -> scanFunction . apply ( conn . reactive ( ) , continuationCursor ) ) ; return mapper . map ( nodeIds , currentNodeId , scanCursor ) ; }
Perform a SCAN in the cluster.