Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the performance of TableServiceClient.GetTableClient() #47406

Merged
merged 1 commit into from
Dec 5, 2024
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
1 change: 1 addition & 0 deletions sdk/tables/Azure.Data.Tables/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Bugs Fixed

### Other Changes
- Improved the performance of `TableServiceClient.GetTableClient()`

## 12.9.1 (2024-09-17)

Expand Down
10 changes: 6 additions & 4 deletions sdk/tables/Azure.Data.Tables/src/TableClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public TableClient(string connectionString, string tableName, TableClientOptions
_version = options.VersionString;
_diagnostics = new ClientDiagnostics(options);
_tableOperations = new TableRestClient(_diagnostics, _pipeline, _endpoint.AbsoluteUri, _version);
_batchOperations = new TableRestClient(_diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion);
_batchOperations = new TableRestClient(_diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion);
Name = tableName;
Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri();
}
Expand Down Expand Up @@ -286,7 +286,7 @@ public TableClient(Uri endpoint, string tableName, TokenCredential tokenCredenti
_version = options.VersionString;
_diagnostics = new ClientDiagnostics(options);
_tableOperations = new TableRestClient(_diagnostics, _pipeline, _endpoint.AbsoluteUri, _version);
_batchOperations = new TableRestClient(_diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion);
_batchOperations = new TableRestClient(_diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion);
Name = tableName;
Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri();
}
Expand Down Expand Up @@ -337,7 +337,7 @@ null when string.IsNullOrWhiteSpace(_endpoint.Query) => policy,
_version = options.VersionString;
_diagnostics = new ClientDiagnostics(options);
_tableOperations = new TableRestClient(_diagnostics, _pipeline, _endpoint.AbsoluteUri, _version);
_batchOperations = new TableRestClient(_diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion);
_batchOperations = new TableRestClient(_diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion);
Name = tableName;
Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri();
}
Expand All @@ -363,7 +363,7 @@ internal TableClient(
{
_tableOperations = tableOperations;
}
_batchOperations = new TableRestClient(diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion);
_batchOperations = new TableRestClient(diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion);
_version = version;
Name = table;
Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri();
Expand Down Expand Up @@ -1743,6 +1743,8 @@ private HttpMessage CreateUpdateOrMergeRequest(TableRestClient batchOperations,
return msg;
}

private static readonly HttpPipeline _batchPipeline = CreateBatchPipeline();

/// <summary>
/// Creates a pipeline to use for processing sub-operations before they are combined into a single multipart request.
/// </summary>
Expand Down
Loading