Skip to content

Commit

Permalink
Merge branch 'main' into kafka-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
hippalus committed Jan 7, 2025
2 parents 736af65 + b46be32 commit c5f61c2
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 394 deletions.
55 changes: 0 additions & 55 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ pub struct Cli {

pub ms_clarity_tag: Option<String>,

// Trino vars
pub trino_endpoint: Option<String>,
pub trino_username: Option<String>,
pub trino_auth: Option<String>,
pub trino_schema: Option<String>,
pub trino_catalog: Option<String>,

// Audit Logging env vars
pub audit_logger: Option<Url>,
pub audit_username: Option<String>,
Expand Down Expand Up @@ -153,13 +146,6 @@ impl Cli {
pub const MAX_DISK_USAGE: &'static str = "max-disk-usage";
pub const MS_CLARITY_TAG: &'static str = "ms-clarity-tag";

// Trino specific env vars
pub const TRINO_ENDPOINT: &'static str = "p-trino-end-point";
pub const TRINO_CATALOG_NAME: &'static str = "p-trino-catalog-name";
pub const TRINO_USER_NAME: &'static str = "p-trino-user-name";
pub const TRINO_AUTHORIZATION: &'static str = "p-trino-authorization";
pub const TRINO_SCHEMA: &'static str = "p-trino-schema";

pub const AUDIT_LOGGER: &'static str = "audit-logger";
pub const AUDIT_USERNAME: &'static str = "audit-username";
pub const AUDIT_PASSWORD: &'static str = "audit-password";
Expand Down Expand Up @@ -201,41 +187,6 @@ impl Cli {
.value_name("STRING")
.help("Audit logger password"),
)
.arg(
Arg::new(Self::TRINO_ENDPOINT)
.long(Self::TRINO_ENDPOINT)
.env("P_TRINO_ENDPOINT")
.value_name("STRING")
.help("Address and port for Trino HTTP(s) server"),
)
.arg(
Arg::new(Self::TRINO_CATALOG_NAME)
.long(Self::TRINO_CATALOG_NAME)
.env("P_TRINO_CATALOG_NAME")
.value_name("STRING")
.help("Name of the catalog to be queried (Translates to X-Trino-Catalog)"),
)
.arg(
Arg::new(Self::TRINO_SCHEMA)
.long(Self::TRINO_SCHEMA)
.env("P_TRINO_SCHEMA")
.value_name("STRING")
.help("Name of schema to be queried (Translates to X-Trino-Schema)"),
)
.arg(
Arg::new(Self::TRINO_USER_NAME)
.long(Self::TRINO_USER_NAME)
.env("P_TRINO_USER_NAME")
.value_name("STRING")
.help("Name of Trino user (Translates to X-Trino-User)"),
)
.arg(
Arg::new(Self::TRINO_AUTHORIZATION)
.long(Self::TRINO_AUTHORIZATION)
.env("P_TRINO_AUTHORIZATION")
.value_name("STRING")
.help("Base 64 encoded in the format username:password"),
)
.arg(
Arg::new(Self::TLS_CERT)
.long(Self::TLS_CERT)
Expand Down Expand Up @@ -516,12 +467,6 @@ impl FromArgMatches for Cli {
}

fn update_from_arg_matches(&mut self, m: &clap::ArgMatches) -> Result<(), clap::Error> {
self.trino_catalog = m.get_one::<String>(Self::TRINO_CATALOG_NAME).cloned();
self.trino_endpoint = m.get_one::<String>(Self::TRINO_ENDPOINT).cloned();
self.trino_auth = m.get_one::<String>(Self::TRINO_AUTHORIZATION).cloned();
self.trino_schema = m.get_one::<String>(Self::TRINO_SCHEMA).cloned();
self.trino_username = m.get_one::<String>(Self::TRINO_USER_NAME).cloned();

self.audit_logger = m.get_one::<Url>(Self::AUDIT_LOGGER).cloned();
self.audit_username = m.get_one::<String>(Self::AUDIT_USERNAME).cloned();
self.audit_password = m.get_one::<String>(Self::AUDIT_PASSWORD).cloned();
Expand Down
16 changes: 2 additions & 14 deletions src/handlers/http/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

use actix_web::web::Json;
use serde_json::json;
use serde_json::{json, Value};

use crate::{
about::{self, get_latest_release},
Expand Down Expand Up @@ -45,7 +45,7 @@ use std::path::PathBuf;
/// "path": store_endpoint
/// }
/// }
pub async fn about() -> Json<serde_json::Value> {
pub async fn about() -> Json<Value> {
let meta = StorageMetadata::global();

let current_release = about::current();
Expand Down Expand Up @@ -86,16 +86,6 @@ pub async fn about() -> Json<serde_json::Value> {
};

let ms_clarity_tag = &CONFIG.parseable.ms_clarity_tag;
let mut query_engine = "Parseable".to_string();
if let (Some(_), Some(_), Some(_), Some(_)) = (
CONFIG.parseable.trino_endpoint.as_ref(),
CONFIG.parseable.trino_catalog.as_ref(),
CONFIG.parseable.trino_schema.as_ref(),
CONFIG.parseable.trino_username.as_ref(),
) {
// Trino is enabled
query_engine = "Trino".to_string();
}

Json(json!({
"version": current_version,
Expand All @@ -119,7 +109,5 @@ pub async fn about() -> Json<serde_json::Value> {
"analytics": {
"clarityTag": ms_clarity_tag
},
"queryEngine": query_engine

}))
}
1 change: 0 additions & 1 deletion src/handlers/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub mod oidc;
pub mod query;
pub mod rbac;
pub mod role;
pub mod trino;
pub mod users;
pub const MAX_EVENT_PAYLOAD_SIZE: usize = 10485760;
pub const API_BASE_PATH: &str = "api";
Expand Down
1 change: 0 additions & 1 deletion src/handlers/http/modal/query_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ impl ParseableServer for QueryServer {
web::scope(&base_path())
.service(Server::get_correlation_webscope())
.service(Server::get_query_factory())
.service(Server::get_trino_factory())
.service(Server::get_liveness_factory())
.service(Server::get_readiness_factory())
.service(Server::get_about_factory())
Expand Down
8 changes: 0 additions & 8 deletions src/handlers/http/modal/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::handlers::http::about;
use crate::handlers::http::base_path;
use crate::handlers::http::health_check;
use crate::handlers::http::query;
use crate::handlers::http::trino;
use crate::handlers::http::users::dashboards;
use crate::handlers::http::users::filters;
use crate::hottier::HotTierManager;
Expand Down Expand Up @@ -70,7 +69,6 @@ impl ParseableServer for Server {
web::scope(&base_path())
.service(Self::get_correlation_webscope())
.service(Self::get_query_factory())
.service(Self::get_trino_factory())
.service(Self::get_ingest_factory())
.service(Self::get_liveness_factory())
.service(Self::get_readiness_factory())
Expand Down Expand Up @@ -163,12 +161,6 @@ impl ParseableServer for Server {
}

impl Server {
// get the trino factory
pub fn get_trino_factory() -> Resource {
web::resource("/trinoquery")
.route(web::post().to(trino::trino_query).authorize(Action::Query))
}

pub fn get_metrics_webscope() -> Scope {
web::scope("/metrics").service(
web::resource("").route(web::get().to(metrics::get).authorize(Action::Metrics)),
Expand Down
Loading

0 comments on commit c5f61c2

Please sign in to comment.