Skip to content

Commit 7722f77

Browse files
committed
MB-54666: Move StorageProperties from kvstore.h to ep_types.h
Change-Id: Icb8464b22ecac9188eec5e58d061967fb33eedde Reviewed-on: https://review.couchbase.org/c/kv_engine/+/184634 Well-Formed: Restriction Checker Tested-by: Build Bot <[email protected]> Reviewed-by: Trond Norbye <[email protected]>
1 parent 9fd7bdc commit 7722f77

File tree

2 files changed

+71
-77
lines changed

2 files changed

+71
-77
lines changed

engines/ep/src/ep_types.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,77 @@ enum class VBucketStatsDetailLevel {
291291
Full, // All the vbucket stats
292292
};
293293

294+
/**
295+
* Properties of the storage layer.
296+
*/
297+
class StorageProperties {
298+
public:
299+
enum class ByIdScan : bool { Yes, No };
300+
301+
/**
302+
* Will the KVStore de-dupe items such that only the highest seqno for any
303+
* given key in a single flush batch is persisted?
304+
*/
305+
enum class AutomaticDeduplication : bool { Yes, No };
306+
307+
/**
308+
* Will the KVStore count items in the prepare namespace (and update the
309+
* values appropriately in the vbstate)
310+
*/
311+
enum class PrepareCounting : bool { Yes, No };
312+
313+
/**
314+
* Will the KVStore make callbacks with stale (superseded) items during
315+
* compaction?
316+
*/
317+
enum class CompactionStaleItemCallbacks : bool { Yes, No };
318+
319+
/**
320+
* Does the KVStore support history retention (suitable for change streams)
321+
*/
322+
enum class HistoryRetentionAvailable : bool { Yes, No };
323+
324+
StorageProperties(ByIdScan byIdScan,
325+
AutomaticDeduplication automaticDeduplication,
326+
PrepareCounting prepareCounting,
327+
CompactionStaleItemCallbacks compactionStaleItemCallbacks,
328+
HistoryRetentionAvailable historyRetentionAvailable)
329+
: byIdScan(byIdScan),
330+
automaticDeduplication(automaticDeduplication),
331+
prepareCounting(prepareCounting),
332+
compactionStaleItemCallbacks(compactionStaleItemCallbacks),
333+
historyRetentionAvailable(historyRetentionAvailable) {
334+
}
335+
336+
bool hasByIdScan() const {
337+
return byIdScan == ByIdScan::Yes;
338+
}
339+
340+
bool hasAutomaticDeduplication() const {
341+
return automaticDeduplication == AutomaticDeduplication::Yes;
342+
}
343+
344+
bool hasPrepareCounting() const {
345+
return prepareCounting == PrepareCounting::Yes;
346+
}
347+
348+
bool hasCompactionStaleItemCallbacks() const {
349+
return compactionStaleItemCallbacks ==
350+
CompactionStaleItemCallbacks::Yes;
351+
}
352+
353+
bool canRetainHistory() const {
354+
return historyRetentionAvailable == HistoryRetentionAvailable::Yes;
355+
}
356+
357+
private:
358+
ByIdScan byIdScan;
359+
AutomaticDeduplication automaticDeduplication;
360+
PrepareCounting prepareCounting;
361+
CompactionStaleItemCallbacks compactionStaleItemCallbacks;
362+
HistoryRetentionAvailable historyRetentionAvailable;
363+
};
364+
294365
namespace cb {
295366

296367
/**

engines/ep/src/kvstore/kvstore.h

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -654,83 +654,6 @@ class KVStoreStats {
654654
}
655655
};
656656

657-
/**
658-
* Properties of the storage layer.
659-
*
660-
* If concurrent filesystem access is possible, maxConcurrency() will
661-
* be greater than one. One will need to determine whether more than
662-
* one writer is possible as well as whether more than one reader is
663-
* possible.
664-
*/
665-
class StorageProperties {
666-
public:
667-
enum class ByIdScan : bool { Yes, No };
668-
669-
/**
670-
* Will the KVStore de-dupe items such that only the highest seqno for any
671-
* given key in a single flush batch is persisted?
672-
*/
673-
enum class AutomaticDeduplication : bool { Yes, No };
674-
675-
/**
676-
* Will the KVStore count items in the prepare namespace (and update the
677-
* values appropriately in the vbstate)
678-
*/
679-
enum class PrepareCounting : bool { Yes, No };
680-
681-
/**
682-
* Will the KVStore make callbacks with stale (superseded) items during
683-
* compaction?
684-
*/
685-
enum class CompactionStaleItemCallbacks : bool { Yes, No };
686-
687-
/**
688-
* Does the KVStore support history retention (suitable for change streams)
689-
*/
690-
enum class HistoryRetentionAvailable : bool { Yes, No };
691-
692-
StorageProperties(ByIdScan byIdScan,
693-
AutomaticDeduplication automaticDeduplication,
694-
PrepareCounting prepareCounting,
695-
CompactionStaleItemCallbacks compactionStaleItemCallbacks,
696-
HistoryRetentionAvailable historyRetentionAvailable)
697-
: byIdScan(byIdScan),
698-
automaticDeduplication(automaticDeduplication),
699-
prepareCounting(prepareCounting),
700-
compactionStaleItemCallbacks(compactionStaleItemCallbacks),
701-
historyRetentionAvailable(historyRetentionAvailable) {
702-
}
703-
704-
bool hasByIdScan() const {
705-
return byIdScan == ByIdScan::Yes;
706-
}
707-
708-
bool hasAutomaticDeduplication() const {
709-
return automaticDeduplication == AutomaticDeduplication::Yes;
710-
}
711-
712-
bool hasPrepareCounting() const {
713-
return prepareCounting == PrepareCounting::Yes;
714-
}
715-
716-
bool hasCompactionStaleItemCallbacks() const {
717-
return compactionStaleItemCallbacks ==
718-
CompactionStaleItemCallbacks::Yes;
719-
}
720-
721-
bool canRetainHistory() const {
722-
return historyRetentionAvailable == HistoryRetentionAvailable::Yes;
723-
}
724-
725-
private:
726-
ByIdScan byIdScan;
727-
AutomaticDeduplication automaticDeduplication;
728-
PrepareCounting prepareCounting;
729-
CompactionStaleItemCallbacks compactionStaleItemCallbacks;
730-
HistoryRetentionAvailable historyRetentionAvailable;
731-
};
732-
733-
734657
/**
735658
* Base class for some KVStores that implements common functionality.
736659
*/

0 commit comments

Comments
 (0)