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 @@ public partial class SessionPool : IDisposable public delegate Task AsyncOperation(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 @@ public async Task ExecuteNonQueryStatementAsync(string sql) // 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 Builder SetEnableRpcCompression(bool enableRpcCompression) 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 InsertAsync(Tablet tablet) { + public async Task InsertAsync(Tablet tablet) + { return await sessionPool.InsertRelationalTabletAsync(tablet); } - public async Task ExecuteNonQueryStatementAsync(string sql){ + public async Task ExecuteNonQueryStatementAsync(string sql) + { return await sessionPool.ExecuteNonQueryStatementAsync(sql); } - public async Task ExecuteQueryStatementAsync(string sql){ + public async Task ExecuteQueryStatementAsync(string sql) + { return await sessionPool.ExecuteQueryStatementAsync(sql); } - public async Task ExecuteQueryStatementAsync(string sql, long timeoutInMs) { + public async Task ExecuteQueryStatementAsync(string sql, long timeoutInMs) + { return await sessionPool.ExecuteQueryStatementAsync(sql, timeoutInMs); } @@ -66,7 +70,8 @@ public void OpenDebugMode(Action configure) sessionPool.OpenDebugMode(configure); } - public async Task Close() { + public async Task Close() + { await sessionPool.Close(); } }