summaryrefslogtreecommitdiffstats
path: root/src/core/segment_meta.rs
diff options
context:
space:
mode:
authorpetr-tik <petr-tik@users.noreply.github.com>2019-04-16 00:05:53 +0100
committerpetr-tik <petr-tik@users.noreply.github.com>2019-04-24 20:46:28 +0100
commit8e509213634ccbf82c3380e1b660ec1ffb735301 (patch)
treeccabf983d387fd1fd7dc48b5f9932e7a968f0db7 /src/core/segment_meta.rs
parent96a4f503ecd8f138862bf0a22948a600faf2b120 (diff)
Tidied up the Stamper module and upgraded to a 1.34 dependency
Added stamper.revert method to be used for rollback - rolling back to a previous commit in case of deleting all documents or rolling operations back should reset the stamper as well Added type alias for Opstamp - helps code readibility instead of seeing u64 returned by functions. Moved to AtomicU64 on stable rust (since 1.34) - where possible use standard library interfaces.
Diffstat (limited to 'src/core/segment_meta.rs')
-rw-r--r--src/core/segment_meta.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/segment_meta.rs b/src/core/segment_meta.rs
index 9478663..7ad7ecf 100644
--- a/src/core/segment_meta.rs
+++ b/src/core/segment_meta.rs
@@ -1,6 +1,7 @@
use super::SegmentComponent;
use census::{Inventory, TrackedObject};
use core::SegmentId;
+use indexer::Opstamp;
use serde;
use std::collections::HashSet;
use std::fmt;
@@ -13,7 +14,7 @@ lazy_static! {
#[derive(Clone, Debug, Serialize, Deserialize)]
struct DeleteMeta {
num_deleted_docs: u32,
- opstamp: u64,
+ opstamp: Opstamp,
}
/// `SegmentMeta` contains simple meta information about a segment.
@@ -138,7 +139,7 @@ impl SegmentMeta {
/// Returns the opstamp of the last delete operation
/// taken in account in this segment.
- pub fn delete_opstamp(&self) -> Option<u64> {
+ pub fn delete_opstamp(&self) -> Option<Opstamp> {
self.tracked
.deletes
.as_ref()
@@ -152,7 +153,7 @@ impl SegmentMeta {
}
#[doc(hidden)]
- pub fn with_delete_meta(self, num_deleted_docs: u32, opstamp: u64) -> SegmentMeta {
+ pub fn with_delete_meta(self, num_deleted_docs: u32, opstamp: Opstamp) -> SegmentMeta {
let delete_meta = DeleteMeta {
num_deleted_docs,
opstamp,