Skip to content

Commit

Permalink
chore(dev): Simplify a few tiny import issues in vector-lib (#19066)
Browse files Browse the repository at this point in the history
* chore(dev): Drop a few re-exports within lib

* Rename `src/sink.rs` to `sink_ext.rs`

* Simplify imports in `app.rs`
  • Loading branch information
bruceg authored Nov 8, 2023
1 parent 3902b23 commit 2a0404a
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 24 deletions.
6 changes: 3 additions & 3 deletions lib/vector-core/src/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions lib/vector-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 2 additions & 3 deletions lib/vector-core/src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,7 +16,7 @@ use crate::{
into_event_stream, EstimatedJsonEncodedSizeOf, Event, EventArray, EventContainer, EventRef,
},
fanout::{self, Fanout},
schema, ByteSizeOf,
schema,
};

#[cfg(feature = "lua")]
Expand Down
4 changes: 2 additions & 2 deletions lib/vector-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-stream/src/batcher/limiter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use vector_core::ByteSizeOf;
use vector_common::byte_size_of::ByteSizeOf;

use crate::batcher::data::BatchData;

Expand Down
6 changes: 2 additions & 4 deletions lib/vector-stream/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion lib/vector-stream/src/partitioned_batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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,
Expand All @@ -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<config::ConfigPath>,
pub topology: RunningTopology,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/sinks/util/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
ConnectionOpen, OpenGauge, SocketMode, UnixSocketConnectionEstablished,
UnixSocketOutgoingConnectionError, UnixSocketSendError,
},
sink::VecSinkExt,
sink_ext::VecSinkExt,
sinks::{
util::{
retries::ExponentialBackoff,
Expand Down

0 comments on commit 2a0404a

Please sign in to comment.