Skip to content

Commit a88d072

Browse files
revert YdbConnectionStringBuilder.cs
1 parent 8f0406d commit a88d072

File tree

5 files changed

+24
-65
lines changed

5 files changed

+24
-65
lines changed

src/Ydb.Sdk/src/Ado/YdbConnectionStringBuilder.cs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Security.Cryptography.X509Certificates;
44
using Microsoft.Extensions.Logging;
55
using Microsoft.Extensions.Logging.Abstractions;
6-
using Ydb.Sdk.Ado.Internal;
76
using Ydb.Sdk.Auth;
87
using Ydb.Sdk.Pool;
98
using Ydb.Sdk.Transport;
@@ -30,8 +29,6 @@ private void InitDefaultValues()
3029
_port = YdbAdoDefaultSettings.Port;
3130
_database = YdbAdoDefaultSettings.Database;
3231
_maxSessionPool = SessionPoolDefaultSettings.MaxSessionPool;
33-
_minSessionPool = 0;
34-
_sessionIdleTimeout = 300;
3532
_useTls = YdbAdoDefaultSettings.UseTls;
3633
_connectTimeout = GrpcDefaultSettings.ConnectTimeoutSeconds;
3734
_keepAlivePingDelay = GrpcDefaultSettings.KeepAlivePingSeconds;
@@ -126,40 +123,6 @@ public int MaxSessionPool
126123

127124
private int _maxSessionPool;
128125

