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

Function useNodeUrls

example/session_pool/session_pool_example.go:129–145  ·  view source on GitHub ↗

If your IoTDB is a cluster version, you can use the following code for session pool connection

()

Source from the content-addressed store, hash-verified

127
128// If your IoTDB is a cluster version, you can use the following code for session pool connection
129func useNodeUrls() {
130
131 config := &client.PoolConfig{
132 UserName: user,
133 Password: password,
134 NodeUrls: strings.Split("127.0.0.1:6667,127.0.0.1:6668", ","),
135 }
136 sessionPool = client.NewSessionPool(config, 3, 60000, 60000, false)
137 defer sessionPool.Close()
138 session, err := sessionPool.GetSession()
139 defer sessionPool.PutBack(session)
140 if err != nil {
141 log.Print(err)
142 return
143 }
144
145}
146
147func setStorageGroup(sg string) {
148 session, err := sessionPool.GetSession()

Callers

nothing calls this directly

Calls 4

NewSessionPoolFunction · 0.92
PutBackMethod · 0.80
CloseMethod · 0.65
GetSessionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…