Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/Apache.IoTDB/SessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ public partial class SessionPool : IDisposable
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)
{
Expand Down Expand Up @@ -1388,12 +1390,13 @@ public async Task<int> 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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.IoTDB/TableSessionPool.Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 12 additions & 7 deletions src/Apache.IoTDB/TableSessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -66,7 +70,8 @@ public void OpenDebugMode(Action<ILoggingBuilder> configure)
sessionPool.OpenDebugMode(configure);
}

public async Task Close() {
public async Task Close()
{
await sessionPool.Close();
}
}
Loading