2010-08-11 3 views
2

카산드라를 테스트하기위한 테스트 프로그램을 작성했으며 데이터를 읽는 데 문제가있었습니다. 카산드라가 때때로 다른 열쇠를 가져가는 것 같습니다. 대신왜 카산드라는 바이트 키 (Lazyboy 포함)로 이상하게 작동합니까?

[email protected]:/mnt/hgfs/TestMX# python test.py 
TestItem: {'test': 'foo'} 
TestItem: {'test': 'foo'} 

:

from lazyboy import * 
from lazyboy.key import Key 
import uuid 
import random 

class TestItemKey(Key): 
    def __init__(self, key=None): 
    Key.__init__(self, "TestMX", "TestCF", key) 

class TestItem(record.Record): 
    def __init__(self, *args, **kwargs): 
     record.Record.__init__(self, *args, **kwargs) 
     self.key = TestItemKey(uuid.uuid1().bytes) 

connection.add_pool('TestMX', ['localhost:9160']) 

t1 = TestItem({'test':'foo'}) 
t1.key = TestItemKey(uuid.UUID('3cead15a-a54e-11df-87a2-000c298d2724').bytes) 
t2 = TestItem({'test':'bar'}) 
t2.key = TestItemKey(uuid.UUID('3cebc15a-a54e-11df-87a2-000c298d2724').bytes) 
t1.save() 
t2.save() 

print TestItem().load(t1.key.clone()) 
print TestItem().load(t2.key.clone()) 

다음

이 스크립트의 출력 (선택된 UUID가이 사람 일으키는 문제의 예입니다) : 여기

내 테스트 프로그램입니다 예상 결과 :

[email protected]:/mnt/hgfs/TestMX# python test.py 
TestItem: {'test': 'foo'} 
TestItem: {'test': 'bar'} 
스크립트가 보통 때때로되지 않은 다른 randomely-선택의 UUID와 잘 작동하지만, 617,451,515,

주 ...

+0

저는 Lazyboy 대신 Pycassa로 시도했는데 정확한 결과와 함께 추가 할 것입니다. – Pierre

+0

t1.key와 t2.key가 같거나 뭔가 근본적인 것이 누락 되었습니까? – Schildmeijer

+0

그들은 매우 가깝지만 같은 것은 아닙니다. 첫 번째는 '3cead ...', 두 번째는 '3cebc ...'입니다. – Pierre

답변

2

, 당신은 0.6 지점에 고정되어 0.6.5에있을 것입니다 https://issues.apache.org/jira/browse/CASSANDRA-1235을 치는 것 같은 많은 소리 다음 안정적인 릴리스.

+0

Tanks. 특히 두 개의 키에 대한 문제를 해결했습니다. 그러나'936a87e2-a5fc-11df-82c1-000c29f73b23'과'936ae9e4-a5fc-11df-82c1-000c29f73b23'과 같이 작동하지 않는 것들을 찾을 수 있습니다. 같은 결과 ... – Pierre

+0

괜찮 았으면 다른 버그를 쳤을 것입니다 (irC#cassandra에 대한 토론 후 덧붙인 설명) – Schildmeijer

+0

예. 고맙습니다 :) – Pierre

관련 문제