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

Function main

src/sdk/python/sample.py:44–85  ·  view source on GitHub ↗

REQUIRES: tera.flag in current work directory; table `oops' was created

()

Source from the content-addressed store, hash-verified

42
43
44def main():
45 """ REQUIRES:
46 tera.flag in current work directory;
47 table `oops' was created
48 """
49 try:
50 client = Client("./tera.flag", "pysdk")
51 except TeraSdkException as e:
52 print(e.reason)
53 return
54 try:
55 table = client.OpenTable("oops")
56 except TeraSdkException as e:
57 print(e.reason)
58 return
59
60 # sync put
61 sync_put(table)
62
63 # sync get
64 sync_get(table)
65
66 # sync put batch
67 sync_put_batch(table)
68
69 # sync get batch
70 sync_get_batch(table)
71
72 # scan (stream)
73 scan(table)
74
75 # async put
76 async_put(table)
77
78 # async get
79 async_get(table)
80
81 put_get_with_timestamp(table)
82
83 table.Close()
84 client.Close()
85 print("main() done\n")
86
87
88def sync_put(table):

Callers 1

sample.pyFile · 0.70

Calls 12

OpenTableMethod · 0.95
CloseMethod · 0.95
ClientClass · 0.90
sync_putFunction · 0.85
sync_getFunction · 0.85
sync_put_batchFunction · 0.85
sync_get_batchFunction · 0.85
scanFunction · 0.85
async_putFunction · 0.85
async_getFunction · 0.85
put_get_with_timestampFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected