forked from iabudiab/ObjectiveRocks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRocksDBCache.h
40 lines (31 loc) · 958 Bytes
/
RocksDBCache.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
//
// RocksDBCache.h
// ObjectiveRocks
//
// Created by Iska on 02/01/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
RocksDB cache.
*/
@interface RocksDBCache : NSObject
/**
Create a new cache with a fixed size capacity. The cache is sharded
to 2^numShardBits shards, by hash of the key. The total capacity
is divided and evenly assigned to each shard. The default
numShardBits is 4.
@see capacity The cache capcity.
*/
+ (instancetype)LRUCacheWithCapacity:(size_t)capacity;
/**
Create a new cache with a fixed size capacity. The cache is sharded
to 2^numShardBits shards, by hash of the key. The total capacity
is divided and evenly assigned to each shard.
@see capacity The cache capcity.
@see numShardBits The number of shard bits.
*/
+ (instancetype)LRUCacheWithCapacity:(size_t)capacity numShardsBits:(int)numShardBits;
@end
NS_ASSUME_NONNULL_END