Skip to content

Commit a2d5822

Browse files
committed
Fix examples and conflicts
1 parent 1d78518 commit a2d5822

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/localhost_worker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
3333
cached: DashMap::new(),
3434
};
3535

36-
let endpoint = ArrowFlightEndpoint::new(move |ctx: DistributedSessionBuilderContext| {
36+
let endpoint = ArrowFlightEndpoint::try_new(move |ctx: DistributedSessionBuilderContext| {
3737
let local_host_resolver = localhost_resolver.clone();
3838
async move {
3939
Ok(SessionStateBuilder::new()
@@ -42,7 +42,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
4242
.with_default_features()
4343
.build())
4444
}
45-
});
45+
})?;
4646

4747
Server::builder()
4848
.add_service(FlightServiceServer::new(endpoint))

src/flight_service/do_get.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mod tests {
181181

182182
// Create ArrowFlightEndpoint with DefaultSessionBuilder
183183
let endpoint =
184-
ArrowFlightEndpoint::new(DefaultSessionBuilder).expect("Failed to create endpoint");
184+
ArrowFlightEndpoint::try_new(DefaultSessionBuilder).expect("Failed to create endpoint");
185185

186186
// Create 3 tasks with 3 partitions each.
187187
let num_tasks = 3;
@@ -210,7 +210,7 @@ mod tests {
210210
tasks,
211211
};
212212

213-
let task_keys = vec![
213+
let task_keys = [
214214
StageKey {
215215
query_id: query_id_uuid.to_string(),
216216
stage_id,

src/flight_service/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct ArrowFlightEndpoint {
3636
}
3737

3838
impl ArrowFlightEndpoint {
39-
pub fn new(
39+
pub fn try_new(
4040
session_builder: impl DistributedSessionBuilder + Send + Sync + 'static,
4141
) -> Result<Self, DataFusionError> {
4242
let ttl_map = TTLMap::try_new(TTLMapConfig::default())?;

src/test_utils/localhost.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub async fn spawn_flight_service(
109109
session_builder: impl DistributedSessionBuilder + Send + Sync + 'static,
110110
incoming: TcpListener,
111111
) -> Result<(), Box<dyn Error + Send + Sync>> {
112-
let endpoint = ArrowFlightEndpoint::new(session_builder)?;
112+
let endpoint = ArrowFlightEndpoint::try_new(session_builder)?;
113113

114114
let incoming = tokio_stream::wrappers::TcpListenerStream::new(incoming);
115115

0 commit comments

Comments
 (0)