Skip to content

Commit 5456281

Browse files
nipunn1313Convex, Inc.
authored and
Convex, Inc.
committed
Move DocInVectorIndex from usage_tracking -> vector (#27332)
It's not used by usage and it's not really usage related GitOrigin-RevId: 4882598f025c69ad83e315a456a8d2f77d58ea52
1 parent e4896a7 commit 5456281

File tree

7 files changed

+22
-26
lines changed

7 files changed

+22
-26
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/database/src/committer.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ use indexing::index_registry::IndexRegistry;
8383
use minitrace::prelude::*;
8484
use parking_lot::Mutex;
8585
use prometheus::VMHistogram;
86-
use usage_tracking::{
87-
DocInVectorIndex,
88-
FunctionUsageTracker,
89-
};
86+
use usage_tracking::FunctionUsageTracker;
9087
use value::{
9188
heap_size::WithHeapSize,
9289
id_v6::DeveloperDocumentId,
@@ -96,6 +93,7 @@ use value::{
9693
TableName,
9794
TabletId,
9895
};
96+
use vector::DocInVectorIndex;
9997

10098
use crate::{
10199
bootstrap_model::defaults::BootstrapTableIds,

crates/database/src/snapshot_manager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ use indexing::{
3030
index_registry::IndexRegistry,
3131
};
3232
use search::SearchIndexManager;
33-
use usage_tracking::DocInVectorIndex;
3433
use value::{
3534
ResolvedDocumentId,
3635
TableMapping,
3736
TableName,
3837
TableNamespace,
3938
TabletId,
4039
};
41-
use vector::VectorIndexManager;
40+
use vector::{
41+
DocInVectorIndex,
42+
VectorIndexManager,
43+
};
4244

4345
use crate::{
4446
table_registry::{

crates/usage_tracking/src/lib.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,6 @@ impl HeapSize for UsageCounterState {
8383
}
8484
}
8585

86-
/// Present if a document is in a table with one or more vector indexes and has
87-
/// an actual vector in at least one of those indexes.
88-
///
89-
/// Should be Absent if the table has no vector indexes or if this particular
90-
/// document does not have a vector in any of the vector indexes.
91-
#[derive(Clone, Copy, PartialEq, Eq)]
92-
#[cfg_attr(
93-
any(test, feature = "testing"),
94-
derive(Debug, proptest_derive::Arbitrary)
95-
)]
96-
pub enum DocInVectorIndex {
97-
Present,
98-
Absent,
99-
}
100-
10186
/// The core usage stats aggregator that is cheaply cloneable
10287
#[derive(Clone, Debug)]
10388
pub struct UsageCounter {

crates/vector/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ serde_json = { workspace = true }
3232
storage = { path = "../storage" }
3333
tempfile = { workspace = true }
3434
tracing = { workspace = true }
35-
usage_tracking = { path = "../usage_tracking" }
3635
uuid = { workspace = true }
3736
value = { path = "../value" }
3837

@@ -47,7 +46,6 @@ proptest = { workspace = true }
4746
proptest-derive = { workspace = true }
4847
storage = { path = "../storage", features = ["testing"] }
4948
tokio = { workspace = true }
50-
usage_tracking = { path = "../usage_tracking", features = ["testing"] }
5149
value = { path = "../value", features = ["testing"] }
5250

5351
[features]
@@ -58,7 +56,6 @@ testing = [
5856
"metrics/testing",
5957
"proptest",
6058
"proptest-derive",
61-
"usage_tracking/testing",
6259
"value/testing",
6360
"storage/testing",
6461
]

crates/vector/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,18 @@ fn incorrect_vector_filter_field_error(
120120
),
121121
)
122122
}
123+
124+
/// Present if a document is in a table with one or more vector indexes and has
125+
/// an actual vector in at least one of those indexes.
126+
///
127+
/// Should be Absent if the table has no vector indexes or if this particular
128+
/// document does not have a vector in any of the vector indexes.
129+
#[derive(Clone, Copy, PartialEq, Eq)]
130+
#[cfg_attr(
131+
any(test, feature = "testing"),
132+
derive(Debug, proptest_derive::Arbitrary)
133+
)]
134+
pub enum DocInVectorIndex {
135+
Present,
136+
Absent,
137+
}

crates/vector/src/vector_index_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use indexing::index_registry::{
3737
IndexRegistry,
3838
};
3939
use storage::Storage;
40-
use usage_tracking::DocInVectorIndex;
4140
use value::{
4241
InternalId,
4342
ResolvedDocumentId,
@@ -57,6 +56,7 @@ use crate::{
5756
},
5857
searcher::VectorSearcher,
5958
CompiledVectorSearch,
59+
DocInVectorIndex,
6060
};
6161

6262
#[derive(Clone)]

0 commit comments

Comments
 (0)