balicat commented on code in PR #285:
URL: https://github.com/apache/arrow-dotnet/pull/285#discussion_r3004151513
##########
src/Apache.Arrow.Flight/Client/FlightClient.cs:
##########
@@ -27,15 +28,28 @@ public class FlightClient
internal static readonly Empty EmptyInstance = new Empty();
private readonly FlightService.FlightServiceClient _client;
+ private readonly ICompressionCodecFactory _compressionCodecFactory;
public FlightClient(ChannelBase grpcChannel)
+ : this(grpcChannel, null)
+ {
+ }
+
+ public FlightClient(ChannelBase grpcChannel, ICompressionCodecFactory
compressionCodecFactory)
{
_client = new FlightService.FlightServiceClient(grpcChannel);
+ _compressionCodecFactory = compressionCodecFactory;
}
public FlightClient(CallInvoker callInvoker)
+ : this(callInvoker, null)
+ {
+ }
+
+ public FlightClient(CallInvoker callInvoker, ICompressionCodecFactory
compressionCodecFactory)
Review Comment:
Updated per review feedback:
- Replaced ICompressionCodecFactory with ArrowContext across all Flight
record batch readers
- ArrowContext carries compression codec factory, memory allocator, and
extension type registry
- Used optional parameters (ArrowContext context = null) instead of
constructor overloads — this avoids the DI ambiguity with multiple CallInvoker
constructors, no need for [ActivatorUtilitiesConstructor] or extra dependencies
- All existing code works unchanged (context defaults to null)
Usage:
var context = new ArrowContext(compressionCodecFactory: new
CompressionCodecFactory());
var client = new FlightClient(grpcChannel, context);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]