[GitHub] [iotdb-client-go] qiaojialin merged pull request #75: [To rel/0.13] Add SessionPool and example

2023-02-17 Thread via GitHub


qiaojialin merged PR #75:
URL: https://github.com/apache/iotdb-client-go/pull/75


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[jira] [Assigned] (IOTDB-5552) No permissions when a non-root user inserts data into a timeseries with illegal path

2023-02-17 Thread Hongyin Zhang (Jira)


 [ 
https://issues.apache.org/jira/browse/IOTDB-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hongyin Zhang reassigned IOTDB-5552:


Assignee: Yukun Zhou  (was: Hongyin Zhang)

> No permissions when a non-root user inserts data into a timeseries with 
> illegal path
> 
>
> Key: IOTDB-5552
> URL: https://issues.apache.org/jira/browse/IOTDB-5552
> Project: Apache IoTDB
>  Issue Type: Bug
>Affects Versions: 1.0.0
>Reporter: Haonan Hou
>Assignee: Yukun Zhou
>Priority: Major
> Attachments: image-2023-02-17-18-21-36-717.png, 
> image-2023-02-17-18-48-41-530.png
>
>
> !image-2023-02-17-18-21-36-717.png|width=556,height=422!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IOTDB-5552) No permissions when a non-root user inserts data into a timeseries with illegal path

2023-02-17 Thread Hongyin Zhang (Jira)


[ 
https://issues.apache.org/jira/browse/IOTDB-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690347#comment-17690347
 ] 

Hongyin Zhang commented on IOTDB-5552:
--

When I try in root user, it also throws an exception but was a metadata 
Exception. So I think this path is not a legal path for metadata module

> No permissions when a non-root user inserts data into a timeseries with 
> illegal path
> 
>
> Key: IOTDB-5552
> URL: https://issues.apache.org/jira/browse/IOTDB-5552
> Project: Apache IoTDB
>  Issue Type: Bug
>Affects Versions: 1.0.0
>Reporter: Haonan Hou
>Assignee: Hongyin Zhang
>Priority: Major
> Attachments: image-2023-02-17-18-21-36-717.png, 
> image-2023-02-17-18-48-41-530.png
>
>
> !image-2023-02-17-18-21-36-717.png|width=556,height=422!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IOTDB-5552) No permissions when a non-root user inserts data into a timeseries with illegal path

2023-02-17 Thread Hongyin Zhang (Jira)


[ 
https://issues.apache.org/jira/browse/IOTDB-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690344#comment-17690344
 ] 

Hongyin Zhang commented on IOTDB-5552:
--

!image-2023-02-17-18-48-41-530.png|width=1807,height=84!

> No permissions when a non-root user inserts data into a timeseries with 
> illegal path
> 
>
> Key: IOTDB-5552
> URL: https://issues.apache.org/jira/browse/IOTDB-5552
> Project: Apache IoTDB
>  Issue Type: Bug
>Affects Versions: 1.0.0
>Reporter: Haonan Hou
>Assignee: Hongyin Zhang
>Priority: Major
> Attachments: image-2023-02-17-18-21-36-717.png, 
> image-2023-02-17-18-48-41-530.png
>
>
> !image-2023-02-17-18-21-36-717.png|width=556,height=422!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (IOTDB-5553) Got NPE while using count_if and group by level

2023-02-17 Thread Yuan Tian (Jira)
Yuan Tian created IOTDB-5553:


 Summary: Got NPE while using count_if and group by level
 Key: IOTDB-5553
 URL: https://issues.apache.org/jira/browse/IOTDB-5553
 Project: Apache IoTDB
  Issue Type: Bug
  Components: Core/Query
Reporter: Yuan Tian
Assignee: 李伟豪


You can use the following sqls to reproduce:


insert into root.sg.d1(time,s1,s2,vehicle_status) aligned values(1,1,1,1); 
insert into root.sg.d1(time,s1,s2,vehicle_status) aligned values(3,2,2,1); 
insert into root.sg.d1(time,s1,s2,vehicle_status) aligned values(10,10,10,1); 
insert into root.sg.d1(time,s1,s2) aligned values(11,10,10); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(12,12,12,0); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(30,12,12,0); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(35,12,12,0); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(36,12,12,1); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(40,12,12,1); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(41,12,12,0); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(10,12,12,0); 
insert into root.sg.d1(time,s1,s2,vehicle_status) aligned 
values(11,12,12,1); insert into root.sg.d1(time,s1,s2,vehicle_status) 
aligned values(19,12,12,1); insert into root.sg.d1(time,s1,s2) aligned 
values(100010,12,12); insert into root.sg.d1(time,s1,s2,vehicle_status) 
aligned values(100011,12,12,1); insert into 
root.sg.d1(time,s1,s2,vehicle_status) aligned values(100012,12,12,1); 
insert into root.sg.d2(time,s1,s2,vehicle_status) aligned values(1,1,1,1); 
insert into root.sg.d2(time,s1,s2,vehicle_status) aligned values(3,2,2,1); 
insert into root.sg.d2(time,s1,s2,vehicle_status) aligned values(10,10,10,1); 
insert into root.sg.d2(time,s1,s2) aligned values(11,10,10); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(12,12,12,0); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(30,12,12,0); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(35,12,12,0); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(36,12,12,1); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(40,12,12,1); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(41,12,12,0); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(10,12,12,0); 
insert into root.sg.d2(time,s1,s2,vehicle_status) aligned 
values(11,12,12,1); insert into root.sg.d2(time,s1,s2,vehicle_status) 
aligned values(19,12,12,1); insert into root.sg.d2(time,s1,s2) aligned 
values(100010,12,12); insert into root.sg.d2(time,s1,s2,vehicle_status) 
aligned values(100011,12,12,1); insert into 
root.sg.d2(time,s1,s2,vehicle_status) aligned values(100012,12,12,1); 
insert into root.sg.d3(time,s1,s2,vehicle_status) aligned values(1,1,1,1); 
insert into root.sg.d3(time,s1,s2,vehicle_status) aligned values(3,2,2,1); 
insert into root.sg.d3(time,s1,s2,vehicle_status) aligned values(10,10,10,1); 
insert into root.sg.d3(time,s1,s2) aligned values(11,10,10); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(12,12,12,0); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(30,12,12,0); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(35,12,12,0); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(36,12,12,1); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(40,12,12,1); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(41,12,12,0); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(10,12,12,0); 
insert into root.sg.d3(time,s1,s2,vehicle_status) aligned 
values(11,12,12,1); insert into root.sg.d3(time,s1,s2,vehicle_status) 
aligned values(19,12,12,1); insert into root.sg.d3(time,s1,s2) aligned 
values(100010,12,12); insert into root.sg.d3(time,s1,s2,vehicle_status) 
aligned values(100011,12,12,1); insert into 
root.sg.d3(time,s1,s2,vehicle_status) aligned values(100012,12,12,1); 
insert into root.sg.d4(time,s1,s2,vehicle_status) aligned values(1,1,1,1); 
insert into root.sg.d4(time,s1,s2,vehicle_status) aligned values(3,2,2,1); 
insert into root.sg.d4(time,s1,s2,vehicle_status) aligned values(10,10,10,1); 
insert into root.sg.d4(time,s1,s2) aligned values(11,10,10); insert into 
root.sg.d4(time,s1,s2,vehicle_status) aligned values(12,12,12,0); insert into 
root.sg.d4(time,s1,s2,vehicle_status) aligned values(30,12,12,0); insert into 
root.sg.d4(time,s1,s2,vehicle_status) aligned values(35,12,12,0); insert into 
root.sg.d4(time,s1,s2,vehicle_status) aligned values(36,12,12,1); insert into 
root.sg.d4(time,s1,s2,vehicle_status) aligned values(40,12,12,1); insert into 
root.sg.d4(time,s1,s2,vehicle_status) ali

[jira] [Assigned] (IOTDB-5552) No permissions when a non-root user inserts data into a timeseries with illegal path