129-
public int MinSessionPool
130-
{
131-
get => _minSessionPool;
132-
set
133-
{
134-
if (value <= 0)
135-
{
136-
throw new ArgumentOutOfRangeException(nameof(value), value, "Invalid min session pool: " + value);
137-
}
138-
139-
_minSessionPool = value;
140-
SaveValue(nameof(MinSessionPool), value);
141-
}
142-
}
143-
144-
private int _minSessionPool;
145-
146-
public int SessionIdleTimeout
147-
{
148-
get => _sessionIdleTimeout;
149-
set
150-
{
151-
if (value < 0)
152-
{
153-
throw new ArgumentOutOfRangeException(nameof(value), value, "Invalid session idle timeout: " + value);
154-
}
155-
156-
_sessionIdleTimeout = value;
157-
SaveValue(nameof(SessionIdleTimeout), value);
158-
}
159-
}
160-
161-
private int _sessionIdleTimeout;
162-
163126
public bool UseTls
164127
{
165128
get => _useTls;

src/Ydb.Sdk/src/Services/Query/SessionPool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ protected override async Task<Session> CreateSession(
8181

8282
if (stream.Current.Status.IsNotSuccess())
8383
{
84-
completeTask.SetException(YdbException.FromServer(stream.Current.Status, stream.Current.Issues));
84+
completeTask.SetException(YdbException.FromServer(stream.Current.Status, stream.Current.Issues));
8585
}
86-
86+
8787
completeTask.SetResult();
8888

8989
try

src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/Pool/EndpointPoolTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public class EndpointPoolTests
1010
{
1111
private static readonly ImmutableArray<EndpointSettings> EndpointSettingsList =
1212
[
13-
new EndpointSettings(1, "n1.ydb.tech", "MAN"),
14-
new EndpointSettings(2, "n2.ydb.tech", "VLA"),
15-
new EndpointSettings(3, "n3.ydb.tech", "SAS"),
16-
new EndpointSettings(4, "n4.ydb.tech", "SAS"),
17-
new EndpointSettings(5, "n5.ydb.tech", "VLA")
13+
new(1, "n1.ydb.tech", "MAN"),
14+
new(2, "n2.ydb.tech", "VLA"),
15+
new(3, "n3.ydb.tech", "SAS"),
16+
new(4, "n4.ydb.tech", "SAS"),
17+
new(5, "n5.ydb.tech", "VLA")
1818
];
1919

2020
public class MockRandomUnitTests

src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/YdbConnectionStringBuilderTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public void InitDefaultValues_WhenEmptyConstructorInvoke_ReturnDefaultConnection
1313
Assert.Equal("localhost", ydbConnectionStringBuilder.Host);
1414
Assert.Equal("/local", ydbConnectionStringBuilder.Database);
1515
Assert.Equal(100, ydbConnectionStringBuilder.MaxSessionPool);
16-
Assert.Equal(0, ydbConnectionStringBuilder.MinSessionPool);
1716
Assert.Null(ydbConnectionStringBuilder.User);
1817
Assert.Null(ydbConnectionStringBuilder.Password);
1918
Assert.Equal(5, ydbConnectionStringBuilder.ConnectTimeout);
@@ -26,7 +25,6 @@ public void InitDefaultValues_WhenEmptyConstructorInvoke_ReturnDefaultConnection
2625
Assert.False(ydbConnectionStringBuilder.DisableDiscovery);
2726
Assert.False(ydbConnectionStringBuilder.DisableServerBalancer);
2827
Assert.Equal(5, ydbConnectionStringBuilder.CreateSessionTimeout);
29-
Assert.Equal(300, ydbConnectionStringBuilder.SessionIdleTimeout);
3028
Assert.False(ydbConnectionStringBuilder.UseTls);
3129
}
3230

@@ -73,8 +71,6 @@ public void InitConnectionStringBuilder_WhenExpectedKeys_ReturnUpdatedConnection
7371
Assert.True(connectionString.DisableDiscovery);
7472
Assert.True(connectionString.DisableServerBalancer);
7573
Assert.Equal(30, connectionString.CreateSessionTimeout);
76-
Assert.Equal(240, connectionString.SessionIdleTimeout);
77-
Assert.Equal(10, connectionString.MinSessionPool);
7874
Assert.Equal(50, connectionString.MaxSessionPool);
7975
}
8076

src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/YdbSchemaTests.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,23 @@ public async Task GetSchema_WhenAllTypesTable_ReturnAllTypes()
186186

187187
void CheckAllColumns(DataTable pDataTable, bool isNullableTable)
188188
{
189-
CheckColumn(pDataTable.Rows[0], "TimestampColumn", 0, isNullableTable);
190-
CheckColumn(pDataTable.Rows[1], "Int32Column", 1, isNullableTable);
191-
CheckColumn(pDataTable.Rows[2], "BoolColumn", 2, isNullableTable);
192-
CheckColumn(pDataTable.Rows[3], "Int64Column", 3, isNullableTable);
193-
CheckColumn(pDataTable.Rows[4], "Int16Column", 4, isNullableTable);
194-
CheckColumn(pDataTable.Rows[5], "Int8Column", 5, isNullableTable);
195-
CheckColumn(pDataTable.Rows[6], "FloatColumn", 6, isNullableTable);
196-
CheckColumn(pDataTable.Rows[7], "DoubleColumn", 7, isNullableTable);
197-
CheckColumn(pDataTable.Rows[8], "DefaultDecimalColumn", 8, isNullableTable, "Decimal(22, 9)");
198-
CheckColumn(pDataTable.Rows[9], "Uint8Column", 9, isNullableTable);
199-
CheckColumn(pDataTable.Rows[10], "Uint16Column", 10, isNullableTable);
200-
CheckColumn(pDataTable.Rows[11], "Uint32Column", 11, isNullableTable);
201-
CheckColumn(pDataTable.Rows[12], "Uint64Column", 12, isNullableTable);
202-
CheckColumn(pDataTable.Rows[13], "TextColumn", 13, isNullableTable);
203-
CheckColumn(pDataTable.Rows[14], "BytesColumn", 14, isNullableTable);
204-
CheckColumn(pDataTable.Rows[15], "DateColumn", 15, isNullableTable);
205-
CheckColumn(pDataTable.Rows[16], "DatetimeColumn", 16, isNullableTable);
189+
CheckColumn(pDataTable.Rows[0], "Int32Column", 0, isNullableTable);
190+
CheckColumn(pDataTable.Rows[1], "BoolColumn", 1, isNullableTable);
191+
CheckColumn(pDataTable.Rows[2], "Int64Column", 2, isNullableTable);
192+
CheckColumn(pDataTable.Rows[3], "Int16Column", 3, isNullableTable);
193+
CheckColumn(pDataTable.Rows[4], "Int8Column", 4, isNullableTable);
194+
CheckColumn(pDataTable.Rows[5], "FloatColumn", 5, isNullableTable);
195+
CheckColumn(pDataTable.Rows[6], "DoubleColumn", 6, isNullableTable);
196+
CheckColumn(pDataTable.Rows[7], "DefaultDecimalColumn", 7, isNullableTable, "Decimal(22, 9)");
197+
CheckColumn(pDataTable.Rows[8], "Uint8Column", 8, isNullableTable);
198+
CheckColumn(pDataTable.Rows[9], "Uint16Column", 9, isNullableTable);
199+
CheckColumn(pDataTable.Rows[10], "Uint32Column", 10, isNullableTable);
200+
CheckColumn(pDataTable.Rows[11], "Uint64Column", 11, isNullableTable);
201+
CheckColumn(pDataTable.Rows[12], "TextColumn", 12, isNullableTable);
202+
CheckColumn(pDataTable.Rows[13], "BytesColumn", 13, isNullableTable);
203+
CheckColumn(pDataTable.Rows[14], "DateColumn", 14, isNullableTable);
204+
CheckColumn(pDataTable.Rows[15], "DatetimeColumn", 15, isNullableTable);
205+
CheckColumn(pDataTable.Rows[16], "TimestampColumn", 16, isNullableTable);
206206
}
207207

208208
void CheckColumn(DataRow column, string columnName, int ordinal, bool isNullable, string? dataType = null)

0 commit comments

Comments
 (0)