Derecho  0.9
Distributed systems toolkit for RDMA
PersistException.hpp
Go to the documentation of this file.
1 #ifndef PERSISTENT_EXCEPTION_HPP
2 #define PERSISTENT_EXCEPTION_HPP
3 
4 #include <inttypes.h>
5 
6 namespace persistent {
7 // Exceptions definition
8 #define PERSIST_EXP(errcode, usercode) \
9  ((((errcode)&0xffffffffull) << 32) | ((usercode)&0xffffffffull))
10 #define PERSIST_EXP_USERCODE(x) ((uint32_t)((x)&0xffffffffull))
11 #define PERSIST_EXP_UNIMPLEMENTED PERSIST_EXP(0, 0)
12 #define PERSIST_EXP_NEW_FAILED_UNKNOWN PERSIST_EXP(1, 0)
13 #define PERSIST_EXP_STORAGE_TYPE_UNKNOWN(x) PERSIST_EXP(2, (x))
14 #define PERSIST_EXP_OPEN_FILE(x) PERSIST_EXP(3, (x))
15 #define PERSIST_EXP_MMAP_FILE(x) PERSIST_EXP(4, (x))
16 #define PERSIST_EXP_INV_PATH PERSIST_EXP(5, 0)
17 #define PERSIST_EXP_CREATE_PATH(x) PERSIST_EXP(6, (x))
18 #define PERSIST_EXP_INV_FILE PERSIST_EXP(7, 0)
19 #define PERSIST_EXP_CREATE_FILE(x) PERSIST_EXP(8, (x))
20 #define PERSIST_EXP_TRUNCATE_FILE(x) PERSIST_EXP(9, (x))
21 #define PERSIST_EXP_RWLOCK_INIT(x) PERSIST_EXP(10, (x))
22 #define PERSIST_EXP_RWLOCK_RDLOCK(x) PERSIST_EXP(11, (x))
23 #define PERSIST_EXP_RWLOCK_WRLOCK(x) PERSIST_EXP(12, (x))
24 #define PERSIST_EXP_RWLOCK_UNLOCK(x) PERSIST_EXP(13, (x))
25 #define PERSIST_EXP_MSYNC(x) PERSIST_EXP(14, (x))
26 #define PERSIST_EXP_INV_ENTRY_IDX(x) PERSIST_EXP(15, (x))
27 #define PERSIST_EXP_EMPTY_LOG PERSIST_EXP(16, 0)
28 #define PERSIST_EXP_SPIN_INIT(x) PERSIST_EXP(17, (x))
29 #define PERSIST_EXP_SPIN_LOCK(x) PERSIST_EXP(18, (x))
30 #define PERSIST_EXP_SPIN_UNLOCK(x) PERSIST_EXP(19, (x))
31 #define PERSIST_EXP_INV_VERSION PERSIST_EXP(20, 0)
32 #define PERSIST_EXP_ALLOC(x) PERSIST_EXP(21, (x))
33 #define PERSIST_EXP_READ_FUTURE PERSIST_EXP(22, 0)
34 #define PERSIST_EXP_INV_HLC PERSIST_EXP(23, 0)
35 #define PERSIST_EXP_MUTEX_INIT(x) PERSIST_EXP(24, (x))
36 #define PERSIST_EXP_MUTEX_LOCK(x) PERSIST_EXP(25, (x))
37 #define PERSIST_EXP_MUTEX_UNLOCK(x) PERSIST_EXP(26, (x))
38 #define PERSIST_EXP_READ_FILE(x) PERSIST_EXP(27, (x))
39 #define PERSIST_EXP_WRITE_FILE(x) PERSIST_EXP(28, (x))
40 #define PERSIST_EXP_RENAME_FILE(x) PERSIST_EXP(29, (x))
41 #define PERSIST_EXP_NOSPACE(x) PERSIST_EXP(30, (x))
42 #define PERSIST_EXP_NOSPACE_LOG PERSIST_EXP_NOSPACE(1)
43 #define PERSIST_EXP_NOSPACE_DATA PERSIST_EXP_NOSPACE(2)
44 #define PERSIST_EXP_BEYOND_GSF PERSIST_EXP(31, 0)
45 #define PERSIST_EXP_OOM(x) PERSIST_EXP(32, (x))
46 #define PERSIST_EXP_INV_OBJNAME PERSIST_EXP(33, 0)
47 #define PERSIST_EXP_REMOVE_FILE(x) PERSIST_EXP(34, (x))
48 }
49 
50 #endif //PERSISTENT_EXCEPTION_HPP
This file include all common types internal to derecho and not necessarily being known by a client pr...