Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanatnight committed Mar 26, 2024
1 parent 7098c32 commit 03e06a9
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 113 deletions.
8 changes: 4 additions & 4 deletions server/src/handlers/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn base_path_without_preceding_slash() -> String {

pub async fn fetch_schema(stream_name: &str) -> anyhow::Result<arrow_schema::Schema> {
let mut res = vec![];
let ima = QueryServer::get_ingester_info().await.unwrap();
let ima = QueryServer::get_ingestor_info().await.unwrap();

for im in ima {
let uri = format!(
Expand All @@ -89,10 +89,10 @@ pub async fn fetch_schema(stream_name: &str) -> anyhow::Result<arrow_schema::Sch
Ok(new_schema)
}

pub async fn send_query_request_to_ingester(query: &Query) -> anyhow::Result<Vec<Value>> {
// send the query request to the ingester
pub async fn send_query_request_to_ingestor(query: &Query) -> anyhow::Result<Vec<Value>> {
// send the query request to the ingestor
let mut res = vec![];
let ima = QueryServer::get_ingester_info().await.unwrap();
let ima = QueryServer::get_ingestor_info().await.unwrap();

for im in ima.iter() {
let uri = format!(
Expand Down
4 changes: 2 additions & 2 deletions server/src/handlers/http/logstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub async fn put_stream(req: HttpRequest) -> Result<impl Responder, StreamError>
});
}
if CONFIG.parseable.mode == Mode::Query {
query_server::QueryServer::sync_streams_with_ingesters(&stream_name).await?;
query_server::QueryServer::sync_streams_with_ingestors(&stream_name).await?;
}

create_stream(stream_name.clone()).await?;
Expand Down Expand Up @@ -285,7 +285,7 @@ pub async fn get_stats(req: HttpRequest) -> Result<impl Responder, StreamError>
.ok_or(StreamError::StreamNotFound(stream_name.clone()))?;

let ingestor_stats = if CONFIG.parseable.mode == Mode::Query {
Some(query_server::QueryServer::fetch_stats_from_ingesters(&stream_name).await?)
Some(query_server::QueryServer::fetch_stats_from_ingestors(&stream_name).await?)
} else {
None
};
Expand Down
18 changes: 9 additions & 9 deletions server/src/handlers/http/modal/ingest_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::sync;

use super::server::Server;
use super::ssl_acceptor::get_ssl_acceptor;
use super::IngesterMetadata;
use super::IngestorMetadata;
use super::OpenIdClient;
use super::ParseableServer;
use super::DEFAULT_VERSION;
Expand Down Expand Up @@ -62,8 +62,8 @@ impl ParseableServer for IngestServer {
prometheus: PrometheusMetrics,
_oidc_client: Option<crate::oidc::OpenidConfig>,
) -> anyhow::Result<()> {
// set the ingester metadata
self.set_ingester_metadata().await?;
// set the ingestor metadata
self.set_ingestor_metadata().await?;

// get the ssl stuff
let ssl = get_ssl_acceptor(
Expand Down Expand Up @@ -173,25 +173,25 @@ impl IngestServer {
)
}

// create the ingester metadata and put the .ingester.json file in the object store
async fn set_ingester_metadata(&self) -> anyhow::Result<()> {
// create the ingestor metadata and put the .ingestor.json file in the object store
async fn set_ingestor_metadata(&self) -> anyhow::Result<()> {
let store = CONFIG.storage().get_object_store();

// remove ip adn go with the domain name
let sock = Server::get_server_address();
let path = RelativePathBuf::from(format!(
"ingester.{}.{}.json",
"ingestor.{}.{}.json",
sock.ip(), // this might be wrong
sock.port()
));

if store.get_object(&path).await.is_ok() {
println!("Ingester metadata already exists");
println!("Ingestor metadata already exists");
return Ok(());
};

let scheme = CONFIG.parseable.get_scheme();
let resource = IngesterMetadata::new(
let resource = IngestorMetadata::new(
sock.port().to_string(),
CONFIG
.parseable
Expand All @@ -218,7 +218,7 @@ impl IngestServer {
}

// check for querier state. Is it there, or was it there in the past
// this should happen before the set the ingester metadata
// this should happen before the set the ingestor metadata
async fn check_querier_state(&self) -> anyhow::Result<(), ObjectStorageError> {
// how do we check for querier state?
// based on the work flow of the system, the querier will always need to start first
Expand Down
12 changes: 6 additions & 6 deletions server/src/handlers/http/modal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ pub trait ParseableServer {
}

#[derive(Serialize, Debug, Deserialize, Default, Clone, Eq, PartialEq)]
pub struct IngesterMetadata {
pub struct IngestorMetadata {
pub version: String,
pub port: String,
pub domain_name: String,
pub bucket_name: String,
pub token: String,
}

impl IngesterMetadata {
impl IngestorMetadata {
pub fn new(
port: String,
domain_name: String,
Expand Down Expand Up @@ -91,11 +91,11 @@ mod test {
use actix_web::body::MessageBody;
use rstest::rstest;

use super::{IngesterMetadata, DEFAULT_VERSION};
use super::{IngestorMetadata, DEFAULT_VERSION};

#[rstest]
fn test_deserialize_resource() {
let lhs: IngesterMetadata = IngesterMetadata::new(
let lhs: IngestorMetadata = IngestorMetadata::new(
"8000".to_string(),
"https://localhost:8000".to_string(),
DEFAULT_VERSION.to_string(),
Expand All @@ -104,14 +104,14 @@ mod test {
"admin",
);

let rhs = serde_json::from_slice::<IngesterMetadata>(br#"{"version":"v3","port":"8000","domain_name":"https://localhost:8000","bucket_name":"somebucket","token":"Basic YWRtaW46YWRtaW4="}"#).unwrap();
let rhs = serde_json::from_slice::<IngestorMetadata>(br#"{"version":"v3","port":"8000","domain_name":"https://localhost:8000","bucket_name":"somebucket","token":"Basic YWRtaW46YWRtaW4="}"#).unwrap();

assert_eq!(rhs, lhs);
}

#[rstest]
fn test_serialize_resource() {
let im = IngesterMetadata::new(
let im = IngestorMetadata::new(
"8000".to_string(),
"https://localhost:8000".to_string(),
DEFAULT_VERSION.to_string(),
Expand Down
Loading

0 comments on commit 03e06a9

Please sign in to comment.