-
Notifications
You must be signed in to change notification settings - Fork 853
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
Expose Inner FlightServiceClient on FlightSqlServiceClient (#3551) #3556
Expose Inner FlightServiceClient on FlightSqlServiceClient (#3551) #3556
Conversation
@@ -378,13 +378,13 @@ pub struct PreparedStatement<T> { | |||
|
|||
impl PreparedStatement<Channel> { | |||
pub(crate) fn new( | |||
client: Arc<Mutex<FlightServiceClient<Channel>>>, | |||
flight_client: FlightServiceClient<Channel>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Channel is cheaply cloneable, so there is no reason for the additional Arc<Mutex>
See https://docs.rs/tonic/latest/tonic/transport/struct.Channel.html#multiplexing-requests
I also have big plans for this client over the next few releases. This is a nice step forward |
self.flight_client | ||
.try_lock() | ||
.map_err(|_| ArrowError::IoError("Unable to lock client".to_string())) | ||
/// Return a reference to the underlying [`FlightServiceClient`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also recommend an into_inner()
function if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark runs are scheduled for baseline = 40837a8 and contender = 3ae1c72. 3ae1c72 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3551
Rationale for this change
Was looking into this code as part of #3551 and realised we could simplify this
What changes are included in this PR?
Are there any user-facing changes?