From 735685b7e3c08dfb90a731d3c22d055f96cfc15f Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Wed, 6 Mar 2024 15:57:01 +0900 Subject: [PATCH] Removed useless result (#4683) --- quickwit/quickwit-ingest/src/ingest_v2/router.rs | 4 ++-- quickwit/quickwit-ingest/src/ingest_v2/workbench.rs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/quickwit/quickwit-ingest/src/ingest_v2/router.rs b/quickwit/quickwit-ingest/src/ingest_v2/router.rs index 5489925e376..291873232ce 100644 --- a/quickwit/quickwit-ingest/src/ingest_v2/router.rs +++ b/quickwit/quickwit-ingest/src/ingest_v2/router.rs @@ -418,7 +418,7 @@ impl IngestRouter { &mut self, ingest_request: IngestRequestV2, max_num_attempts: usize, - ) -> IngestV2Result { + ) -> IngestResponseV2 { let commit_type = ingest_request.commit_type(); let mut workbench = IngestWorkbench::new(ingest_request.subrequests, max_num_attempts); while !workbench.is_complete() { @@ -438,7 +438,7 @@ impl IngestRouter { self.retry_batch_persist(ingest_request, MAX_PERSIST_ATTEMPTS), ) .await - .map_err(|_| IngestV2Error::Timeout)? + .map_err(|_| IngestV2Error::Timeout) } } diff --git a/quickwit/quickwit-ingest/src/ingest_v2/workbench.rs b/quickwit/quickwit-ingest/src/ingest_v2/workbench.rs index e7b1758c059..43b3c0ab897 100644 --- a/quickwit/quickwit-ingest/src/ingest_v2/workbench.rs +++ b/quickwit/quickwit-ingest/src/ingest_v2/workbench.rs @@ -26,7 +26,6 @@ use quickwit_proto::ingest::ingester::{PersistFailure, PersistFailureReason, Per use quickwit_proto::ingest::router::{ IngestFailure, IngestFailureReason, IngestResponseV2, IngestSubrequest, IngestSuccess, }; -use quickwit_proto::ingest::IngestV2Result; use quickwit_proto::types::{NodeId, SubrequestId}; use tracing::warn; @@ -163,7 +162,7 @@ impl IngestWorkbench { self.record_failure(subrequest_id, SubworkbenchFailure::Internal(error_message)); } - pub fn into_ingest_response(self) -> IngestV2Result { + pub fn into_ingest_response(self) -> IngestResponseV2 { let num_subworkbenches = self.subworkbenches.len(); let mut successes = Vec::with_capacity(self.num_successes); let mut failures = Vec::with_capacity(num_subworkbenches - self.num_successes); @@ -188,10 +187,10 @@ impl IngestWorkbench { } } assert_eq!(successes.len() + failures.len(), num_subworkbenches); - Ok(IngestResponseV2 { + IngestResponseV2 { successes, failures, - }) + } } #[cfg(test)]