기본적으로 키 목록으로 레코드를 검색합니다. 이것은 Aerospike의 배치 판독 작업입니다. Aerospike의 모든 언어 클라이언트는이 기능을 갖추고 있어야합니다.
from __future__ import print_function
import aerospike
from aerospike.exception import AerospikeError
import sys
config = { 'hosts': [('127.0.0.1', 3000)] }
client = aerospike.client(config).connect()
try:
# assume the fourth key has no matching record
keys = [
('test', 'demo', '1'),
('test', 'demo', '2'),
('test', 'demo', '3'),
('test', 'demo', '4')
]
records = client.get_many(keys)
print records
except AerospikeError as e:
print("Error: {0} [{1}]".format(e.msg, e.code))
sys.exit(1)
finally:
client.close()
마찬가지로, 자바 클라이언트에 AerospikeClient.get() 방법은 키의 목록을 수행 할 수 있습니다
예를 들어, 파이썬 클라이언트이는 Client.get_many 방법이다.
나는 완전히 그 질문을 오해했다! 그러나 별도의 문제로 abc : 123, abc : 456, abc : 234 ... xyz : 123, xyz : 456 등과 같은 복합 키를 가지고 있다고 가정하고 abc : * 키를 가진 모든 레코드를 원했습니다. , 빈에 키를 저장 한 경우 ver 3.12.1 이상으로 술어 필터링을 사용할 수 있습니다. 권리? – pgupta
프리디 케이트 필터링은 빈 정보를 조사하고 일치하는 레코드를 빠르게 찾을 수있는 좋은 방법입니다. –