forked from iabudiab/ObjectiveRocks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRocksDBThreadStatus.h
76 lines (57 loc) · 2.1 KB
/
RocksDBThreadStatus.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
73
74
75
//
// RocksDBThreadStatus.h
// ObjectiveRocks
//
// Created by Iska on 05/01/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/** The type of a thread. */
typedef NS_ENUM(int, RocksDBThreadType)
{
/** @brief RocksDB background thread in high priority thread pool. */
RocksDBThreadHighPiority = 0,
/** @brief RocksDB background thread in low priority thread pool. */
RocksDBThreadLowPiority,
/** @brief User thread (Non-RocksDB background thread). */
RocksDBThreadUser
};
/**
The type used to refer to a thread operation. A thread operation describes high-level action of a thread.
*/
typedef NS_ENUM(int, RocksDBOperationType)
{
/** Unknown operation. */
RocksDBOperationUnknown = 0,
/** A compaction operation. */
RocksDBOperationCompaction,
/** A flush operation. */
RocksDBOperationFlush
};
/** The type used to refer to a thread state. */
typedef NS_ENUM(int, RocksDBStateType)
{
/** Unkown state. */
RocksDBStateUnknown = 0,
};
/**
Describes the current status of a thread.
*/
@interface RocksDBThreadStatus : NSObject
/** @brief An unique ID for the thread. */
@property (nonatomic, assign, readonly) uint64_t threadId;
/** @brief The type of the thread. */
@property (nonatomic, assign, readonly) RocksDBThreadType threadType;
/** @brief The name of the DB instance where the thread is currently involved with.
It would be set to empty string if the thread does not involve in any DB operation. */
@property (nonatomic, copy, readonly) NSString *databaseName;
/** @brief The name of the column family where the thread is currently It would be set
to empty string if the thread does not involve in any column family. */
@property (nonatomic, copy, readonly) NSString *columnFamilyname;
/** @brief The operation (high-level action) that the current thread is involved. */
@property (nonatomic, assign, readonly) RocksDBOperationType operationType;
/** @brief The state (lower-level action) that the current thread is involved. */
@property (nonatomic, assign, readonly) RocksDBStateType stateType;
@end
NS_ASSUME_NONNULL_END