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

Function reader_callback

src/sdk/python/sample.py:25–38  ·  view source on GitHub ↗

reader callback

(raw_reader)

Source from the content-addressed store, hash-verified

23
24
25def reader_callback(raw_reader):
26 """ reader callback """
27 reader = RowReader(raw_reader)
28 status = reader.GetStatus()
29 if status.GetReasonNumber() != Status.OK:
30 print(status.GetReasonString())
31 while not reader.Done():
32 row = reader.RowKey()
33 column = reader.Family() + ":" + reader.Qualifier()
34 timestamp = str(reader.Timestamp())
35 val = reader.Value()
36 print row + ":" + column + ":" + timestamp + ":" + val
37 reader.Next()
38 reader.Destroy()
39
40""" 用户需要确保回调执行时,read_callback仍然有效(例如没有因为过作用域被gc掉)"""
41read_callback = READER_CALLBACK(reader_callback)

Callers

nothing calls this directly

Calls 12

GetStatusMethod · 0.95
DoneMethod · 0.95
RowKeyMethod · 0.95
FamilyMethod · 0.95
QualifierMethod · 0.95
TimestampMethod · 0.95
ValueMethod · 0.95
NextMethod · 0.95
DestroyMethod · 0.95
RowReaderClass · 0.90
GetReasonNumberMethod · 0.80
GetReasonStringMethod · 0.80

Tested by

no test coverage detected