-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmdbm_const.go
349 lines (237 loc) · 9.81 KB
/
mdbm_const.go
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
package mdbm
/*
#include <mdbm-binding.h>
*/
import "C"
const (
// Rdonly is Read-only access
Rdonly = C.MDBM_O_RDONLY
// Wronly is Write-only access (deprecated in V3)
Wronly = C.MDBM_O_WRONLY
// Rdrw is Read and write access
Rdrw = C.MDBM_O_RDWR
// Create is Create file if it does not exist
Create = C.MDBM_O_CREAT
// Trunc is Truncate file
Trunc = C.MDBM_O_TRUNC
// Fsync is Sync file on close
Fsync = C.MDBM_O_FSYNC
// Async is Perform asynchronous writes
Async = C.MDBM_O_ASYNC
// Direct is Perform direction I/O
Direct = C.MDBM_O_DIRECT
// NoDirty is Do not not track clean/dirty status
NoDirty = C.MDBM_NO_DIRTY
// SingleArch is User *promises* not to mix 32/64-bit access
SingleArch = C.MDBM_SINGLE_ARCH
// OpenWindowed is Use windowing to access db
OpenWindowed = C.MDBM_OPEN_WINDOWED
// Protect is Protect database except when locked
Protect = C.MDBM_PROTECT
// DBSizeMB is Dbsize is specific in MB
DBSizeMB = C.MDBM_DBSIZE_MB
// StatOperations is collect stats for fetch, store, delete
StatOperations = C.MDBM_STAT_OPERATIONS
// LargeObjects is Support large objects - obsolete
LargeObjects = C.MDBM_LARGE_OBJECTS
// PartitionedLocks is Partitioned locks
PartitionedLocks = C.MDBM_PARTITIONED_LOCKS
// RwLocks is Read-write locks
RwLocks = C.MDBM_RW_LOCKS
// AnyLocks is Open, even if existing locks don't match flags
AnyLocks = C.MDBM_ANY_LOCKS
// OpenNolock is Don't lock during open
OpenNolock = C.MDBM_OPEN_NOLOCK
// LogEmerg is system is unusable
LogEmerg = C.LOG_EMERG
// LogAlert is action must be taken immediately
LogAlert = C.LOG_ALERT
// LogCrit is critical conditions
LogCrit = C.LOG_CRIT
// LogErr is error conditions
LogErr = C.LOG_ERR
// LogWarning is warning conditions
LogWarning = C.LOG_WARNING
// LogNotice is normal but significant condition
LogNotice = C.LOG_NOTICE
// LogInfo is informational
LogInfo = C.LOG_INFO
// LogDebug is debug-level messages
LogDebug = C.LOG_DEBUG
// LogOff is disable log
LogOff = C.int(-1)
// HashCRC32 is table based 32bit crc
HashCRC32 = C.MDBM_HASH_CRC32
// HashEJB is from hsearch
HashEJB = C.MDBM_HASH_EJB
// HashPHONG is congruential hash
HashPHONG = C.MDBM_HASH_PHONG
// HashOZ is from sdbm
HashOZ = C.MDBM_HASH_OZ
// HashTOREK is from Berkeley db
HashTOREK = C.MDBM_HASH_TOREK
// HashFNV is Fowler/Vo/Noll hash
HashFNV = C.MDBM_HASH_FNV
// HashSTL is STL string hash
HashSTL = C.MDBM_HASH_STL
// HashMD5 is MD5
HashMD5 = C.MDBM_HASH_MD5
// HashSHA1 is SHA_1
HashSHA1 = C.MDBM_HASH_SHA_1
// HashJENKINS is JENKINS
HashJENKINS = C.MDBM_HASH_JENKINS
// HashHSIEH is HSIEH SuperFastHash
HashHSIEH = C.MDBM_HASH_HSIEH
// MaxHash is bump up if adding more
MaxHash = C.MDBM_MAX_HASH
// DefaultHash is MDBM_HASH_FNV is best
DefaultHash = C.MDBM_DEFAULT_HASH
// Align8Bits is 1-Byte data alignment
Align8Bits = C.MDBM_ALIGN_8_BITS
// Align16Bits is 2-Byte data alignment
Align16Bits = C.MDBM_ALIGN_16_BITS
// Align32Bits is 4-Byte data alignment
Align32Bits = C.MDBM_ALIGN_32_BITS
// Align64Bits is 8-Byte data alignment
Align64Bits = C.MDBM_ALIGN_64_BITS
// Magic is V2 file identifier
Magic = C._MDBM_MAGIC
// MagicNew is V2 file identifier with large objects
MagicNew = C._MDBM_MAGIC_NEW
// MagicNew2 is V3 file identifier
MagicNew2 = C._MDBM_MAGIC_NEW2
// ProtNone is Page no access
ProtNone = C.MDBM_PROT_NONE
// ProtRead is Page read access
ProtRead = C.MDBM_PROT_READ
// ProtWrite is Page write access
ProtWrite = C.MDBM_PROT_WRITE
// ProtNoaccess is Page no access
ProtNoaccess = C.MDBM_PROT_NOACCESS
// ProtAccess is Page protection mask
ProtAccess = C.MDBM_PROT_ACCESS
// Insert is Insert if key does not exist; fail if exists
Insert = C.MDBM_INSERT
// Replace is Update if key exists; insert if does not exist
Replace = C.MDBM_REPLACE
// InsertDup is Insert new record (creates duplicate if key exists)
InsertDup = C.MDBM_INSERT_DUP
// Modify is Update if key exists; fail if does not exist
Modify = C.MDBM_MODIFY
// StoreMask is Mask for all store options
StoreMask = C.MDBM_STORE_MASK
// CacheModeNone is No caching behavior
CacheModeNone = C.MDBM_CACHEMODE_NONE
// CacheModeLFU is Entry with smallest number of accesses is evicted
CacheModeLFU = C.MDBM_CACHEMODE_LFU
// CacheModeLRU is Entry with oldest access time is evicted
CacheModeLRU = C.MDBM_CACHEMODE_LRU
// CacheModeGDSF is Greedy dual-size frequency (size and frequency) eviction
CacheModeGDSF = C.MDBM_CACHEMODE_GDSF
// CacheModeMax is Maximum cache mode value
CacheModeMax = C.MDBM_CACHEMODE_MAX
// CacheModeEvictCleanFirst is add to cachemode to evict clean items 1st
CacheModeEvictCleanFirst = C.MDBM_CACHEMODE_EVICT_CLEAN_FIRST
// CacheModeBits is Defines a mask for the cache mode, including control (eviction) bit.
CacheModeBits = C.MDBM_CACHEMODE_BITS
// StatsBasic is enables gathering only the stats counters.
StatsBasic = C.MDBM_STATS_BASIC
// StatsTimed is enables gathering only the stats timestamps.
StatsTimed = C.MDBM_STATS_TIMED
// StatTypeFetch is fetch* operations
StatTypeFetch = C.MDBM_STAT_TYPE_FETCH
// StatTypeStore is store* operations
StatTypeStore = C.MDBM_STAT_TYPE_STORE
// StatTypeDelete is delete* operations
StatTypeDelete = C.MDBM_STAT_TYPE_DELETE
// StatTypeMax is C.MDBM_STAT_TYPE_DELETE
StatTypeMax = C.MDBM_STAT_TYPE_MAX
// ClockTSC is Enables use of TSC
ClockTSC = C.MDBM_CLOCK_TSC
// ClockStandard is Disables use of TSC
ClockStandard = C.MDBM_CLOCK_STANDARD
// StatTagFetch is Successful fetch stats-callback counter
StatTagFetch = C.MDBM_STAT_TAG_FETCH
// StatTagStore is Successful store stats-callback counter
StatTagStore = C.MDBM_STAT_TAG_STORE
// StatTagDelete is Successful delete stats-callback counter
StatTagDelete = C.MDBM_STAT_TAG_DELETE
// StatTagLock is lock stats-callback counter (not implemented)
StatTagLock = C.MDBM_STAT_TAG_LOCK
// StatTagFetchUncached is Cache-miss with cache+backingstore
StatTagFetchUncached = C.MDBM_STAT_TAG_FETCH_UNCACHED
// StatTagGetpage is Generic access counter in windowed mode
StatTagGetpage = C.MDBM_STAT_TAG_GETPAGE
// StatTagGetpageUncached is Windowed-mode "miss" (load new page into window)
StatTagGetpageUncached = C.MDBM_STAT_TAG_GETPAGE_UNCACHED
// StatTagCacheEvict is Cache evict stats-callback counter
StatTagCacheEvict = C.MDBM_STAT_TAG_CACHE_EVICT
// StatTagCacheStore is Successful cache store counter (BS only)
StatTagCacheStore = C.MDBM_STAT_TAG_CACHE_STORE
// StatTagPageStore is Successful page-level store indicator
StatTagPageStore = C.MDBM_STAT_TAG_PAGE_STORE
// StatTagPageDelete is Successful page-level delete indicator
StatTagPageDelete = C.MDBM_STAT_TAG_PAGE_DELETE
// StatTagSync is Counter of mdbm_syncs and fsyncs
StatTagSync = C.MDBM_STAT_TAG_SYNC
// StatTagFetchNotFound is Fetch cannot find a key in MDBM
StatTagFetchNotFound = C.MDBM_STAT_TAG_FETCH_NOT_FOUND
// StatTagFetchError is Error occurred during fetch
StatTagFetchError = C.MDBM_STAT_TAG_FETCH_ERROR
// StatTagStoreError is Error occurred during store (e.g. MODIFY failed)
StatTagStoreError = C.MDBM_STAT_TAG_STORE_ERROR
// StatTagDeleteFailed is Delete failed: cannot find a key in MDBM
StatTagDeleteFailed = C.MDBM_STAT_TAG_DELETE_FAILED
// StatTagFetchLatency is Fetch latency (expensive to collect)
StatTagFetchLatency = C.MDBM_STAT_TAG_FETCH_LATENCY
// StatTagStoreLatency is Store latency (expensive to collect)
StatTagStoreLatency = C.MDBM_STAT_TAG_STORE_LATENCY
// StatTagDeleteLatency is Delete latency (expensive to collect)
StatTagDeleteLatency = C.MDBM_STAT_TAG_DELETE_LATENCY
// StatTagFetchTime is timestamp of last fetch (not yet implemented)
StatTagFetchTime = C.MDBM_STAT_TAG_FETCH_TIME
// StatTagStoreTime is timestamp of last store (not yet implemented)
StatTagStoreTime = C.MDBM_STAT_TAG_STORE_TIME
// StatTagDeleteTime is timestamp of last delete (not yet implemented)
StatTagDeleteTime = C.MDBM_STAT_TAG_DELETE_TIME
// StatTagFetchUncachedLatency is Cache miss latency for cache+Backingstore only (expensive to collect)
StatTagFetchUncachedLatency = C.MDBM_STAT_TAG_FETCH_UNCACHED_LATENCY
// StatTagGetpageLatency is access latency in windowed mode (expensive to collect)
StatTagGetpageLatency = C.MDBM_STAT_TAG_GETPAGE_LATENCY
// StatTagGetpageUncachedLatency is windowed-mode miss latency (expensive to collect)
StatTagGetpageUncachedLatency = C.MDBM_STAT_TAG_GETPAGE_UNCACHED_LATENCY
// StatTagCacheEvictLatency is cache evict latency (expensive to collect)
StatTagCacheEvictLatency = C.MDBM_STAT_TAG_CACHE_EVICT_LATENCY
// StatTagCacheStoreLatency is Cache store latency in Cache+backingstore mode only (expensive to collect)
StatTagCacheStoreLatency = C.MDBM_STAT_TAG_CACHE_STORE_LATENCY
// StatTagPageStoreValue is Indicates a delete occurred on a particular page.
StatTagPageStoreValue = C.MDBM_STAT_TAG_PAGE_STORE_VALUE
// StatTagPageDeleteValue is Indicates a delete occurred on a particular page.
StatTagPageDeleteValue = C.MDBM_STAT_TAG_PAGE_DELETE_VALUE
// StatTagSyncLatency is mdbm_sync/fsync latency (expensive to collect)
StatTagSyncLatency = C.MDBM_STAT_TAG_SYNC_LATENCY
// IterateEntries is Iterate over page entries
IterateEntries = C.MDBM_ITERATE_ENTRIES
// IterateNolock is Iterate without locking
IterateNolock = C.MDBM_ITERATE_NOLOCK
// StatNolock is Do not lock for stat operation
StatNolock = C.MDBM_STAT_NOLOCK
lockTypeNone = C.LT_NONE
lockTypeLock = C.LT_LOCK
lockTypeSmart = C.LT_SMART
lockTypeShared = C.LT_SHARED
lockTypePlock = C.LT_PLOCK
lockTypeTryLock = C.LT_TRY_LOCK
lockTypeTrySmart = C.LT_TRY_SMART
lockTypeTryShared = C.LT_TRY_SHARED
lockTypeTryPlock = C.LT_TRY_PLOCK
lockFlagsSkip = C.LF_SKIP
// LogToSkip is logging to /dev/null
LogToSkip = 0
// LogToStdErr is loging to /dev/stdout
LogToStdErr = 1
// LogToFile is loging to a file
LogToFile = 2
// LogToSysLog is loging to syslog
LogToSysLog = 3
)