2023-02-17 Thread Haonan Hou (Jira)


 [ 
https://issues.apache.org/jira/browse/IOTDB-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Haonan Hou reassigned IOTDB-5552:
-

Assignee: Hongyin Zhang

> No permissions when a non-root user inserts data into a timeseries with 
> illegal path
> 
>
> Key: IOTDB-5552
> URL: https://issues.apache.org/jira/browse/IOTDB-5552
> Project: Apache IoTDB
>  Issue Type: Bug
>Affects Versions: 1.0.0
>Reporter: Haonan Hou
>Assignee: Hongyin Zhang
>Priority: Major
> Attachments: image-2023-02-17-18-21-36-717.png
>
>
> !image-2023-02-17-18-21-36-717.png|width=556,height=422!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (IOTDB-5552) No permissions when a non-root user inserts data into a timeseries with illegal path

2023-02-17 Thread Haonan Hou (Jira)
Haonan Hou created IOTDB-5552:
-

 Summary: No permissions when a non-root user inserts data into a 
timeseries with illegal path
 Key: IOTDB-5552
 URL: https://issues.apache.org/jira/browse/IOTDB-5552
 Project: Apache IoTDB
  Issue Type: Bug
Affects Versions: 1.0.0
Reporter: Haonan Hou
 Attachments: image-2023-02-17-18-21-36-717.png

!image-2023-02-17-18-21-36-717.png|width=556,height=422!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[GitHub] [iotdb-client-go] qiaojialin commented on a diff in pull request #75: [To rel/0.13] Add SessionPool and example

2023-02-17 Thread via GitHub


qiaojialin commented on code in PR #75:
URL: https://github.com/apache/iotdb-client-go/pull/75#discussion_r1109504691


##
client/sessionpool.go:
##
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package client
+
+import (
+   "errors"
+   "log"
+   "runtime"
+   "time"
+)
+
+var errTimeout = errors.New("get session timeout")
+var errPoolClosed = errors.New("sessionPool has closed")
+var defaultMultiple = 5
+
+type SessionPool struct {
+   config  *PoolConfig
+   maxSize int
+   waitToGetSessionTimeoutInMs int
+   enableCompression   bool
+   connectionTimeoutInMs   int
+   ch  chan Session
+   sem chan int8
+}
+
+type PoolConfig struct {
+   Hoststring
+   Portstring
+   NodeUrls[]string
+   UserNamestring
+   Passwordstring
+   FetchSize   int32
+   TimeZonestring
+   ConnectRetryMax int
+}
+
+func NewSessionPool(conf *PoolConfig, maxSize, connectionTimeoutInMs, 
waitToGetSessionTimeoutInMs int,
+   enableCompression bool) SessionPool {
+   if maxSize <= 0 {
+   maxSize = runtime.NumCPU() * defaultMultiple
+   }
+   var ch = make(chan Session, maxSize)
+   var sem = make(chan int8, maxSize)
+   return SessionPool{
+   config:  conf,
+   maxSize: maxSize,
+   waitToGetSessionTimeoutInMs: waitToGetSessionTimeoutInMs,
+   connectionTimeoutInMs:   connectionTimeoutInMs,
+   enableCompression:   enableCompression,
+   ch:  ch,
+   sem: sem,
+   }
+}
+
+func (spool *SessionPool) GetSession() (session Session, err error) {
+   for {
+   select {
+   case spool.sem <- 1:
+   select {
+   case session, ok := <-spool.ch:
+   if ok {
+   return session, nil
+   } else {
+   log.Println("sessonpool has closed")

Review Comment:
   ```suggestion
log.Println("sessionpool has closed")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [iotdb-client-go] citrusreticulata commented on a diff in pull request #75: [To rel/0.13] Add SessionPool and example

2023-02-17 Thread via GitHub


citrusreticulata commented on code in PR #75:
URL: https://github.com/apache/iotdb-client-go/pull/75#discussion_r1109436680


##
client/sessionpool.go:
##
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package client
+
+import (
+   "errors"
+   "log"
+   "runtime"
+   "time"
+)
+
+var errTimeout = errors.New("get session timeout")
+var errPoolClosed = errors.New("sessionPool has closed")
+var defaultMultiple = 5
+
+type SessionPool struct {
+   config  *PoolConfig
+   maxSize int
+   waitToGetSessionTimeoutInMs int
+   enableCompression   bool
+   connectionTimeoutInMs   int
+   ch  chan Session
+   sem chan int8
+}
+
+type PoolConfig struct {
+   Hoststring
+   Portstring
+   NodeUrls[]string
+   UserNamestring
+   Passwordstring
+   FetchSize   int32
+   TimeZonestring
+   ConnectRetryMax int
+}
+
+func NewSessionPool(conf *PoolConfig, maxSize, connectionTimeoutInMs, 
waitToGetSessionTimeoutInMs int,
+   enableCompression bool) SessionPool {
+   if maxSize <= 0 {
+   maxSize = runtime.NumCPU() * defaultMultiple
+   }
+   var ch = make(chan Session, maxSize)
+   var sem = make(chan int8, maxSize)
+   return SessionPool{
+   config:  conf,
+   maxSize: maxSize,
+   waitToGetSessionTimeoutInMs: waitToGetSessionTimeoutInMs,
+   connectionTimeoutInMs:   connectionTimeoutInMs,
+   enableCompression:   enableCompression,
+   ch:  ch,
+   sem: sem,
+   }
+}
+
+func (spool *SessionPool) GetSession() (session Session, err error) {
+   for {
+   select {
+   case spool.sem <- 1:
+   select {
+   case session, ok := <-spool.ch:
+   if ok {
+   return session, nil
+   } else {
+   log.Println("sessonpool has closed")

Review Comment:
   ```suggestion
log.Println("sessionpool has closed")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org