pub struct Fleet { /* private fields */ }Expand description
Blank servers assigned to one tenant’s disk under a read key.
Assignment gives each server the disk, its storage policy and a cluster that names exactly the fleet’s servers, with one config reload, and attaches the tenant’s databases from their definitions in InodeDB. A query then runs on the first server, and the rest read their share of its marks. A reload can add a disk and can neither remove one nor change its key, so a server serves one tenant and is then replaced.
Implementations§
Source§impl Fleet
impl Fleet
Sourcepub async fn assign(
servers: Vec<Server>,
tenant: &Tenant,
read_key: &str,
) -> Result<Fleet, Error>
pub async fn assign( servers: Vec<Server>, tenant: &Tenant, read_key: &str, ) -> Result<Fleet, Error>
Assigns blank servers to a tenant. read_key needs the read grant on the tenant’s directory.
pub fn servers(&self) -> &[Server]
Sourcepub fn left_out(&self) -> &[(String, String)]
pub fn left_out(&self) -> &[(String, String)]
Each database the fleet could not serve, with the reason.
Sourcepub async fn query(&self, sql: &str) -> Result<String, Error>
pub async fn query(&self, sql: &str) -> Result<String, Error>
Runs a query on the first server, with every server of the fleet reading as a parallel replica.
Sourcepub async fn query_with(
&self,
sql: &str,
settings: &[(&str, &str)],
) -> Result<String, Error>
pub async fn query_with( &self, sql: &str, settings: &[(&str, &str)], ) -> Result<String, Error>
Runs a query as Fleet::query does, under further settings.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Fleet
impl !UnwindSafe for Fleet
impl Forget for Fleet
impl Freeze for Fleet
impl Move for Fleet
impl Send for Fleet
impl Sync for Fleet
impl Unpin for Fleet
impl UnsafeUnpin for Fleet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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