Skip to content

Commit 7a02f27

Browse files
committed
Rename propagate_distributed_option_extension to retrieve_distributed_option_extension
1 parent f8f6a0c commit 7a02f27

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/config_extension_ext.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub trait ConfigExtensionExt {
5656
/// async fn session_state(&self, mut state: SessionState) -> Result<SessionState, DataFusionError> {
5757
/// // while providing this MyCustomSessionBuilder to an Arrow Flight endpoint, it will
5858
/// // know how to deserialize the CustomExtension from the gRPC metadata.
59-
/// state.propagate_distributed_option_extension::<CustomExtension>()?;
59+
/// state.retrieve_distributed_option_extension::<CustomExtension>()?;
6060
/// Ok(state)
6161
/// }
6262
/// }
@@ -105,12 +105,12 @@ pub trait ConfigExtensionExt {
105105
/// async fn session_state(&self, mut state: SessionState) -> Result<SessionState, DataFusionError> {
106106
/// // while providing this MyCustomSessionBuilder to an Arrow Flight endpoint, it will
107107
/// // know how to deserialize the CustomExtension from the gRPC metadata.
108-
/// state.propagate_distributed_option_extension::<CustomExtension>()?;
108+
/// state.retrieve_distributed_option_extension::<CustomExtension>()?;
109109
/// Ok(state)
110110
/// }
111111
/// }
112112
/// ```
113-
fn propagate_distributed_option_extension<T: ConfigExtension + Default>(
113+
fn retrieve_distributed_option_extension<T: ConfigExtension + Default>(
114114
&mut self,
115115
) -> Result<(), DataFusionError>;
116116
}
@@ -151,7 +151,7 @@ impl ConfigExtensionExt for SessionConfig {
151151
Ok(())
152152
}
153153

154-
fn propagate_distributed_option_extension<T: ConfigExtension + Default>(
154+
fn retrieve_distributed_option_extension<T: ConfigExtension + Default>(
155155
&mut self,
156156
) -> Result<(), DataFusionError> {
157157
let Some(flight_metadata) = self.get_extension::<ContextGrpcMetadata>() else {
@@ -184,7 +184,7 @@ impl ConfigExtensionExt for SessionStateBuilder {
184184
delegate! {
185185
to self.config().get_or_insert_default() {
186186
fn add_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T) -> Result<(), DataFusionError>;
187-
fn propagate_distributed_option_extension<T: ConfigExtension + Default>(&mut self) -> Result<(), DataFusionError>;
187+
fn retrieve_distributed_option_extension<T: ConfigExtension + Default>(&mut self) -> Result<(), DataFusionError>;
188188
}
189189
}
190190
}
@@ -193,7 +193,7 @@ impl ConfigExtensionExt for SessionState {
193193
delegate! {
194194
to self.config_mut() {
195195
fn add_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T) -> Result<(), DataFusionError>;
196-
fn propagate_distributed_option_extension<T: ConfigExtension + Default>(&mut self) -> Result<(), DataFusionError>;
196+
fn retrieve_distributed_option_extension<T: ConfigExtension + Default>(&mut self) -> Result<(), DataFusionError>;
197197
}
198198
}
199199
}
@@ -202,7 +202,7 @@ impl ConfigExtensionExt for SessionContext {
202202
delegate! {
203203
to self.state_ref().write().config_mut() {
204204
fn add_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T) -> Result<(), DataFusionError>;
205-
fn propagate_distributed_option_extension<T: ConfigExtension + Default>(&mut self) -> Result<(), DataFusionError>;
205+
fn retrieve_distributed_option_extension<T: ConfigExtension + Default>(&mut self) -> Result<(), DataFusionError>;
206206
}
207207
}
208208
}
@@ -254,7 +254,7 @@ mod tests {
254254

255255
let mut new_config = SessionConfig::new();
256256
new_config.set_extension(config.get_extension::<ContextGrpcMetadata>().unwrap());
257-
new_config.propagate_distributed_option_extension::<CustomExtension>()?;
257+
new_config.retrieve_distributed_option_extension::<CustomExtension>()?;
258258

259259
let opt = get_ext::<CustomExtension>(&config);
260260
let new_opt = get_ext::<CustomExtension>(&new_config);
@@ -316,7 +316,7 @@ mod tests {
316316
fn test_propagate_no_metadata() -> Result<(), Box<dyn std::error::Error>> {
317317
let mut config = SessionConfig::new();
318318

319-
config.propagate_distributed_option_extension::<CustomExtension>()?;
319+
config.retrieve_distributed_option_extension::<CustomExtension>()?;
320320

321321
let extension = config.options().extensions.get::<CustomExtension>();
322322
assert!(extension.is_none());
@@ -335,7 +335,7 @@ mod tests {
335335

336336
let flight_metadata = ContextGrpcMetadata::from_headers(header_map);
337337
config.set_extension(std::sync::Arc::new(flight_metadata));
338-
config.propagate_distributed_option_extension::<CustomExtension>()?;
338+
config.retrieve_distributed_option_extension::<CustomExtension>()?;
339339

340340
let extension = config.options().extensions.get::<CustomExtension>();
341341
assert!(extension.is_none());
@@ -375,8 +375,8 @@ mod tests {
375375

376376
let mut new_config = SessionConfig::new();
377377
new_config.set_extension(flight_metadata);
378-
new_config.propagate_distributed_option_extension::<CustomExtension>()?;
379-
new_config.propagate_distributed_option_extension::<AnotherExtension>()?;
378+
new_config.retrieve_distributed_option_extension::<CustomExtension>()?;
379+
new_config.retrieve_distributed_option_extension::<AnotherExtension>()?;
380380

381381
let propagated_custom = get_ext::<CustomExtension>(&new_config);
382382
let propagated_another = get_ext::<AnotherExtension>(&new_config);

tests/custom_config_extension.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mod tests {
3737
&self,
3838
mut state: SessionState,
3939
) -> Result<SessionState, DataFusionError> {
40-
state.propagate_distributed_option_extension::<CustomExtension>()?;
40+
state.retrieve_distributed_option_extension::<CustomExtension>()?;
4141
add_user_codec(state.config_mut(), CustomConfigExtensionRequiredExecCodec);
4242
Ok(state)
4343
}

0 commit comments

Comments
 (0)