Skip to content

Commit

Permalink
chore: add min-numa version to server info (#70)
Browse files Browse the repository at this point in the history
Signed-off-by: Sidhant Kohli <[email protected]>
  • Loading branch information
kohlisid authored Aug 9, 2024
1 parent 4c16bc1 commit bebcd2d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ use tokio::sync::{mpsc, oneshot};
use tokio_stream::wrappers::UnixListenerStream;
use tracing::info;

pub(crate) const MAP_MODE_KEY: &str = "MAP_MODE";
pub(crate) const UNARY_MAP: &str = "unary-map";
pub(crate) const STREAM_MAP: &str = "stream-map";
pub(crate) const BATCH_MAP: &str = "batch-map";
const MINIMUM_NUMAFLOW_VERSION: &str = "1.2.0-rc4";

// default_info_file is a function to get a default server info json
// file content. This is used to write the server info file.
// This function is used in the write_info_file function.
Expand All @@ -21,13 +27,9 @@ pub fn default_info_file() -> serde_json::Value {
"language": "rust",
"version": "0.0.1",
"metadata": metadata,
"minimum-numaflow-version": MINIMUM_NUMAFLOW_VERSION,
})
}
pub(crate) const MAP_MODE_KEY: &str = "MAP_MODE";
pub(crate) const UNARY_MAP: &str = "unary-map";
pub(crate) const STREAM_MAP: &str = "stream-map";
pub(crate) const BATCH_MAP: &str = "batch-map";

// #[tracing::instrument(skip(path), fields(path = ?path.as_ref()))]
#[tracing::instrument(fields(path = ? path.as_ref()))]
fn write_info_file(path: impl AsRef<Path>, mut server_info: serde_json::Value) -> io::Result<()> {
Expand Down Expand Up @@ -186,6 +188,7 @@ mod tests {
assert!(contents.contains(r#""language":"rust""#));
assert!(contents.contains(r#""version":"0.0.1""#));
assert!(contents.contains(r#""metadata":{"MAP_MODE":"batch-map"}"#));
assert!(contents.contains(r#""minimum-numaflow-version":"1.2.0-rc4""#));

Ok(())
}
Expand Down

0 comments on commit bebcd2d

Please sign in to comment.