MCPcopy Create free account
hub / github.com/baidu/tera / sync_get_batch

Function sync_get_batch

src/sdk/python/sample.py:132–153  ·  view source on GitHub ↗

sync_get_batch

(table)

Source from the content-addressed store, hash-verified

130
131
132def sync_get_batch(table):
133 """ sync_get_batch """
134 print("\nsync get batch")
135 s1 = long(time.time() * 1000)
136 reader_list = list()
137 for i in range(1, 1001):
138 reader = table.NewRowReader(str(i))
139 # read column cf0:qu0
140 reader.AddColumn("cf0", "qu0")
141 reader_list.append(reader)
142 table.BatchGet(reader_list)
143 for r in reader_list:
144 status = r.GetStatus()
145 if status.GetReasonNumber() != Status.OK:
146 print("get/read failed for key<" + r.RowKey()
147 + "> due to:" + status.GetReasonString())
148 else:
149 # print(r.Value())
150 pass
151 r.Destroy()
152 e1 = long(time.time() * 1000)
153 print(str(e1 - s1) + " ms")
154
155
156def async_put(table):

Callers 1

mainFunction · 0.85

Calls 8

BatchGetMethod · 0.80
GetReasonNumberMethod · 0.80
GetReasonStringMethod · 0.80
NewRowReaderMethod · 0.45
AddColumnMethod · 0.45
GetStatusMethod · 0.45
RowKeyMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected