diff --git a/lib/vector-core/src/event/mod.rs b/lib/vector-core/src/event/mod.rs index 3b9d237339268..49c002fb2e037 100644 --- a/lib/vector-core/src/event/mod.rs +++ b/lib/vector-core/src/event/mod.rs @@ -14,15 +14,15 @@ use serde::{Deserialize, Serialize}; pub use trace::TraceEvent; use vector_buffers::EventCount; use vector_common::{ - config::ComponentKey, finalization, internal_event::TaggedEventsSent, json_size::JsonSize, - request_metadata::GetEventCountTags, EventDataEq, + byte_size_of::ByteSizeOf, config::ComponentKey, finalization, internal_event::TaggedEventsSent, + json_size::JsonSize, request_metadata::GetEventCountTags, EventDataEq, }; pub use vrl::value::Value; #[cfg(feature = "vrl")] pub use vrl_target::{TargetEvents, VrlTarget}; use crate::config::LogNamespace; -use crate::{config::OutputId, ByteSizeOf}; +use crate::config::OutputId; pub mod array; pub mod discriminant; diff --git a/lib/vector-core/src/lib.rs b/lib/vector-core/src/lib.rs index 33b8821abf843..21d68b5084c36 100644 --- a/lib/vector-core/src/lib.rs +++ b/lib/vector-core/src/lib.rs @@ -51,10 +51,6 @@ use std::path::PathBuf; #[cfg(feature = "vrl")] pub use crate::vrl::compile_vrl; -#[cfg(any(test, feature = "test"))] -pub use vector_common::event_test_util; -pub use vector_common::{byte_size_of::ByteSizeOf, internal_event}; - pub use event::EstimatedJsonEncodedSizeOf; #[macro_use] diff --git a/lib/vector-core/src/transform/mod.rs b/lib/vector-core/src/transform/mod.rs index 4083f34cc8e99..8cceefea7a2d4 100644 --- a/lib/vector-core/src/transform/mod.rs +++ b/lib/vector-core/src/transform/mod.rs @@ -5,8 +5,7 @@ use futures::{Stream, StreamExt}; use vector_common::internal_event::{ self, register, CountByteSize, EventsSent, InternalEventHandle as _, Registered, DEFAULT_OUTPUT, }; -use vector_common::json_size::JsonSize; -use vector_common::EventDataEq; +use vector_common::{byte_size_of::ByteSizeOf, json_size::JsonSize, EventDataEq}; use crate::config::{ComponentKey, OutputId}; use crate::event::EventMutRef; @@ -17,7 +16,7 @@ use crate::{ into_event_stream, EstimatedJsonEncodedSizeOf, Event, EventArray, EventContainer, EventRef, }, fanout::{self, Fanout}, - schema, ByteSizeOf, + schema, }; #[cfg(feature = "lua")] diff --git a/lib/vector-lib/src/lib.rs b/lib/vector-lib/src/lib.rs index ed8ef4af9b3e5..9ffa72947f373 100644 --- a/lib/vector-lib/src/lib.rs +++ b/lib/vector-lib/src/lib.rs @@ -5,6 +5,8 @@ pub use file_source; #[cfg(feature = "api-client")] pub use vector_api_client as api_client; pub use vector_buffers as buffers; +#[cfg(feature = "test")] +pub use vector_common::event_test_util; pub use vector_common::{ assert_event_data_eq, btreemap, byte_size_of, byte_size_of::ByteSizeOf, conversion, encode_logfmt, finalization, finalizer, impl_event_data_eq, internal_event, json_size, @@ -15,8 +17,6 @@ pub use vector_config as configurable; pub use vector_config::impl_generate_config_from_default; #[cfg(feature = "vrl")] pub use vector_core::compile_vrl; -#[cfg(feature = "test")] -pub use vector_core::event_test_util; pub use vector_core::{ buckets, default_data_dir, emit, event, fanout, metric_tags, metrics, partition, quantiles, register, samples, schema, serde, sink, source, tcp, tls, transform, update_counter, diff --git a/lib/vector-stream/src/batcher/limiter.rs b/lib/vector-stream/src/batcher/limiter.rs index 873c5bdd323b1..fe582d4b7a5e0 100644 --- a/lib/vector-stream/src/batcher/limiter.rs +++ b/lib/vector-stream/src/batcher/limiter.rs @@ -1,4 +1,4 @@ -use vector_core::ByteSizeOf; +use vector_common::byte_size_of::ByteSizeOf; use crate::batcher::data::BatchData; diff --git a/lib/vector-stream/src/driver.rs b/lib/vector-stream/src/driver.rs index 3de357bdb134c..7a7b8386f8250 100644 --- a/lib/vector-stream/src/driver.rs +++ b/lib/vector-stream/src/driver.rs @@ -4,15 +4,13 @@ use futures::{poll, FutureExt, Stream, StreamExt, TryFutureExt}; use tokio::{pin, select}; use tower::Service; use tracing::Instrument; +use vector_common::internal_event::emit; use vector_common::internal_event::{ register, ByteSize, BytesSent, CallError, InternalEventHandle as _, PollReadyError, Registered, RegisteredEventCache, SharedString, TaggedEventsSent, }; use vector_common::request_metadata::{GroupedCountByteSize, MetaDescriptive}; -use vector_core::{ - event::{EventFinalizers, EventStatus, Finalizable}, - internal_event::emit, -}; +use vector_core::event::{EventFinalizers, EventStatus, Finalizable}; use super::FuturesUnorderedCount; diff --git a/lib/vector-stream/src/partitioned_batcher.rs b/lib/vector-stream/src/partitioned_batcher.rs index b865216c1f764..e39746f8e7154 100644 --- a/lib/vector-stream/src/partitioned_batcher.rs +++ b/lib/vector-stream/src/partitioned_batcher.rs @@ -11,7 +11,8 @@ use futures::stream::{Fuse, Stream, StreamExt}; use pin_project::pin_project; use tokio_util::time::{delay_queue::Key, DelayQueue}; use twox_hash::XxHash64; -use vector_core::{partition::Partitioner, time::KeyedTimer, ByteSizeOf}; +use vector_common::byte_size_of::ByteSizeOf; +use vector_core::{partition::Partitioner, time::KeyedTimer}; use crate::batcher::{ config::BatchConfigParts, diff --git a/src/app.rs b/src/app.rs index 37247714df537..5151557f03f02 100644 --- a/src/app.rs +++ b/src/app.rs @@ -7,6 +7,7 @@ use futures::StreamExt; use futures_util::future::BoxFuture; use once_cell::race::OnceNonZeroUsize; use tokio::runtime::{self, Runtime}; +use tokio::sync::broadcast::error::RecvError; use tokio_stream::wrappers::UnboundedReceiverStream; #[cfg(feature = "enterprise")] @@ -22,6 +23,7 @@ use crate::{ cli::{handle_config_errors, LogFormat, Opts, RootOpts}, config::{self, Config, ConfigPath}, heartbeat, + internal_events::{VectorQuit, VectorStarted, VectorStopped}, signal::{SignalHandler, SignalPair, SignalRx, SignalTo}, topology::{ ReloadOutcome, RunningTopology, SharedTopologyController, ShutdownErrorReceiver, @@ -38,10 +40,6 @@ use tokio::runtime::Handle; pub static WORKER_THREADS: OnceNonZeroUsize = OnceNonZeroUsize::new(); -use crate::internal_events::{VectorQuit, VectorStarted, VectorStopped}; - -use tokio::sync::broadcast::error::RecvError; - pub struct ApplicationConfig { pub config_paths: Vec, pub topology: RunningTopology, diff --git a/src/lib.rs b/src/lib.rs index 4465fa3e72390..a9fffec42130d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,7 +95,7 @@ pub mod serde; #[cfg(windows)] pub mod service; pub mod signal; -pub(crate) mod sink; +pub(crate) mod sink_ext; #[allow(unreachable_pub)] pub mod sinks; pub mod source_sender; diff --git a/src/sink.rs b/src/sink_ext.rs similarity index 100% rename from src/sink.rs rename to src/sink_ext.rs diff --git a/src/sinks/util/unix.rs b/src/sinks/util/unix.rs index b89ece6b37a94..38cc62e2525fd 100644 --- a/src/sinks/util/unix.rs +++ b/src/sinks/util/unix.rs @@ -17,7 +17,7 @@ use crate::{ ConnectionOpen, OpenGauge, SocketMode, UnixSocketConnectionEstablished, UnixSocketOutgoingConnectionError, UnixSocketSendError, }, - sink::VecSinkExt, + sink_ext::VecSinkExt, sinks::{ util::{ retries::ExponentialBackoff,