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

[Internal]Thin Client Integration: Adds Classes and Methods for Transport Serialization of RNTBD Payload #5019

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

aavasthy
Copy link
Contributor

Pull Request Template

Description

This pull request introduces the ProxyStoreClient, ThinClientStoreModel, and ThinClientTransportSerializer classes as part of SDK-Thinclient integration. These additions enhance the SDK's functionality by enabling operations through a ThinClient proxy, which includes applying session tokens, resolving partition key ranges, and delegating requests to the ProxyStoreClient. The ThinClientTransportSerializer provides serialization and deserialization of requests and responses to and from the RNTBD protocol for the ThinClient scenario.
Also, included functional unit tests for these classes.

  • ThinClientStoreModel: This class implements the ProcessMessageAsync() method from the IStoreModel interface, to send the request message via the proxy store client. This store model abstracts out the implementation of the thin client interaction using the new Http 2 protocol.

  • ProxyStoreClient: This client is responsible for interacting with the thin client over Http2, using the thin client uri.

  • ThinClientTransportSerializer: This class provides static methods for serializing and deserializing requests and responses to and from the RNTBD protocol for the ThinClient scenario.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #4571

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@aavasthy aavasthy changed the title Add ThinclientStoreModel, ProxyClient , Serializer and tests [Thin Client Integration]: Adds Classes and Methods for Transport Serialization of RNTBD Payload Feb 14, 2025
@aavasthy aavasthy marked this pull request as ready for review February 14, 2025 19:06
@aavasthy aavasthy changed the title [Thin Client Integration]: Adds Classes and Methods for Transport Serialization of RNTBD Payload [Internal]Thin Client Integration: Adds Classes and Methods for Transport Serialization of RNTBD Payload Feb 14, 2025
out _);

// TODO: consider using the SerializedRequest directly.
MemoryStream memoryStream = new MemoryStream(serializedRequest.RequestSize);
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty inefficient - why not change the method signature of BuildRequestForProxy to return a stream instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also why would we want to push any ThinClient specific logic into SharedFiles - why not use the Classes in SharedFile to create the rntbd envelope from V3 repo? We might need to iterate on this quickly?

@aavasthy aavasthy self-assigned this Feb 18, 2025
this.Dispose(true);
}

private async Task CaptureSessionTokenAndHandleSplitAsync(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GatewayStoreModel also has an implementation for CaptureSessionTokenAndHandleSplitAsync. See these lines of code for details.

Can we consolidate the code in one common place, so that is parts of it are common, then we need to make sure there are no code duplications.

}
}

internal static async Task ApplySessionTokenAsync(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Code duplication. Let's consolidate in one common place if they are similar.

@@ -38,5 +38,6 @@ internal interface IGlobalEndpointManager : IDisposable
ReadOnlyDictionary<string, Uri> GetAvailableReadEndpointsByLocation();

bool CanSupportMultipleWriteLocations(ResourceType resourceType, OperationType operationType);
bool TryGetLocationForGatewayDiagnostics(Uri endpoint, out string regionName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this method exposed in the interface ? I don't see it's used in any of the tests. If not - Let's get this removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Thin Client Integration] Create New Store Model and HttpMessageHandler
3 participants