Skip to content

Commit

Permalink
chore(dev): Wrap vector-stream in vector-lib (vectordotdev#18953)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceg authored Oct 27, 2023
1 parent 741aec3 commit 8a02b16
Show file tree
Hide file tree
Showing 35 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ tracing-limit = { path = "lib/tracing-limit" }
vector-api-client = { path = "lib/vector-api-client", optional = true }
vector-buffers = { path = "lib/vector-buffers", default-features = false }
vector-lib = { path = "lib/vector-lib", default-features = false, features = ["vrl"] }
vector-stream = { path = "lib/vector-stream" }
vector-vrl-functions = { path = "lib/vector-vrl/functions" }
loki-logproto = { path = "lib/loki-logproto", optional = true }

Expand Down
1 change: 1 addition & 0 deletions lib/vector-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ publish = false
vector-common = { path = "../vector-common" }
vector-config = { path = "../vector-config" }
vector-core = { path = "../vector-core", default-features = false }
vector-stream = { path = "../vector-stream" }

[features]
api = ["vector-core/api"]
Expand Down
1 change: 1 addition & 0 deletions lib/vector-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub use vector_core::{
samples, schema, serde, sink, source, tcp, tls, transform, update_counter,
EstimatedJsonEncodedSizeOf,
};
pub use vector_stream as stream;

pub mod config {
pub use vector_common::config::ComponentKey;
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/appsignal/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use http::{header::AUTHORIZATION, Request, StatusCode, Uri};
use hyper::Body;
use tower::{Service, ServiceExt};

use vector_lib::stream::DriverResponse;
use vector_lib::{
finalization::EventStatus, request_metadata::GroupedCountByteSize,
request_metadata::MetaDescriptive, sensitive_string::SensitiveString,
};
use vector_stream::DriverResponse;

use crate::{
http::HttpClient,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_cloudwatch_logs/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ use tower::{
timeout::Timeout,
Service, ServiceBuilder, ServiceExt,
};
use vector_lib::stream::DriverResponse;
use vector_lib::{
finalization::EventStatus,
request_metadata::{GroupedCountByteSize, MetaDescriptive},
};
use vector_stream::DriverResponse;

use crate::sinks::{
aws_cloudwatch_logs::{
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_cloudwatch_logs/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use chrono::{Duration, Utc};
use futures::{future, stream::BoxStream, StreamExt};
use tower::Service;
use vector_lib::request_metadata::{MetaDescriptive, RequestMetadata};
use vector_lib::stream::{BatcherSettings, DriverResponse};
use vector_lib::{partition::Partitioner, sink::StreamSink};
use vector_stream::{BatcherSettings, DriverResponse};

use crate::{
event::{Event, EventFinalizers, Finalizable},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_kinesis/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use lookup::lookup_v2::ConfigValuePath;
use std::marker::PhantomData;

use vector_stream::BatcherSettings;
use vector_lib::stream::BatcherSettings;

use crate::{
aws::{AwsAuthentication, RegionOrEndpoint},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/aws_s_s/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use aws_sdk_sqs::types::SdkError;
use futures::future::BoxFuture;
use tower::Service;
use vector_lib::request_metadata::GroupedCountByteSize;
use vector_lib::stream::DriverResponse;
use vector_lib::{event::EventStatus, ByteSizeOf};
use vector_stream::DriverResponse;

use super::{client::Client, request_builder::SendMessageEntry};

Expand Down
2 changes: 1 addition & 1 deletion src/sinks/azure_common/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use bytes::Bytes;
use futures::FutureExt;
use http::StatusCode;
use snafu::Snafu;
use vector_lib::stream::DriverResponse;
use vector_lib::{
json_size::JsonSize,
request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata},
};
use vector_stream::DriverResponse;

use crate::{
event::{EventFinalizers, EventStatus, Finalizable},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/databend/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use snafu::Snafu;
use tower::Service;
use vector_lib::finalization::{EventFinalizers, EventStatus, Finalizable};
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use crate::{internal_events::EndpointBytesSent, sinks::util::retries::RetryLogic};

Expand Down
2 changes: 1 addition & 1 deletion src/sinks/datadog/events/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use http::Request;
use hyper::Body;
use tower::{Service, ServiceExt};
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use crate::{
event::EventStatus,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/datadog/logs/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use tower::Service;
use tracing::Instrument;
use vector_lib::event::{EventFinalizers, EventStatus, Finalizable};
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use crate::{
http::HttpClient,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/datadog/metrics/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use snafu::ResultExt;
use tower::Service;
use vector_lib::event::{EventFinalizers, EventStatus, Finalizable};
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use crate::{
http::{BuildRequestSnafu, CallRequestSnafu, HttpClient},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/datadog/metrics/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ use futures_util::{
StreamExt,
};
use tower::Service;
use vector_lib::stream::{BatcherSettings, DriverResponse};
use vector_lib::{
event::{Event, Metric, MetricValue},
partition::Partitioner,
sink::StreamSink,
};
use vector_stream::{BatcherSettings, DriverResponse};

use super::{
config::DatadogMetricsEndpoint, normalizer::DatadogMetricsNormalizer,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/datadog/traces/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use snafu::ResultExt;
use tower::Service;
use vector_lib::event::{EventFinalizers, EventStatus, Finalizable};
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use crate::{
http::{BuildRequestSnafu, CallRequestSnafu, HttpClient, HttpError},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/datadog/traces/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use futures_util::{
};
use tokio::sync::oneshot::{channel, Sender};
use tower::Service;
use vector_lib::stream::{BatcherSettings, DriverResponse};
use vector_lib::{config::log_schema, event::Event, partition::Partitioner, sink::StreamSink};
use vector_stream::{BatcherSettings, DriverResponse};
use vrl::event_path;
use vrl::path::PathPrefix;

Expand Down
2 changes: 1 addition & 1 deletion src/sinks/elasticsearch/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ use futures::future::BoxFuture;
use http::{Response, Uri};
use hyper::{service::Service, Body, Request};
use tower::ServiceExt;
use vector_lib::stream::DriverResponse;
use vector_lib::ByteSizeOf;
use vector_lib::{
json_size::JsonSize,
request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata},
};
use vector_stream::DriverResponse;

use super::{ElasticsearchCommon, ElasticsearchConfig};
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/gcs_common/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use http::{
use hyper::Body;
use tower::Service;
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use crate::{
event::{EventFinalizers, EventStatus, Finalizable},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/greptimedb/batch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use vector_lib::event::{Metric, MetricValue};
use vector_stream::batcher::limiter::ItemBatchSize;
use vector_lib::stream::batcher::limiter::ItemBatchSize;

use super::request_builder::{
DISTRIBUTION_QUANTILES, DISTRIBUTION_STAT_FIELD_COUNT, SUMMARY_STAT_FIELD_COUNT,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/http/batch.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Batch settings for the `http` sink.
use codecs::encoding::Framer;
use vector_lib::stream::batcher::limiter::ItemBatchSize;
use vector_lib::{event::Event, ByteSizeOf, EstimatedJsonEncodedSizeOf};
use vector_stream::batcher::limiter::ItemBatchSize;

use crate::codecs::Encoder;

Expand Down
2 changes: 1 addition & 1 deletion src/sinks/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub use futures::{future, future::BoxFuture, stream::BoxStream, FutureExt, Strea
pub use tower::{Service, ServiceBuilder};
pub use vector_buffers::EventCount;
pub use vector_lib::configurable::configurable_component;
pub use vector_lib::stream::{BatcherSettings, DriverResponse};
pub use vector_lib::{
config::{telemetry, AcknowledgementsConfig, Input},
event::Value,
Expand All @@ -21,7 +22,6 @@ pub use vector_lib::{
json_size::JsonSize,
request_metadata::{GetEventCountTags, GroupedCountByteSize, MetaDescriptive, RequestMetadata},
};
pub use vector_stream::{BatcherSettings, DriverResponse};

pub use crate::{
codecs::{Encoder, EncodingConfig, Transformer},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/prometheus/remote_write/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fmt;

use vector_lib::byte_size_of::ByteSizeOf;
use vector_lib::event::Metric;
use vector_stream::batcher::{data::BatchData, limiter::ByteSizeOfItemSize};
use vector_lib::stream::batcher::{data::BatchData, limiter::ByteSizeOfItemSize};

use crate::sinks::{prelude::*, util::buffer::metrics::MetricSet};

Expand Down
2 changes: 1 addition & 1 deletion src/sinks/s3_common/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tower::Service;
use tracing::Instrument;
use vector_lib::event::{EventFinalizers, EventStatus, Finalizable};
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use super::config::S3Options;
use super::partitioner::S3PartitionKey;
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/splunk_hec/common/response.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use vector_lib::event::EventStatus;
use vector_lib::request_metadata::GroupedCountByteSize;
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

pub struct HecResponse {
pub event_status: EventStatus,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/statsd/batch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use vector_lib::event::Metric;
use vector_stream::batcher::limiter::ItemBatchSize;
use vector_lib::stream::batcher::limiter::ItemBatchSize;

// This accounts for the separators, the metric type string, the length of the value itself. It can
// never be too small, as the above values will always take at least 4 bytes.
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/statsd/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::task::{Context, Poll};

use futures_util::future::BoxFuture;
use tower::Service;
use vector_lib::stream::DriverResponse;
use vector_lib::{
finalization::{EventFinalizers, EventStatus, Finalizable},
request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata},
};
use vector_stream::DriverResponse;

/// Generalized request for sending metrics to a StatsD endpoint.
#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/statsd/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use futures_util::{
};
use tower::Service;
use vector_lib::internal_event::Protocol;
use vector_lib::stream::{BatcherSettings, DriverResponse};
use vector_lib::{event::Event, sink::StreamSink};
use vector_stream::{BatcherSettings, DriverResponse};

use crate::sinks::util::SinkBuilderExt;

Expand Down
2 changes: 1 addition & 1 deletion src/sinks/util/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde_with::serde_as;
use snafu::Snafu;
use vector_lib::configurable::configurable_component;
use vector_lib::json_size::JsonSize;
use vector_stream::BatcherSettings;
use vector_lib::stream::BatcherSettings;

use super::EncodedEvent;
use crate::{event::EventFinalizers, internal_events::LargeEventDroppedError};
Expand Down
8 changes: 4 additions & 4 deletions src/sinks/util/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ use std::{
use futures_util::{stream::Map, Stream, StreamExt};
use pin_project::pin_project;
use tower::Service;
use vector_lib::stream::{
batcher::{config::BatchConfig, Batcher},
ConcurrentMap, Driver, DriverResponse, ExpirationQueue, PartitionedBatcher,
};
use vector_lib::{
event::{Finalizable, Metric},
partition::Partitioner,
ByteSizeOf,
};
use vector_stream::{
batcher::{config::BatchConfig, Batcher},
ConcurrentMap, Driver, DriverResponse, ExpirationQueue, PartitionedBatcher,
};

use super::{
buffer::metrics::MetricNormalize, IncrementalRequestBuilder, Normalizer, RequestBuilder,
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/util/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use snafu::{ResultExt, Snafu};
use tower::{Service, ServiceBuilder};
use tower_http::decompression::DecompressionLayer;
use vector_lib::configurable::configurable_component;
use vector_lib::stream::batcher::limiter::ItemBatchSize;
use vector_lib::{ByteSizeOf, EstimatedJsonEncodedSizeOf};
use vector_stream::batcher::limiter::ItemBatchSize;

use super::{
retries::{RetryAction, RetryLogic},
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/vector/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use prost::Message;
use tonic::{body::BoxBody, IntoRequest};
use tower::Service;
use vector_lib::request_metadata::{GroupedCountByteSize, MetaDescriptive, RequestMetadata};
use vector_stream::DriverResponse;
use vector_lib::stream::DriverResponse;

use super::VectorSinkError;
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/vector/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use futures::{stream::BoxStream, StreamExt};
use prost::Message;
use tower::Service;
use vector_lib::request_metadata::GroupedCountByteSize;
use vector_lib::stream::{batcher::data::BatchReduce, BatcherSettings, DriverResponse};
use vector_lib::{config::telemetry, ByteSizeOf, EstimatedJsonEncodedSizeOf};
use vector_stream::{batcher::data::BatchReduce, BatcherSettings, DriverResponse};

use super::service::VectorRequest;
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/sources/kubernetes_logs/partial_events_merger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use lookup::OwnedTargetPath;
use std::collections::HashMap;
use std::time::{Duration, Instant};
use vector_lib::config::LogNamespace;
use vector_stream::expiration_map::{map_with_expiration, Emitter};
use vector_lib::stream::expiration_map::{map_with_expiration, Emitter};
use vrl::owned_value_path;

use crate::event;
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/reduce/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::config::schema::Definition;
use crate::event::Value;
pub use merge_strategy::*;
use vector_lib::config::LogNamespace;
use vector_stream::expiration_map::{map_with_expiration, Emitter};
use vector_lib::stream::expiration_map::{map_with_expiration, Emitter};
use vrl::value::kind::Collection;
use vrl::value::Kind;

Expand Down

0 comments on commit 8a02b16

Please sign in to comment.