K2V #293

Merged
lx merged 68 commits from k2v into main 2022-05-10 11:16:58 +00:00
4 changed files with 6 additions and 6 deletions
Showing only changes of commit 03bfdfb4ef - Show all commits

View file

@ -23,7 +23,7 @@ use crate::error::*;
pub(crate) trait ApiEndpoint: Send + Sync + 'static { pub(crate) trait ApiEndpoint: Send + Sync + 'static {
fn name(&self) -> &'static str; fn name(&self) -> &'static str;
fn add_span_attributes<'a>(&self, span: SpanRef<'a>); fn add_span_attributes(&self, span: SpanRef<'_>);
} }
#[async_trait] #[async_trait]

View file

@ -9,8 +9,8 @@ use hyper::{Body, Method, Request, Response};
use opentelemetry::{trace::SpanRef, KeyValue}; use opentelemetry::{trace::SpanRef, KeyValue};
use garage_util::error::Error as GarageError;
use garage_table::util::*; use garage_table::util::*;
use garage_util::error::Error as GarageError;
use garage_model::garage::Garage; use garage_model::garage::Garage;
use garage_model::key_table::Key; use garage_model::key_table::Key;
@ -96,7 +96,7 @@ impl ApiHandler for S3ApiServer {
.and_then(|root_domain| host_to_bucket(&host, root_domain)); .and_then(|root_domain| host_to_bucket(&host, root_domain));
let (endpoint, bucket_name) = let (endpoint, bucket_name) =
Endpoint::from_request(&req, bucket_name.map(ToOwned::to_owned))?; Endpoint::from_request(req, bucket_name.map(ToOwned::to_owned))?;
Ok(S3ApiEndpoint { Ok(S3ApiEndpoint {
bucket_name, bucket_name,
@ -432,7 +432,7 @@ impl ApiEndpoint for S3ApiEndpoint {
self.endpoint.name() self.endpoint.name()
} }
fn add_span_attributes<'a>(&self, span: SpanRef<'a>) { fn add_span_attributes(&self, span: SpanRef<'_>) {
span.set_attribute(KeyValue::new( span.set_attribute(KeyValue::new(
"bucket", "bucket",
self.bucket_name.clone().unwrap_or_default(), self.bucket_name.clone().unwrap_or_default(),

View file

@ -151,8 +151,7 @@ impl Garage {
); );
// ---- K2V tables ---- // ---- K2V tables ----
let k2v_item_table = let k2v_item_table = Table::new(K2VItemTable {}, meta_rep_param, system.clone(), &db);
Table::new(K2VItemTable {}, meta_rep_param.clone(), system.clone(), &db);
info!("Initialize Garage..."); info!("Initialize Garage...");

View file

@ -203,6 +203,7 @@ impl TableSchema for K2VItemTable {
// nothing for now // nothing for now
} }
#[allow(clippy::nonminimal_bool)]
fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool { fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool {
let v = entry.values(); let v = entry.values();
!(filter.conflicts_only && v.len() < 2) !(filter.conflicts_only && v.len() < 2)