2016-12-12 1 views

답변

2

"파티션 별"이 무슨 뜻인지 잘 모르겠지만 청크로 읽고 싶다면 SSCAN은 (는) 친구입니다.

SSCAN key cursor [MATCH pattern] [COUNT count] 

당신은 커서에서 0의 값으로 시작하고, 당신은 다음 커서 ID와 COUNT 요소마다 얻을.

# let's add 14 elements to a set 
127.0.0.1:6379> SADD myset e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 
(integer) 14 

# now let's scan it from the "beginning" (notice that it's not ordered) 
127.0.0.1:6379> SSCAN myset 0 COUNT 10 
1) "3" 
2) 1) "e8" 
    2) "e10" 
    3) "e2" 
    4) "e11" 
    5) "e7" 
    6) "e3" 
    7) "e14" 
    8) "e4" 
    9) "e6" 
    10) "e9" 

# we got a cursor id of 3, let's give that to the next iteration! 
127.0.0.1:6379> SSCAN myset 3 COUNT 10 
1) "0" 
2) 1) "e13" 
    2) "e12" 
    3) "e5" 
    4) "e1" 

# now we got a cursor id of 0, meaning we're done 
+0

커서가 뭐죠이다있을 때 아무것도 당신이 예를 들어 0

의 커서를 얻을 읽을 수 없습니다? – Griboedov

+0

나는 파이썬에서 매개 변수를 받아들이는 함수를 가지고있다 : self, name, cursor, match, count. 그리고 나는'앱'을 설정했다. 매개 변수를 어떻게 써야합니까? – Griboedov

+0

맞습니까? 'items = r.sscan ("apps", 400000, None, 700000)'? – Griboedov

관련 문제