This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-client-csharp.git


The following commit(s) were added to refs/heads/main by this push:
     new 312fdf9  style(Table): format (#27)
312fdf9 is described below

commit 312fdf9b6de3bdeca8f715001d33652a4ef132db
Author: CritasWang <[email protected]>
AuthorDate: Wed Mar 19 15:34:26 2025 +0800

    style(Table): format (#27)
---
 src/Apache.IoTDB/SessionPool.cs              | 13 ++++++++-----
 src/Apache.IoTDB/TableSessionPool.Builder.cs |  2 +-
 src/Apache.IoTDB/TableSessionPool.cs         | 19 ++++++++++++-------
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/Apache.IoTDB/SessionPool.cs b/src/Apache.IoTDB/SessionPool.cs
index 2d78048..cb16f70 100644
--- a/src/Apache.IoTDB/SessionPool.cs
+++ b/src/Apache.IoTDB/SessionPool.cs
@@ -64,11 +64,13 @@ namespace Apache.IoTDB
     public delegate Task<TResult> AsyncOperation<TResult>(Client client);
 
 
+    [Obsolete("This method is deprecated, please use new 
SessionPool.Builder().")]
     public SessionPool(string host, int port, int poolSize)
                     : this(host, port, "root", "root", 1024, "UTC+08:00", 
poolSize, true, 60)
     {
     }
 
+    [Obsolete(" This method is deprecated, please use new 
SessionPool.Builder().")]
     public SessionPool(string host, int port, string username, string password)
                     : this(host, port, username, password, 1024, "UTC+08:00", 
8, true, 60)
     {
@@ -1388,12 +1390,13 @@ namespace Apache.IoTDB
               // all client should switch to the same database
               foreach (var c in _clients.ClientQueue)
               {
-                try{
-                if (c != client)
+                try
                 {
-                  var switchReq = new TSExecuteStatementReq(c.SessionId, sql, 
c.StatementId);
-                  await c.ServiceClient.executeUpdateStatementAsync(switchReq);
-                }
+                  if (c != client)
+                  {
+                    var switchReq = new TSExecuteStatementReq(c.SessionId, 
sql, c.StatementId);
+                    await 
c.ServiceClient.executeUpdateStatementAsync(switchReq);
+                  }
                 }
                 catch (Exception e)
                 {
diff --git a/src/Apache.IoTDB/TableSessionPool.Builder.cs 
b/src/Apache.IoTDB/TableSessionPool.Builder.cs
index f1321c9..0c32f4b 100644
--- a/src/Apache.IoTDB/TableSessionPool.Builder.cs
+++ b/src/Apache.IoTDB/TableSessionPool.Builder.cs
@@ -89,7 +89,7 @@ public partial class TableSessionPool
       return this;
     }
 
-    public Builder SetSetConnectionTimeoutInMs(int timeout)
+    public Builder SetConnectionTimeoutInMs(int timeout)
     {
       _connectionTimeoutInMs = timeout;
       return this;
diff --git a/src/Apache.IoTDB/TableSessionPool.cs 
b/src/Apache.IoTDB/TableSessionPool.cs
index 589e989..ddc977f 100644
--- a/src/Apache.IoTDB/TableSessionPool.cs
+++ b/src/Apache.IoTDB/TableSessionPool.cs
@@ -37,27 +37,31 @@ public partial class TableSessionPool
 
   public async Task Open(bool enableRpcCompression, CancellationToken 
cancellationToken = default)
   {
-      await sessionPool.Open(enableRpcCompression, cancellationToken);
+    await sessionPool.Open(enableRpcCompression, cancellationToken);
   }
 
   public async Task Open(CancellationToken cancellationToken = default)
   {
-      await sessionPool.Open(cancellationToken);
+    await sessionPool.Open(cancellationToken);
   }
 
-  public async Task<int> InsertAsync(Tablet tablet) {
+  public async Task<int> InsertAsync(Tablet tablet)
+  {
     return await sessionPool.InsertRelationalTabletAsync(tablet);
   }
 
-  public async Task<int> ExecuteNonQueryStatementAsync(string sql){
+  public async Task<int> ExecuteNonQueryStatementAsync(string sql)
+  {
     return await sessionPool.ExecuteNonQueryStatementAsync(sql);
   }
 
-  public  async Task<SessionDataSet> ExecuteQueryStatementAsync(string sql){
+  public async Task<SessionDataSet> ExecuteQueryStatementAsync(string sql)
+  {
     return await sessionPool.ExecuteQueryStatementAsync(sql);
   }
 
-  public  async Task<SessionDataSet> ExecuteQueryStatementAsync(string sql, 
long timeoutInMs) {
+  public async Task<SessionDataSet> ExecuteQueryStatementAsync(string sql, 
long timeoutInMs)
+  {
     return await sessionPool.ExecuteQueryStatementAsync(sql, timeoutInMs);
   }
 
@@ -66,7 +70,8 @@ public partial class TableSessionPool
     sessionPool.OpenDebugMode(configure);
   }
 
-  public  async Task Close() {
+  public async Task Close()
+  {
     await sessionPool.Close();
   }
 }

Reply via email to