Skip to content

Commit

Permalink
refactor: index
Browse files Browse the repository at this point in the history
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
  • Loading branch information
bsbds committed Jun 21, 2024
1 parent bbf0739 commit 06ccbf3
Show file tree
Hide file tree
Showing 6 changed files with 482 additions and 222 deletions.
5 changes: 1 addition & 4 deletions crates/xline/src/server/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ impl CurpCommandExecutor<Command> for CommandExecutor {
}
};
ops.append(&mut wr_ops);
let key_revisions = self.db.flush_ops(ops)?;
if !key_revisions.is_empty() {
self.kv_storage.insert_index(key_revisions);
}
let _key_revisions = self.db.flush_ops(ops)?;
self.lease_storage.mark_lease_synced(wrapper);
if !quota_enough {
if let Some(alarmer) = self.alarmer.read().clone() {
Expand Down
3 changes: 1 addition & 2 deletions crates/xline/src/server/watch_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,7 @@ mod test {
..Default::default()
});
let (_sync_res, ops) = store.after_sync(&req, revision).await.unwrap();
let key_revisions = db.flush_ops(ops).unwrap();
store.insert_index(key_revisions);
let _key_revisions = db.flush_ops(ops).unwrap();
}

#[tokio::test]
Expand Down
5 changes: 1 addition & 4 deletions crates/xline/src/storage/compact/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use utils::{
};
use xlineapi::{command::Command, execute_error::ExecuteError, RequestWrapper};

use super::{
index::{Index, IndexOperate},
KvStore,
};
use super::{index::Index, KvStore};
use crate::{revision_number::RevisionNumberGenerator, rpc::CompactionRequest};

/// mod revision compactor;
Expand Down
Loading

0 comments on commit 06ccbf3

Please sign in to comment.