mfyuce commented on code in PR #3523:
URL: https://github.com/apache/iggy/pull/3523#discussion_r3710481873
##########
core/connectors/sinks/quickwit_sink/src/lib.rs:
##########
@@ -16,158 +16,325 @@
// under the License.
use async_trait::async_trait;
+use base64::{Engine as _, engine::general_purpose};
+use iggy_connector_sdk::retry::{
+ ConnectivityConfig, build_retry_client, check_connectivity_with_retry,
parse_duration,
+};
use iggy_connector_sdk::{
- ConsumedMessage, Error, MessagesMetadata, Payload, Sink, TopicMetadata,
sink_connector,
+ ConsumedMessage, Error, MessagesMetadata, Payload, Schema, Sink,
TopicMetadata, sink_connector,
};
+use reqwest::StatusCode;
+use reqwest::Url;
+use reqwest_middleware::ClientWithMiddleware;
use serde::{Deserialize, Serialize};
-use tracing::{error, info, warn};
+use simd_json::OwnedValue;
+use tracing::{debug, error, info, warn};
sink_connector!(QuickwitSink);
+const DEFAULT_MAX_RETRIES: u32 = 3;
+const DEFAULT_RETRY_DELAY: &str = "200ms";
+const DEFAULT_MAX_RETRY_DELAY: &str = "5s";
+const DEFAULT_MAX_OPEN_RETRIES: u32 = 5;
+const DEFAULT_OPEN_RETRY_MAX_DELAY: &str = "30s";
+const DEFAULT_REQUEST_TIMEOUT: &str = "30s";
+
#[derive(Debug)]
pub struct QuickwitSink {
id: u32,
config: QuickwitSinkConfig,
- client: reqwest::Client,
+ client: Option<ClientWithMiddleware>,
+ verbose: bool,
index_id: String,
}
#[derive(Debug, Serialize, Deserialize)]
Review Comment:
All three done. `#[serde(deny_unknown_fields)]` is on `QuickwitSinkConfig`,
the
`Serialize` derive is gone, and every field carries a doc comment with its
default. I dropped the same unused `Serialize` from the private `IndexConfig`
while I was there.
--
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]