async fn read_keys_raw(
        &self,
        max_keys_at_once: i32,
        token: &[u8],
    ) -> Result<(Vec<(Vec<u8>, Version)>, Vec<u8>), TableError> {
        let op = "Read keys";

        retry_async(self.factory.config().retry_policy, || async {
            let req = Requests::ReadTableKeys(ReadTableKeysCommand {
                request_id: get_request_id(),
                segment: self.name.clone(),
                delegation_token: self
                    .delegation_token_provider
                    .retrieve_token(self.factory.controller_client())
                    .await,
                suggested_key_count: max_keys_at_once,
                continuation_token: token.to_vec(),
            });
            let result = self
                .factory
                .create_raw_client_for_endpoint(self.endpoint.clone())
                .send_request(&req)
                .await;
            match result {
                Ok(reply) => RetryResult::Success(reply),
                Err(e) => {
                    if e.is_token_expired() {
                        self.delegation_token_provider.signal_token_expiry();
                        info!("auth token needs to refresh");
                    }
                    RetryResult::Retry(e)
                }
            }
        })
        .await
        .map_err(|e| TableError::ConnectionError {
            can_retry: true,
            operation: op.into(),
            source: e.error,
        })
        .and_then(|r| match r {
            Replies::TableKeysRead(c) => {
                let keys: Vec<(Vec<u8>, Version)> =
                    c.keys.iter().map(|k| (k.data.clone(), k.key_version)).collect();

                Ok((keys, c.continuation_token))
            }
            _ => Err(TableError::OperationError {
                operation: op.into(),
                error_msg: r.to_string(),
            }),
        })
    }
/// Read the raw keys from the table map. It returns a list of keys and its versions with a continuation token.
Read the raw keys from the table map. It returns a list of keys and its versions with a continuation token.
Read the raw keys from the table map . It returns a list of keys and its versions with a continuation token .
async fn read_keys_raw(
        &self,
        max_keys_at_once: i32,
        token: &[u8],
    ) -> Result<(Vec<(Vec<u8>, Version)>, Vec<u8>), TableError> {
        let op = "Read keys";
        retry_async(self.factory.config().retry_policy, || async {
            let req = Requests::ReadTableKeys(ReadTableKeysCommand {
                request_id: get_request_id(),
                segment: self.name.clone(),
                delegation_token: self
                    .delegation_token_provider
                    .retrieve_token(self.factory.controller_client())
                    .await,
                suggested_key_count: max_keys_at_once,
                continuation_token: token.to_vec(),
            });
            let result = self
                .factory
                .create_raw_client_for_endpoint(self.endpoint.clone())
                .send_request(&req)
                .await;
            match result {
                Ok(reply) => RetryResult::Success(reply),
                Err(e) => {
                    if e.is_token_expired() {
                        self.delegation_token_provider.signal_token_expiry();
                        info!("auth token needs to refresh");
                    }
                    RetryResult::Retry(e)
                }
            }
        })
        .await
        .map_err(|e| TableError::ConnectionError {
            can_retry: true,
            operation: op.into(),
            source: e.error,
        })
        .and_then(|r| match r {
            Replies::TableKeysRead(c) => {
                let keys: Vec<(Vec<u8>, Version)> =
                    c.keys.iter().map(|k| (k.data.clone(), k.key_version)).collect();
                Ok((keys, c.continuation_token))
            }
            _ => Err(TableError::OperationError {
                operation: op.into(),
                error_msg: r.to_string(),
            }),
        })
    }
async fn read_keys_raw ( & self , max_keys_at_once : i32 , token : & [ u8 ] , ) -> Result < ( Vec < ( Vec < u8 > , Version ) > , Vec < u8 > ) , TableError > { let op = " " ; retry_async ( self . factory . config ( ) . retry_policy , | | async { let req = Requests :: ReadTableKeys ( ReadTableKeysCommand { request_id : get_request_id ( ) , segment : self . name . clone ( ) , delegation_token : self . delegation_token_provider . retrieve_token ( self . factory . controller_client ( ) ) . await , suggested_key_count : max_keys_at_once , continuation_token : token . to_vec ( ) , } ) ; let result = self . factory . create_raw_client_for_endpoint ( self . endpoint . clone ( ) ) . send_request ( & req ) . await ; match result { Ok ( reply ) => RetryResult :: Success ( reply ) , Err ( e ) => { if e . is_token_expired ( ) { self . delegation_token_provider . signal_token_expiry ( ) ; info ! ( " " ) ; } RetryResult :: Retry ( e ) } } } ) . await . map_err ( | e | TableError :: ConnectionError { can_retry : true , operation : op . into ( ) , source : e . error , } ) . and_then ( | r | match r { Replies :: TableKeysRead ( c ) => { let keys : Vec < ( Vec < u8 > , Version ) > = c . keys . iter ( ) . map ( | k | ( k . data . clone ( ) , k . key_version ) ) . collect ( ) ; Ok ( ( keys , c . continuation_token ) ) } _ => Err ( TableError :: OperationError { operation : op . into ( ) , error_msg : r . to_string ( ) , } ) , } ) }
Read the raw keys from the table map.
Read the raw keys from the table map .
&self
max_keys_at_once
i32
token
&[u8]
&self
max_keys_at_once
i32
token
&[u8]