pub struct Worker { /* private fields */ }Implementations§
Source§impl Worker
impl Worker
Sourcepub fn into_worker_server(self) -> WorkerServiceServer<Self>
pub fn into_worker_server(self) -> WorkerServiceServer<Self>
Converts this Worker into a [WorkerServiceServer] with high default message size limits.
This is a convenience method that wraps the endpoint in a [WorkerServiceServer] and
configures it with max_decoding_message_size(usize::MAX) and
max_encoding_message_size(usize::MAX) to avoid message size limitations for internal
communication.
You can further customize the returned server by chaining additional tonic methods.
§Example
let worker = Worker::default();
let server = worker.into_worker_server();
Server::builder()
.add_service(Worker::default().into_worker_server())
.serve(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 8080))
.await;
Sourcepub fn with_observability_service(
&self,
worker_resolver: Arc<dyn WorkerResolver + Send + Sync>,
) -> ObservabilityServiceServer<ObservabilityServiceImpl>
pub fn with_observability_service( &self, worker_resolver: Arc<dyn WorkerResolver + Send + Sync>, ) -> ObservabilityServiceServer<ObservabilityServiceImpl>
Creates an ObservabilityServiceServer that exposes task progress and cluster
worker discovery via the provided WorkerResolver.
The returned server is meant to be added to the same tonic::transport::Server as the
Flight service — gRPC multiplexes both services on a single port.
Source§impl Worker
impl Worker
pub async fn coordinator_channel( &self, headers: HeaderMap, request: SetPlanRequest, stream: BoxStream<'static, Result<CoordinatorToWorkerMsg>>, ) -> Result<BoxStream<'static, Result<WorkerToCoordinatorMsg>>>
Source§impl Worker
Builds several per-partition streams by retrieving the appropriate entry from [TaskDataEntries]
based on the task key extracted from ExecuteTaskRequest.
impl Worker
Builds several per-partition streams by retrieving the appropriate entry from [TaskDataEntries] based on the task key extracted from ExecuteTaskRequest.
This method is async mainly for the key retrieval operation from [TaskDataEntries], but it does not start polling any stream, it just instantiates them.
pub async fn execute_task( &self, request: ExecuteTaskRequest, ) -> Result<(Vec<SendableRecordBatchStream>, Arc<TaskContext>)>
Source§impl Worker
impl Worker
Sourcepub fn from_session_builder(
session_builder: impl WorkerSessionBuilder + Send + Sync + 'static,
) -> Self
pub fn from_session_builder( session_builder: impl WorkerSessionBuilder + Send + Sync + 'static, ) -> Self
Builds a Worker with a custom WorkerSessionBuilder. Use this
method whenever you need to add custom stuff to the SessionContext that executes the query.
Sourcepub fn with_runtime_env(self, runtime_env: Arc<RuntimeEnv>) -> Self
pub fn with_runtime_env(self, runtime_env: Arc<RuntimeEnv>) -> Self
Sets a RuntimeEnv to be used in all the queries this Worker will handle during its lifetime.
Sourcepub fn with_max_message_size(self, size: usize) -> Self
pub fn with_max_message_size(self, size: usize) -> Self
Set the maximum message size for FlightData chunks.
Defaults to usize::MAX to minimize chunking overhead for internal communication.
See FlightDataEncoderBuilder::with_max_flight_data_size for details.
If you change this to a lower value, ensure you configure the server’s
max_encoding_message_size and max_decoding_message_size to at least 2x this value
to allow for overhead. For most use cases, the default of usize::MAX is appropriate.
Sourcepub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
pub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
Sets a version string reported by the GetWorkerInfo gRPC endpoint.
Sourcepub fn version(&self) -> &str
pub fn version(&self) -> &str
Returns the version set by Self::with_version.
Sourcepub fn to_local_worker_context(&self, self_url: Url) -> LocalWorkerContext
pub fn to_local_worker_context(&self, self_url: Url) -> LocalWorkerContext
Builds a LocalWorkerContext suitable to be injecting into a coordinating [SessionContext]. Having a LocalWorkerContext present in the coordinating [SessionContext] is not strictly necessary, but it allows the planner to better colocate small stages near it, avoiding unnecessary network hops.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !UnwindSafe for Worker
impl Freeze for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request