diff --git a/dbconn/src/lib.rs b/dbconn/src/lib.rs index 3ee0338..545ce46 100644 --- a/dbconn/src/lib.rs +++ b/dbconn/src/lib.rs @@ -69,11 +69,10 @@ pub async fn table_sizes(node_config: &NodeConfigCached) -> Result item, diff --git a/disk/src/cache/pbvfs.rs b/disk/src/cache/pbvfs.rs index 08be953..f33d6a2 100644 --- a/disk/src/cache/pbvfs.rs +++ b/disk/src/cache/pbvfs.rs @@ -27,7 +27,7 @@ impl PreBinnedValueFetchedStream { let nodeix = node_ix_for_patch(&query.patch, &query.channel, &node_config.node_config.cluster); let node = &node_config.node_config.cluster.nodes[nodeix as usize]; let uri: hyper::Uri = format!( - "http://{}:{}/api/1/prebinned?{}", + "http://{}:{}/api/4/prebinned?{}", node.host, node.port, query.make_query_string() diff --git a/httpret/src/lib.rs b/httpret/src/lib.rs index 57b9064..9cd663c 100644 --- a/httpret/src/lib.rs +++ b/httpret/src/lib.rs @@ -86,44 +86,49 @@ impl UnwindSafe for Cont {} async fn data_api_proxy_try(req: Request, node_config: &NodeConfigCached) -> Result, Error> { let uri = req.uri().clone(); let path = uri.path(); - if path == "/api/1/node_status" { + if path == "/api/4/node_status" { if req.method() == Method::GET { Ok(node_status(req, &node_config).await?) } else { Ok(response(StatusCode::METHOD_NOT_ALLOWED).body(Body::empty())?) } - } else if path == "/api/1/table_sizes" { + } else if path == "/api/4/table_sizes" { if req.method() == Method::GET { Ok(table_sizes(req, &node_config).await?) } else { Ok(response(StatusCode::METHOD_NOT_ALLOWED).body(Body::empty())?) } - } else if path == "/api/1/random_channel" { + } else if path == "/api/4/random_channel" { if req.method() == Method::GET { Ok(random_channel(req, &node_config).await?) } else { Ok(response(StatusCode::METHOD_NOT_ALLOWED).body(Body::empty())?) } - } else if path == "/api/1/parsed_raw" { + } else if path == "/api/4/parsed_raw" { if req.method() == Method::POST { Ok(parsed_raw(req, &node_config.node).await?) } else { Ok(response(StatusCode::METHOD_NOT_ALLOWED).body(Body::empty())?) } - } else if path == "/api/1/binned" { + } else if path == "/api/4/binned" { if req.method() == Method::GET { Ok(binned(req, node_config).await?) } else { Ok(response(StatusCode::METHOD_NOT_ALLOWED).body(Body::empty())?) } - } else if path == "/api/1/prebinned" { + } else if path == "/api/4/prebinned" { if req.method() == Method::GET { Ok(prebinned(req, &node_config).await?) } else { Ok(response(StatusCode::METHOD_NOT_ALLOWED).body(Body::empty())?) } } else { - Ok(response(StatusCode::NOT_FOUND).body(Body::empty())?) + Ok(response(StatusCode::NOT_FOUND).body(Body::from(format!( + "Sorry, not found: {:?} {:?} {:?}", + req.method(), + req.uri().path(), + req.uri().query(), + )))?) } } diff --git a/retrieval/src/bin/retrieval.rs b/retrieval/src/bin/retrieval.rs index 8f705e8..ecf7627 100644 --- a/retrieval/src/bin/retrieval.rs +++ b/retrieval/src/bin/retrieval.rs @@ -121,7 +121,7 @@ fn simple_fetch() { let host = tokio::spawn(httpret::host(node_config.clone())); let req = hyper::Request::builder() .method(http::Method::POST) - .uri("http://localhost:8360/api/1/parsed_raw") + .uri("http://localhost:8360/api/4/parsed_raw") .body(query_string.into())?; let client = hyper::Client::new(); let res = client.request(req).await?; diff --git a/retrieval/src/client.rs b/retrieval/src/client.rs index eb0a5c4..f29c89d 100644 --- a/retrieval/src/client.rs +++ b/retrieval/src/client.rs @@ -12,7 +12,7 @@ use netpod::PerfOpts; pub async fn status(host: String, port: u16) -> Result<(), Error> { let t1 = Utc::now(); - let uri = format!("http://{}:{}/api/1/node_status", host, port,); + let uri = format!("http://{}:{}/api/4/node_status", host, port,); let req = hyper::Request::builder() .method(http::Method::GET) .uri(uri) @@ -47,7 +47,7 @@ pub async fn get_binned( let t1 = Utc::now(); let date_fmt = "%Y-%m-%dT%H:%M:%S.%3fZ"; let uri = format!( - "http://{}:{}/api/1/binned?channel_backend={}&channel_name={}&beg_date={}&end_date={}&bin_count={}&cache_usage={}&disk_stats_every_kb={}", + "http://{}:{}/api/4/binned?channel_backend={}&channel_name={}&beg_date={}&end_date={}&bin_count={}&cache_usage={}&disk_stats_every_kb={}", host, port, channel_backend, diff --git a/retrieval/src/test.rs b/retrieval/src/test.rs index a8c5d8b..e2dddd8 100644 --- a/retrieval/src/test.rs +++ b/retrieval/src/test.rs @@ -99,7 +99,7 @@ where let disk_stats_every = ByteSize::kb(1024); // TODO have a function to form the uri, including perf opts: let uri = format!( - "http://{}:{}/api/1/binned?cache_usage=ignore&channel_backend={}&channel_name={}&bin_count={}&beg_date={}&end_date={}&disk_stats_every_kb={}", + "http://{}:{}/api/4/binned?cache_usage=ignore&channel_backend={}&channel_name={}&bin_count={}&beg_date={}&end_date={}&disk_stats_every_kb={}", node0.host, node0.port, channel_backend, diff --git a/retrieval/src/test/json.rs b/retrieval/src/test/json.rs index e535e9b..511c66a 100644 --- a/retrieval/src/test/json.rs +++ b/retrieval/src/test/json.rs @@ -41,7 +41,7 @@ async fn get_binned_json_0_inner2( let disk_stats_every = ByteSize::kb(1024); // TODO have a function to form the uri, including perf opts: let uri = format!( - "http://{}:{}/api/1/binned?cache_usage=ignore&channel_backend={}&channel_name={}&bin_count={}&beg_date={}&end_date={}&disk_stats_every_kb={}", + "http://{}:{}/api/4/binned?cache_usage=ignore&channel_backend={}&channel_name={}&bin_count={}&beg_date={}&end_date={}&disk_stats_every_kb={}", node0.host, node0.port, channel_backend,