/// Remove a list of keys where the key, represented in raw bytes, and version of the corresponding
/// keys is specified.
Remove a list of keys where the key, represented in raw bytes, and version of the corresponding
keys is specified.
Remove a list of keys where the key represented in raw bytes and version of the corresponding keys is specified .
async fn remove_raw_values(&self, keys: Vec<(Vec<u8>, Version)>, offset: i64) -> Result<(), TableError> {
        let op = "Remove keys from table";
        retry_async(self.factory.config().retry_policy, || async {
            let tks: Vec<TableKey> = keys
                .iter()
                .map(|(k, ver)| TableKey::new(k.clone(), *ver))
                .collect();
            let req = Requests::RemoveTableKeys(RemoveTableKeysCommand {
                request_id: get_request_id(),
                segment: self.name.clone(),
                delegation_token: self
                    .delegation_token_provider
                    .retrieve_token(self.factory.controller_client())
                    .await,
                keys: tks,
                table_segment_offset: offset,
            });
            let result = self
                .factory
                .create_raw_client_for_endpoint(self.endpoint.clone())
                .send_request(&req)
                .await;
            debug!("Reply for RemoveTableKeys request {:?}", result);
            match result {
                Ok(reply) => RetryResult::Success(reply),
                Err(e) => {
                    if e.is_token_expired() {
                        self.delegation_token_provider.signal_token_expiry();
                        debug!("auth token needs to refresh");
                    }
                    debug!("retry on error {:?}", e);
                    RetryResult::Retry(e)
                }
            }
        })
        .await
        .map_err(|e| TableError::ConnectionError {
            can_retry: true,
            operation: op.into(),
            source: e.error,
        })
        .and_then(|r| match r {
            Replies::TableKeysRemoved(..) => Ok(()),
            Replies::TableKeyBadVersion(c) => Err(TableError::IncorrectKeyVersion {
                operation: op.into(),
                error_msg: c.to_string(),
            }),
            Replies::TableKeyDoesNotExist(c) => Err(TableError::KeyDoesNotExist {
                operation: op.into(),
                error_msg: c.to_string(),
            }),
            _ => Err(TableError::OperationError {
                operation: op.into(),
                error_msg: r.to_string(),
            }),
        })
    }
async fn remove_raw_values ( & self , keys : Vec < ( Vec < u8 > , Version ) > , offset : i64 ) -> Result < ( ) , TableError > { let op = " " ; retry_async ( self . factory . config ( ) . retry_policy , | | async { let tks : Vec < TableKey > = keys . iter ( ) . map ( | ( k , ver ) | TableKey :: new ( k . clone ( ) , * ver ) ) . collect ( ) ; let req = Requests :: RemoveTableKeys ( RemoveTableKeysCommand { request_id : get_request_id ( ) , segment : self . name . clone ( ) , delegation_token : self . delegation_token_provider . retrieve_token ( self . factory . controller_client ( ) ) . await , keys : tks , table_segment_offset : offset , } ) ; let result = self . factory . create_raw_client_for_endpoint ( self . endpoint . clone ( ) ) . send_request ( & req ) . await ; debug ! ( " " result ) ; match result { Ok ( reply ) => RetryResult :: Success ( reply ) , Err ( e ) => { if e . is_token_expired ( ) { self . delegation_token_provider . signal_token_expiry ( ) ; debug ! ( " " ) ; } debug ! ( " " e ) ; RetryResult :: Retry ( e ) } } } ) . await . map_err ( | e | TableError :: ConnectionError { can_retry : true , operation : op . into ( ) , source : e . error , } ) . and_then ( | r | match r { Replies :: TableKeysRemoved ( .. ) => Ok ( ( ) ) , Replies :: TableKeyBadVersion ( c ) => Err ( TableError :: IncorrectKeyVersion { operation : op . into ( ) , error_msg : c . to_string ( ) , } ) , Replies :: TableKeyDoesNotExist ( c ) => Err ( TableError :: KeyDoesNotExist { operation : op . into ( ) , error_msg : c . to_string ( ) , } ) , _ => Err ( TableError :: OperationError { operation : op . into ( ) , error_msg : r . to_string ( ) , } ) , } ) }
Remove a list of keys where the key, represented in raw bytes, and version of the corresponding
keys is specified.
Remove a list of keys where the key represented in raw bytes and version of the corresponding keys is specified .
&self
keys
Vec<(Vec<u8>, Version)>
offset
i64