forked from iabudiab/ObjectiveRocks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRocksDBSnapshot.h
72 lines (55 loc) · 2.91 KB
/
RocksDBSnapshot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// RocksDBSnapshot.h
// ObjectiveRocks
//
// Created by Iska on 06/12/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RocksDB.h"
#import "RocksDBReadOptions.h"
#import "RocksDBSnapshotUnavailable.h"
NS_ASSUME_NONNULL_BEGIN
/**
The `RocksDBSnapshot` provides a consistent read-only view over the state of the key-value store.
*/
@interface RocksDBSnapshot : RocksDB
/** @brief Returns the Snapshot's sequence number. */
- (uint64_t)sequenceNumber;
@end
/**
This category marks all mutating method inherited form the `RocksDB` parent class as unavailable since the
`RocksDBSnapshot` is a read-only unmodifiable view over the DB.
*/
@interface RocksDBSnapshot (Unavailable)
+ (instancetype)databaseAtPath:(NSString *)path
andDBOptions:(void (^)(RocksDBOptions *options))options UNAVAILABLE("Create a snapshot via a DB instance");
+ (instancetype)databaseAtPath:(NSString *)path
columnFamilies:(RocksDBColumnFamilyDescriptor *)descriptor
andDatabaseOptions:(void (^)(RocksDBDatabaseOptions *options))options UNAVAILABLE("Create a snapshot via a DB instance");
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
+ (instancetype)databaseForReadOnlyAtPath:(NSString *)path
andDBOptions:(void (^)(RocksDBOptions *options))options UNAVAILABLE("Create a snapshot via a DB instance");
+ (instancetype)databaseForReadOnlyAtPath:(NSString *)path
columnFamilies:(RocksDBColumnFamilyDescriptor *)descriptor
andDatabaseOptions:(void (^)(RocksDBDatabaseOptions *options))options UNAVAILABLE("Create a snapshot via a DB instance");
- (RocksDBColumnFamilyMetaData *)columnFamilyMetaData UNAVAILABLE("Column Family API not available");
#endif
+ (NSArray<NSString *> *)listColumnFamiliesInDatabaseAtPath:(NSString *)path UNAVAILABLE("Column Family API not available");
- (RocksDBColumnFamily *)createColumnFamilyWithName:(NSString *)name
andOptions:(void (^)(RocksDBColumnFamilyOptions *options))optionsBlock UNAVAILABLE("Column Family API not available");
- (NSArray<RocksDBColumnFamily *> *)columnFamilies UNAVAILABLE("Column Family API not available");
- (void)setDefaultReadOptions:(void (^)(RocksDBReadOptions *readOptions))readOptions
andWriteOptions:(void (^)(RocksDBWriteOptions *writeOptions))writeOptions UNAVAILABLE("Specify options when creating snapshot via DB instance");
- (RocksDBSnapshot *)snapshot UNAVAILABLE("Yo Dawg, Snapshot in Snapshot ... ");
- (RocksDBSnapshot *)snapshotWithReadOptions:(void (^)(RocksDBReadOptions *readOptions))readOptions UNAVAILABLE("Yo Dawg, Snapshot in Snapshot ... ");
#define NA_SELECTOR(sel) sel UNAVAILABLE("Snapshot is read-only");
SNAPSHOT_PUT_MERGE_DELETE_SELECTORS
#undef NA_SELECTOR
#if !(defined(ROCKSDB_LITE) && defined(TARGET_OS_IPHONE))
#define NA_SELECTOR(sel) sel UNAVAILABLE("Snapshot is read-only");
SNAPSHOT_WRITE_BATCH_SELECTORS
#undef NA_SELECTOR
#endif
@end
NS_ASSUME_NONNULL_END