NoahKusaba commented on code in PR #2608:
URL:
https://github.com/apache/datafusion-ballista/pull/2608#discussion_r4355635620
##########
ballista/core/src/client.rs:
##########
@@ -62,6 +64,45 @@ pub struct BallistaClient {
}
impl BallistaClient {
+ fn encode_action(action: &Action) -> BResult<Vec<u8>> {
+ let serialized_action: protobuf::Action =
action.to_owned().try_into()?;
+ let mut buf = Vec::with_capacity(serialized_action.encoded_len());
+ serialized_action
+ .encode(&mut buf)
+ .map_err(|e| BallistaError::GrpcActionError(format!("{e:?}")))?;
+ Ok(buf)
+ }
+
+ async fn retry_io<T, F, Fut>(&self, mut op: F) -> Result<T, Status>
Review Comment:
There's already a generic `with_retry(retries, wait_ms, should_retry, f)` in
`shuffle_reader.rs:945` with the same shape. Could we make it generic over the
error type, move it to `utils.rs`, and call it here with `|s: &Status| s.code()
== Code::Unknown`? Then the crate has one retry helper, not two. One catch:
`with_retry` counts *retries* and the client counts *total attempts*, so the
call would pass `self.io_retries_times.saturating_sub(1)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]