Struct tikv::import::sst_service::ImportSSTService[][src]

pub struct ImportSSTService<E, Router> where
    E: KvEngine
{ cfg: Config, engine: E, router: Router, threads: ThreadPool, importer: Arc<SSTImporter>, limiter: Limiter, task_slots: Arc<Mutex<HashSet<PathBuf>>>, }

ImportSSTService provides tikv-server with the ability to ingest SST files.

It saves the SST sent from client to a file and then sends a command to raftstore to trigger the ingest process.

Fields

cfg: Configengine: Erouter: Routerthreads: ThreadPoolimporter: Arc<SSTImporter>limiter: Limitertask_slots: Arc<Mutex<HashSet<PathBuf>>>

Implementations

impl<E, Router> ImportSSTService<E, Router> where
    E: KvEngine,
    Router: 'static + RaftStoreRouter<E>, 
[src]

pub fn new(
    cfg: Config,
    router: Router,
    engine: E,
    importer: Arc<SSTImporter>
) -> ImportSSTService<E, Router>
[src]

fn acquire_lock(
    task_slots: &Arc<Mutex<HashSet<PathBuf>>>,
    meta: &SstMeta
) -> Result<bool>
[src]

fn release_lock(
    task_slots: &Arc<Mutex<HashSet<PathBuf>>>,
    meta: &SstMeta
) -> Result<bool>
[src]

fn check_write_stall(&self) -> Option<Error>[src]

fn ingest_files(
    &self,
    context: Context,
    label: &'static str,
    ssts: Vec<SstMeta>
) -> impl Future<Output = Result<IngestResponse>>
[src]

Trait Implementations

impl<E: Clone, Router: Clone> Clone for ImportSSTService<E, Router> where
    E: KvEngine
[src]

impl<E, Router> ImportSst for ImportSSTService<E, Router> where
    E: KvEngine,
    Router: 'static + RaftStoreRouter<E>, 
[src]

fn upload(
    &mut self,
    _ctx: RpcContext<'_>,
    stream: RequestStream<UploadRequest>,
    sink: ClientStreamingSink<UploadResponse>
)
[src]

Receive SST from client and save the file for later ingesting.

fn download(
    &mut self,
    _ctx: RpcContext<'_>,
    req: DownloadRequest,
    sink: UnarySink<DownloadResponse>
)
[src]

Downloads the file and performs key-rewrite for later ingesting.

fn ingest(
    &mut self,
    ctx: RpcContext<'_>,
    req: IngestRequest,
    sink: UnarySink<IngestResponse>
)
[src]

Ingest the file by sending a raft command to raftstore.

If the ingestion fails because the region is not found or the epoch does not match, the remaining files will eventually be cleaned up by CleanupSSTWorker.

fn multi_ingest(
    &mut self,
    ctx: RpcContext<'_>,
    req: MultiIngestRequest,
    sink: UnarySink<IngestResponse>
)
[src]

Ingest multiple files by sending a raft command to raftstore.

Auto Trait Implementations

impl<E, Router> !RefUnwindSafe for ImportSSTService<E, Router>

impl<E, Router> Send for ImportSSTService<E, Router> where
    Router: Send

impl<E, Router> Sync for ImportSSTService<E, Router> where
    Router: Sync

impl<E, Router> Unpin for ImportSSTService<E, Router> where
    Router: Unpin

impl<E, Router> !UnwindSafe for ImportSSTService<E, Router>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]