mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-10-10 13:46:28 +00:00
Rename operation to IndexCompaction
This commit is contained in:
committed by
Clément Renault
parent
77baf91b0a
commit
cf55420d25
@@ -158,7 +158,7 @@ pub enum KindDump {
|
|||||||
UpgradeDatabase {
|
UpgradeDatabase {
|
||||||
from: (u32, u32, u32),
|
from: (u32, u32, u32),
|
||||||
},
|
},
|
||||||
CompactIndex {
|
IndexCompaction {
|
||||||
index_uid: String,
|
index_uid: String,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,9 @@ impl From<KindWithContent> for KindDump {
|
|||||||
KindWithContent::UpgradeDatabase { from: version } => {
|
KindWithContent::UpgradeDatabase { from: version } => {
|
||||||
KindDump::UpgradeDatabase { from: version }
|
KindDump::UpgradeDatabase { from: version }
|
||||||
}
|
}
|
||||||
KindWithContent::CompactIndex { index_uid } => KindDump::CompactIndex { index_uid },
|
KindWithContent::IndexCompaction { index_uid } => {
|
||||||
|
KindDump::IndexCompaction { index_uid }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -234,7 +234,9 @@ impl<'a> Dump<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
KindDump::UpgradeDatabase { from } => KindWithContent::UpgradeDatabase { from },
|
KindDump::UpgradeDatabase { from } => KindWithContent::UpgradeDatabase { from },
|
||||||
KindDump::CompactIndex { index_uid } => KindWithContent::CompactIndex { index_uid },
|
KindDump::IndexCompaction { index_uid } => {
|
||||||
|
KindWithContent::IndexCompaction { index_uid }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -317,7 +317,7 @@ fn snapshot_details(d: &Details) -> String {
|
|||||||
Details::UpgradeDatabase { from, to } => {
|
Details::UpgradeDatabase { from, to } => {
|
||||||
format!("{{ from: {from:?}, to: {to:?} }}")
|
format!("{{ from: {from:?}, to: {to:?} }}")
|
||||||
}
|
}
|
||||||
Details::CompactIndex { index_uid, pre_compaction_size, post_compaction_size } => {
|
Details::IndexCompaction { index_uid, pre_compaction_size, post_compaction_size } => {
|
||||||
format!("{{ index_uid: {index_uid:?}, pre_compaction_size: {pre_compaction_size:?}, post_compaction_size: {post_compaction_size:?} }}")
|
format!("{{ index_uid: {index_uid:?}, pre_compaction_size: {pre_compaction_size:?}, post_compaction_size: {post_compaction_size:?} }}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ enum AutobatchKind {
|
|||||||
IndexDeletion,
|
IndexDeletion,
|
||||||
IndexUpdate,
|
IndexUpdate,
|
||||||
IndexSwap,
|
IndexSwap,
|
||||||
CompactIndex,
|
IndexCompaction,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AutobatchKind {
|
impl AutobatchKind {
|
||||||
@@ -69,7 +69,7 @@ impl From<KindWithContent> for AutobatchKind {
|
|||||||
KindWithContent::IndexCreation { .. } => AutobatchKind::IndexCreation,
|
KindWithContent::IndexCreation { .. } => AutobatchKind::IndexCreation,
|
||||||
KindWithContent::IndexUpdate { .. } => AutobatchKind::IndexUpdate,
|
KindWithContent::IndexUpdate { .. } => AutobatchKind::IndexUpdate,
|
||||||
KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap,
|
KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap,
|
||||||
KindWithContent::CompactIndex { .. } => AutobatchKind::CompactIndex,
|
KindWithContent::IndexCompaction { .. } => AutobatchKind::IndexCompaction,
|
||||||
KindWithContent::TaskCancelation { .. }
|
KindWithContent::TaskCancelation { .. }
|
||||||
| KindWithContent::TaskDeletion { .. }
|
| KindWithContent::TaskDeletion { .. }
|
||||||
| KindWithContent::DumpCreation { .. }
|
| KindWithContent::DumpCreation { .. }
|
||||||
@@ -120,7 +120,7 @@ pub enum BatchKind {
|
|||||||
IndexSwap {
|
IndexSwap {
|
||||||
id: TaskId,
|
id: TaskId,
|
||||||
},
|
},
|
||||||
CompactIndex {
|
IndexCompaction {
|
||||||
id: TaskId,
|
id: TaskId,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -188,9 +188,9 @@ impl BatchKind {
|
|||||||
)),
|
)),
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
K::CompactIndex => (
|
K::IndexCompaction => (
|
||||||
Break((
|
Break((
|
||||||
BatchKind::CompactIndex { id: task_id },
|
BatchKind::IndexCompaction { id: task_id },
|
||||||
BatchStopReason::TaskCannotBeBatched { kind, id: task_id },
|
BatchStopReason::TaskCannotBeBatched { kind, id: task_id },
|
||||||
)),
|
)),
|
||||||
false,
|
false,
|
||||||
@@ -300,7 +300,7 @@ impl BatchKind {
|
|||||||
|
|
||||||
match (self, autobatch_kind) {
|
match (self, autobatch_kind) {
|
||||||
// We don't batch any of these operations
|
// We don't batch any of these operations
|
||||||
(this, K::IndexCreation | K::IndexUpdate | K::IndexSwap | K::DocumentEdition | K::CompactIndex) => {
|
(this, K::IndexCreation | K::IndexUpdate | K::IndexSwap | K::DocumentEdition | K::IndexCompaction) => {
|
||||||
Break((this, BatchStopReason::TaskCannotBeBatched { kind, id }))
|
Break((this, BatchStopReason::TaskCannotBeBatched { kind, id }))
|
||||||
},
|
},
|
||||||
// We must not batch tasks that don't have the same index creation rights if the index doesn't already exists.
|
// We must not batch tasks that don't have the same index creation rights if the index doesn't already exists.
|
||||||
@@ -497,7 +497,7 @@ impl BatchKind {
|
|||||||
| BatchKind::IndexDeletion { .. }
|
| BatchKind::IndexDeletion { .. }
|
||||||
| BatchKind::IndexUpdate { .. }
|
| BatchKind::IndexUpdate { .. }
|
||||||
| BatchKind::IndexSwap { .. }
|
| BatchKind::IndexSwap { .. }
|
||||||
| BatchKind::CompactIndex { .. }
|
| BatchKind::IndexCompaction { .. }
|
||||||
| BatchKind::DocumentEdition { .. },
|
| BatchKind::DocumentEdition { .. },
|
||||||
_,
|
_,
|
||||||
) => {
|
) => {
|
||||||
|
@@ -55,7 +55,7 @@ pub(crate) enum Batch {
|
|||||||
UpgradeDatabase {
|
UpgradeDatabase {
|
||||||
tasks: Vec<Task>,
|
tasks: Vec<Task>,
|
||||||
},
|
},
|
||||||
CompactIndex {
|
IndexCompaction {
|
||||||
index_uid: String,
|
index_uid: String,
|
||||||
task: Task,
|
task: Task,
|
||||||
},
|
},
|
||||||
@@ -115,7 +115,7 @@ impl Batch {
|
|||||||
| Batch::IndexCreation { task, .. }
|
| Batch::IndexCreation { task, .. }
|
||||||
| Batch::Export { task }
|
| Batch::Export { task }
|
||||||
| Batch::IndexUpdate { task, .. }
|
| Batch::IndexUpdate { task, .. }
|
||||||
| Batch::CompactIndex { task, .. } => {
|
| Batch::IndexCompaction { task, .. } => {
|
||||||
RoaringBitmap::from_sorted_iter(std::iter::once(task.uid)).unwrap()
|
RoaringBitmap::from_sorted_iter(std::iter::once(task.uid)).unwrap()
|
||||||
}
|
}
|
||||||
Batch::SnapshotCreation(tasks)
|
Batch::SnapshotCreation(tasks)
|
||||||
@@ -161,7 +161,7 @@ impl Batch {
|
|||||||
IndexCreation { index_uid, .. }
|
IndexCreation { index_uid, .. }
|
||||||
| IndexUpdate { index_uid, .. }
|
| IndexUpdate { index_uid, .. }
|
||||||
| IndexDeletion { index_uid, .. }
|
| IndexDeletion { index_uid, .. }
|
||||||
| CompactIndex { index_uid, .. } => Some(index_uid),
|
| IndexCompaction { index_uid, .. } => Some(index_uid),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ impl fmt::Display for Batch {
|
|||||||
Batch::IndexUpdate { .. } => f.write_str("IndexUpdate")?,
|
Batch::IndexUpdate { .. } => f.write_str("IndexUpdate")?,
|
||||||
Batch::IndexDeletion { .. } => f.write_str("IndexDeletion")?,
|
Batch::IndexDeletion { .. } => f.write_str("IndexDeletion")?,
|
||||||
Batch::IndexSwap { .. } => f.write_str("IndexSwap")?,
|
Batch::IndexSwap { .. } => f.write_str("IndexSwap")?,
|
||||||
Batch::CompactIndex { .. } => f.write_str("CompactIndex")?,
|
Batch::IndexCompaction { .. } => f.write_str("IndexCompaction")?,
|
||||||
Batch::Export { .. } => f.write_str("Export")?,
|
Batch::Export { .. } => f.write_str("Export")?,
|
||||||
Batch::UpgradeDatabase { .. } => f.write_str("UpgradeDatabase")?,
|
Batch::UpgradeDatabase { .. } => f.write_str("UpgradeDatabase")?,
|
||||||
};
|
};
|
||||||
@@ -437,11 +437,11 @@ impl IndexScheduler {
|
|||||||
current_batch.processing(Some(&mut task));
|
current_batch.processing(Some(&mut task));
|
||||||
Ok(Some(Batch::IndexSwap { task }))
|
Ok(Some(Batch::IndexSwap { task }))
|
||||||
}
|
}
|
||||||
BatchKind::CompactIndex { id } => {
|
BatchKind::IndexCompaction { id } => {
|
||||||
let mut task =
|
let mut task =
|
||||||
self.queue.tasks.get_task(rtxn, id)?.ok_or(Error::CorruptedTaskQueue)?;
|
self.queue.tasks.get_task(rtxn, id)?.ok_or(Error::CorruptedTaskQueue)?;
|
||||||
current_batch.processing(Some(&mut task));
|
current_batch.processing(Some(&mut task));
|
||||||
Ok(Some(Batch::CompactIndex { index_uid, task }))
|
Ok(Some(Batch::IndexCompaction { index_uid, task }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -418,8 +418,8 @@ impl IndexScheduler {
|
|||||||
task.status = Status::Succeeded;
|
task.status = Status::Succeeded;
|
||||||
Ok((vec![task], ProcessBatchInfo::default()))
|
Ok((vec![task], ProcessBatchInfo::default()))
|
||||||
}
|
}
|
||||||
Batch::CompactIndex { index_uid, mut task } => {
|
Batch::IndexCompaction { index_uid, mut task } => {
|
||||||
todo!("Implement compact index")
|
todo!("Implement index compaction")
|
||||||
}
|
}
|
||||||
Batch::Export { mut task } => {
|
Batch::Export { mut task } => {
|
||||||
let KindWithContent::Export { url, api_key, payload_size, indexes } = &task.kind
|
let KindWithContent::Export { url, api_key, payload_size, indexes } = &task.kind
|
||||||
|
@@ -264,7 +264,7 @@ pub fn swap_index_uid_in_task(task: &mut Task, swap: (&str, &str)) {
|
|||||||
| K::SettingsUpdate { index_uid, .. }
|
| K::SettingsUpdate { index_uid, .. }
|
||||||
| K::IndexDeletion { index_uid }
|
| K::IndexDeletion { index_uid }
|
||||||
| K::IndexCreation { index_uid, .. }
|
| K::IndexCreation { index_uid, .. }
|
||||||
| K::CompactIndex { index_uid, .. } => index_uids.push(index_uid),
|
| K::IndexCompaction { index_uid, .. } => index_uids.push(index_uid),
|
||||||
K::IndexUpdate { index_uid, new_index_uid, .. } => {
|
K::IndexUpdate { index_uid, new_index_uid, .. } => {
|
||||||
index_uids.push(index_uid);
|
index_uids.push(index_uid);
|
||||||
if let Some(new_uid) = new_index_uid {
|
if let Some(new_uid) = new_index_uid {
|
||||||
@@ -619,12 +619,12 @@ impl crate::IndexScheduler {
|
|||||||
Details::UpgradeDatabase { from: _, to: _ } => {
|
Details::UpgradeDatabase { from: _, to: _ } => {
|
||||||
assert_eq!(kind.as_kind(), Kind::UpgradeDatabase);
|
assert_eq!(kind.as_kind(), Kind::UpgradeDatabase);
|
||||||
}
|
}
|
||||||
Details::CompactIndex {
|
Details::IndexCompaction {
|
||||||
index_uid: _,
|
index_uid: _,
|
||||||
pre_compaction_size: _,
|
pre_compaction_size: _,
|
||||||
post_compaction_size: _,
|
post_compaction_size: _,
|
||||||
} => {
|
} => {
|
||||||
assert_eq!(kind.as_kind(), Kind::CompactIndex);
|
assert_eq!(kind.as_kind(), Kind::IndexCompaction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -438,7 +438,7 @@ impl From<Details> for DetailsView {
|
|||||||
upgrade_to: Some(format!("v{}.{}.{}", to.0, to.1, to.2)),
|
upgrade_to: Some(format!("v{}.{}.{}", to.0, to.1, to.2)),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
Details::CompactIndex { pre_compaction_size, post_compaction_size, .. } => {
|
Details::IndexCompaction { pre_compaction_size, post_compaction_size, .. } => {
|
||||||
DetailsView {
|
DetailsView {
|
||||||
pre_compaction_size: pre_compaction_size
|
pre_compaction_size: pre_compaction_size
|
||||||
.map(|size| size.get_appropriate_unit(UnitType::Both).to_string()),
|
.map(|size| size.get_appropriate_unit(UnitType::Both).to_string()),
|
||||||
|
@@ -68,7 +68,7 @@ impl Task {
|
|||||||
| IndexCreation { index_uid, .. }
|
| IndexCreation { index_uid, .. }
|
||||||
| IndexUpdate { index_uid, .. }
|
| IndexUpdate { index_uid, .. }
|
||||||
| IndexDeletion { index_uid }
|
| IndexDeletion { index_uid }
|
||||||
| CompactIndex { index_uid } => Some(index_uid),
|
| IndexCompaction { index_uid } => Some(index_uid),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ impl Task {
|
|||||||
| KindWithContent::SnapshotCreation
|
| KindWithContent::SnapshotCreation
|
||||||
| KindWithContent::Export { .. }
|
| KindWithContent::Export { .. }
|
||||||
| KindWithContent::UpgradeDatabase { .. }
|
| KindWithContent::UpgradeDatabase { .. }
|
||||||
| KindWithContent::CompactIndex { .. } => None,
|
| KindWithContent::IndexCompaction { .. } => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ pub enum KindWithContent {
|
|||||||
UpgradeDatabase {
|
UpgradeDatabase {
|
||||||
from: (u32, u32, u32),
|
from: (u32, u32, u32),
|
||||||
},
|
},
|
||||||
CompactIndex {
|
IndexCompaction {
|
||||||
index_uid: String,
|
index_uid: String,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ impl KindWithContent {
|
|||||||
KindWithContent::SnapshotCreation => Kind::SnapshotCreation,
|
KindWithContent::SnapshotCreation => Kind::SnapshotCreation,
|
||||||
KindWithContent::Export { .. } => Kind::Export,
|
KindWithContent::Export { .. } => Kind::Export,
|
||||||
KindWithContent::UpgradeDatabase { .. } => Kind::UpgradeDatabase,
|
KindWithContent::UpgradeDatabase { .. } => Kind::UpgradeDatabase,
|
||||||
KindWithContent::CompactIndex { .. } => Kind::CompactIndex,
|
KindWithContent::IndexCompaction { .. } => Kind::IndexCompaction,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ impl KindWithContent {
|
|||||||
| SettingsUpdate { index_uid, .. }
|
| SettingsUpdate { index_uid, .. }
|
||||||
| IndexCreation { index_uid, .. }
|
| IndexCreation { index_uid, .. }
|
||||||
| IndexDeletion { index_uid }
|
| IndexDeletion { index_uid }
|
||||||
| CompactIndex { index_uid } => vec![index_uid],
|
| IndexCompaction { index_uid } => vec![index_uid],
|
||||||
IndexUpdate { index_uid, new_index_uid, .. } => {
|
IndexUpdate { index_uid, new_index_uid, .. } => {
|
||||||
let mut indexes = vec![index_uid.as_str()];
|
let mut indexes = vec![index_uid.as_str()];
|
||||||
if let Some(new_uid) = new_index_uid {
|
if let Some(new_uid) = new_index_uid {
|
||||||
@@ -332,7 +332,7 @@ impl KindWithContent {
|
|||||||
versioning::VERSION_PATCH,
|
versioning::VERSION_PATCH,
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
KindWithContent::CompactIndex { index_uid } => Some(Details::CompactIndex {
|
KindWithContent::IndexCompaction { index_uid } => Some(Details::IndexCompaction {
|
||||||
index_uid: index_uid.clone(),
|
index_uid: index_uid.clone(),
|
||||||
pre_compaction_size: None,
|
pre_compaction_size: None,
|
||||||
post_compaction_size: None,
|
post_compaction_size: None,
|
||||||
@@ -419,7 +419,7 @@ impl KindWithContent {
|
|||||||
versioning::VERSION_PATCH,
|
versioning::VERSION_PATCH,
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
KindWithContent::CompactIndex { index_uid } => Some(Details::CompactIndex {
|
KindWithContent::IndexCompaction { index_uid } => Some(Details::IndexCompaction {
|
||||||
index_uid: index_uid.clone(),
|
index_uid: index_uid.clone(),
|
||||||
pre_compaction_size: None,
|
pre_compaction_size: None,
|
||||||
post_compaction_size: None,
|
post_compaction_size: None,
|
||||||
@@ -486,7 +486,7 @@ impl From<&KindWithContent> for Option<Details> {
|
|||||||
versioning::VERSION_PATCH,
|
versioning::VERSION_PATCH,
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
KindWithContent::CompactIndex { index_uid } => Some(Details::CompactIndex {
|
KindWithContent::IndexCompaction { index_uid } => Some(Details::IndexCompaction {
|
||||||
index_uid: index_uid.clone(),
|
index_uid: index_uid.clone(),
|
||||||
pre_compaction_size: None,
|
pre_compaction_size: None,
|
||||||
post_compaction_size: None,
|
post_compaction_size: None,
|
||||||
@@ -601,7 +601,7 @@ pub enum Kind {
|
|||||||
SnapshotCreation,
|
SnapshotCreation,
|
||||||
Export,
|
Export,
|
||||||
UpgradeDatabase,
|
UpgradeDatabase,
|
||||||
CompactIndex,
|
IndexCompaction,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Kind {
|
impl Kind {
|
||||||
@@ -614,7 +614,7 @@ impl Kind {
|
|||||||
| Kind::IndexCreation
|
| Kind::IndexCreation
|
||||||
| Kind::IndexDeletion
|
| Kind::IndexDeletion
|
||||||
| Kind::IndexUpdate
|
| Kind::IndexUpdate
|
||||||
| Kind::CompactIndex => true,
|
| Kind::IndexCompaction => true,
|
||||||
Kind::IndexSwap
|
Kind::IndexSwap
|
||||||
| Kind::TaskCancelation
|
| Kind::TaskCancelation
|
||||||
| Kind::TaskDeletion
|
| Kind::TaskDeletion
|
||||||
@@ -642,7 +642,7 @@ impl Display for Kind {
|
|||||||
Kind::SnapshotCreation => write!(f, "snapshotCreation"),
|
Kind::SnapshotCreation => write!(f, "snapshotCreation"),
|
||||||
Kind::Export => write!(f, "export"),
|
Kind::Export => write!(f, "export"),
|
||||||
Kind::UpgradeDatabase => write!(f, "upgradeDatabase"),
|
Kind::UpgradeDatabase => write!(f, "upgradeDatabase"),
|
||||||
Kind::CompactIndex => write!(f, "compactIndex"),
|
Kind::IndexCompaction => write!(f, "IndexCompaction"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -678,8 +678,8 @@ impl FromStr for Kind {
|
|||||||
Ok(Kind::Export)
|
Ok(Kind::Export)
|
||||||
} else if kind.eq_ignore_ascii_case("upgradeDatabase") {
|
} else if kind.eq_ignore_ascii_case("upgradeDatabase") {
|
||||||
Ok(Kind::UpgradeDatabase)
|
Ok(Kind::UpgradeDatabase)
|
||||||
} else if kind.eq_ignore_ascii_case("compactIndex") {
|
} else if kind.eq_ignore_ascii_case("IndexCompaction") {
|
||||||
Ok(Kind::CompactIndex)
|
Ok(Kind::IndexCompaction)
|
||||||
} else {
|
} else {
|
||||||
Err(ParseTaskKindError(kind.to_owned()))
|
Err(ParseTaskKindError(kind.to_owned()))
|
||||||
}
|
}
|
||||||
@@ -765,7 +765,7 @@ pub enum Details {
|
|||||||
from: (u32, u32, u32),
|
from: (u32, u32, u32),
|
||||||
to: (u32, u32, u32),
|
to: (u32, u32, u32),
|
||||||
},
|
},
|
||||||
CompactIndex {
|
IndexCompaction {
|
||||||
index_uid: String,
|
index_uid: String,
|
||||||
pre_compaction_size: Option<Byte>,
|
pre_compaction_size: Option<Byte>,
|
||||||
post_compaction_size: Option<Byte>,
|
post_compaction_size: Option<Byte>,
|
||||||
@@ -832,7 +832,7 @@ impl Details {
|
|||||||
Self::ClearAll { deleted_documents } => *deleted_documents = Some(0),
|
Self::ClearAll { deleted_documents } => *deleted_documents = Some(0),
|
||||||
Self::TaskCancelation { canceled_tasks, .. } => *canceled_tasks = Some(0),
|
Self::TaskCancelation { canceled_tasks, .. } => *canceled_tasks = Some(0),
|
||||||
Self::TaskDeletion { deleted_tasks, .. } => *deleted_tasks = Some(0),
|
Self::TaskDeletion { deleted_tasks, .. } => *deleted_tasks = Some(0),
|
||||||
Self::CompactIndex { pre_compaction_size, post_compaction_size, .. } => {
|
Self::IndexCompaction { pre_compaction_size, post_compaction_size, .. } => {
|
||||||
*pre_compaction_size = None;
|
*pre_compaction_size = None;
|
||||||
*post_compaction_size = None;
|
*post_compaction_size = None;
|
||||||
}
|
}
|
||||||
|
@@ -68,7 +68,7 @@ pub async fn compact(
|
|||||||
|
|
||||||
analytics.publish(IndexCompacted::default(), &req);
|
analytics.publish(IndexCompacted::default(), &req);
|
||||||
|
|
||||||
let task = KindWithContent::CompactIndex { index_uid: index_uid.to_string() };
|
let task = KindWithContent::IndexCompaction { index_uid: index_uid.to_string() };
|
||||||
let task =
|
let task =
|
||||||
match tokio::task::spawn_blocking(move || index_scheduler.register(task, None, false))
|
match tokio::task::spawn_blocking(move || index_scheduler.register(task, None, false))
|
||||||
.await?
|
.await?
|
||||||
|
@@ -126,7 +126,7 @@ enum Command {
|
|||||||
/// before running the copy and compaction. This way the current indexation must finish before
|
/// before running the copy and compaction. This way the current indexation must finish before
|
||||||
/// the compaction operation can start. Once the compaction is done, the big index is replaced
|
/// the compaction operation can start. Once the compaction is done, the big index is replaced
|
||||||
/// by the compacted one and the mutable transaction is released.
|
/// by the compacted one and the mutable transaction is released.
|
||||||
CompactIndex { index_name: String },
|
IndexCompaction { index_name: String },
|
||||||
|
|
||||||
/// Uses the hair dryer the dedicate pages hot in cache
|
/// Uses the hair dryer the dedicate pages hot in cache
|
||||||
///
|
///
|
||||||
@@ -165,7 +165,7 @@ fn main() -> anyhow::Result<()> {
|
|||||||
let target_version = parse_version(&target_version).context("While parsing `--target-version`. Make sure `--target-version` is in the format MAJOR.MINOR.PATCH")?;
|
let target_version = parse_version(&target_version).context("While parsing `--target-version`. Make sure `--target-version` is in the format MAJOR.MINOR.PATCH")?;
|
||||||
OfflineUpgrade { db_path, current_version: detected_version, target_version }.upgrade()
|
OfflineUpgrade { db_path, current_version: detected_version, target_version }.upgrade()
|
||||||
}
|
}
|
||||||
Command::CompactIndex { index_name } => compact_index(db_path, &index_name),
|
Command::IndexCompaction { index_name } => compact_index(db_path, &index_name),
|
||||||
Command::HairDryer { index_name, index_part } => {
|
Command::HairDryer { index_name, index_part } => {
|
||||||
hair_dryer(db_path, &index_name, &index_part)
|
hair_dryer(db_path, &index_name, &index_part)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user