MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / main

Function main

example/session_pool/session_pool_example.go:41–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39var sessionPool client.SessionPool
40
41func main() {
42 flag.StringVar(&host, "host", "127.0.0.1", "--host=192.168.1.100")
43 flag.StringVar(&port, "port", "6667", "--port=6667")
44 flag.StringVar(&user, "user", "root", "--user=root")
45 flag.StringVar(&password, "password", "root", "--password=root")
46 flag.Parse()
47 config := &client.PoolConfig{
48 Host: host,
49 Port: port,
50 UserName: user,
51 Password: password,
52 }
53 sessionPool = client.NewSessionPool(config, 3, 60000, 60000, false)
54
55 defer sessionPool.Close()
56 //useNodeUrls()
57 setStorageGroup("root.ln1")
58 setStorageGroup("root.ln2")
59 deleteStorageGroups("root.ln1", "root.ln2")
60
61 createTimeseries("root.sg1.dev1.status")
62 deleteTimeseries("root.sg1.dev1.status")
63
64 createMultiTimeseries()
65 deleteTimeseries("root.sg1.dev1.temperature")
66
67 createAlignedTimeseries("root.sg1.dev1", []string{"status", "temperature"}, []string{"sts", "temp"})
68 deleteTimeseries("root.sg1.dev1.status")
69 deleteTimeseries("root.sg1.dev1.temperature")
70
71 insertStringRecord()
72 deleteTimeseries("root.ln.wf02.wt02.hardware")
73
74 insertRecord()
75 deleteTimeseries("root.sg1.dev1.status")
76
77 insertRecords()
78 deleteTimeseries("root.sg1.dev1.status")
79
80 insertTablet()
81
82 deleteTimeseries("root.ln.device1.restart_count", "root.ln.device1.price", "root.ln.device1.tick_count", "root.ln.device1.temperature", "root.ln.device1.description", "root.ln.device1.status")
83 insertTablets()
84 deleteTimeseries("root.ln.device1.restart_count", "root.ln.device1.price", "root.ln.device1.tick_count", "root.ln.device1.temperature", "root.ln.device1.description", "root.ln.device1.status")
85
86 insertRecord()
87 deleteData()
88
89 setTimeZone()
90 if tz, err := getTimeZone(); err == nil {
91 fmt.Printf("TimeZone: %s\n", tz)
92 } else {
93 fmt.Printf("getTimeZone ERROR: %v\n", err)
94 }
95
96 executeStatement()
97 executeQueryStatement("select count(s3) from root.sg1.dev1")
98 executeRawDataQuery()

Callers

nothing calls this directly

Calls 15

NewSessionPoolFunction · 0.92
setStorageGroupFunction · 0.70
deleteStorageGroupsFunction · 0.70
createTimeseriesFunction · 0.70
deleteTimeseriesFunction · 0.70
createMultiTimeseriesFunction · 0.70
createAlignedTimeseriesFunction · 0.70
insertStringRecordFunction · 0.70
insertRecordFunction · 0.70
insertRecordsFunction · 0.70
insertTabletFunction · 0.70
insertTabletsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…