-
Notifications
You must be signed in to change notification settings - Fork 178
/
Copy patheleveldb.schema
299 lines (265 loc) · 9.57 KB
/
eleveldb.schema
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
%%-*- mode: erlang -*-
%% @doc Where LevelDB will store its data.
{mapping, "leveldb.data_root", "eleveldb.data_root", [
{datatype, directory},
{default, "$(platform_data_dir)/leveldb"},
hidden
]}.
%% @doc This parameter defines the percentage of total server memory
%% to assign to LevelDB. LevelDB will dynamically adjust its internal
%% cache sizes to stay within this size. The memory size can
%% alternately be assigned as a byte count via leveldb.maximum_memory
%% instead.
%% @see leveldb.maximum_memory
{mapping, "leveldb.maximum_memory.percent", "eleveldb.total_leveldb_mem_percent", [
{default, "70"},
{datatype, integer}
]}.
%% @doc This parameter defines the number of bytes of server memory to
%% assign to LevelDB. LevelDB will dynamically adjust its internal
%% cache sizes to stay within this size. The memory size can
%% alternately be assigned as percentage of total server memory via
%% leveldb.maximum_memory.percent.
%% @see leveldb.maximum_memory.percent
{mapping, "leveldb.maximum_memory", "eleveldb.total_leveldb_mem", [
{datatype, bytesize},
hidden
]}.
%% @doc Whether LevelDB will flush after every write. Note: If you are
%% familiar with fsync, this is analagous to calling fsync after every
%% write.
{mapping, "leveldb.sync_on_write", "eleveldb.sync", [
{default, off},
{datatype, flag},
hidden
]}.
%% @doc limited_developer_mem is a Riak specific option that is used
%% when a developer is testing a high number of vnodes and/or several
%% VMs on a machine with limited physical memory. Do NOT use this
%% option if making performance measurements. This option overwrites
%% values given to write_buffer_size_min and write_buffer_size_max.
{mapping, "leveldb.limited_developer_mem", "eleveldb.limited_developer_mem", [
{default, off},
{datatype, flag},
hidden
]}.
%% @doc Each vnode first stores new key/value data in a memory based
%% write buffer. This write buffer is in parallel to the recovery log
%% mentioned in the "sync" parameter. Riak creates each vnode with a
%% randomly sized write buffer for performance reasons. The random
%% size is somewhere between write_buffer_size_min and
%% write_buffer_size_max.
%% @see leveldb.sync
{mapping, "leveldb.write_buffer_size_min", "eleveldb.write_buffer_size_min", [
{default, "30MB"},
{datatype, bytesize},
hidden
]}.
%% @see leveldb.write_buffer_size_min
{mapping, "leveldb.write_buffer_size_max", "eleveldb.write_buffer_size_max", [
{default, "60MB"},
{datatype, bytesize},
hidden
]}.
%% @doc Each database .sst table file can include an optional "bloom
%% filter" that is highly effective in shortcutting data queries that
%% are destined to not find the requested key. The Bloom filter
%% typically increases the size of an .sst table file by about
%% 2%.
{mapping, "leveldb.bloomfilter", "eleveldb.use_bloomfilter", [
{default, on},
{datatype, flag},
hidden
]}.
%% @doc Defines the limit where block cache memory can no longer be
%% released in favor of the page cache. This has no impact with
%% regard to release in favor of file cache. The value is per
%% vnode.
{mapping, "leveldb.block_cache_threshold", "eleveldb.block_cache_threshold", [
{default, "32MB"},
{datatype, bytesize},
hidden
]}.
%% @doc Defines the size threshold for a block / chunk of data within
%% one .sst table file. Each new block gets an index entry in the .sst
%% table file's master index.
{mapping, "leveldb.block.size", "eleveldb.sst_block_size", [
{default, "4KB"},
{datatype, bytesize},
hidden
]}.
%% @doc Defines the key count threshold for a new key entry in the key
%% index for a block. Most deployments should leave this parameter
%% alone.
{mapping, "leveldb.block.restart_interval", "eleveldb.block_restart_interval", [
{default, 16},
{datatype, integer},
hidden
]}.
%% @doc Defines the number of incremental adjustments to attempt
%% between the block.size value and the maximum block.size for an .sst
%% table file. Value of zero disables the underlying dynamic
%% block_size feature.
%% @see leveldb.block.size
{mapping, "leveldb.block.size_steps", "eleveldb.block_size_steps", [
{default, 16},
{datatype, integer},
hidden
]}.
%% @doc Enables or disables the verification of the data fetched from
%% LevelDB against internal checksums.
{mapping, "leveldb.verify_checksums", "eleveldb.verify_checksums", [
{default, on},
{datatype, flag},
hidden
]}.
%% @doc Enables or disables the verification of LevelDB data during
%% compaction.
{mapping, "leveldb.verify_compaction", "eleveldb.verify_compaction", [
{default, on},
{datatype, flag},
hidden
]}.
%% @doc The number of worker threads performing LevelDB operations.
{mapping, "leveldb.threads", "eleveldb.eleveldb_threads", [
{default, 71},
{datatype, integer},
hidden
]}.
%% @doc Option to override LevelDB's use of fadvise(DONTNEED) with
%% fadvise(WILLNEED) instead. WILLNEED can reduce disk activity on
%% systems where physical memory exceeds the database size.
{mapping, "leveldb.fadvise_willneed", "eleveldb.fadvise_willneed", [
{default, false},
{datatype, {enum, [true, false]}},
hidden
]}.
%% @doc Enables or disables the compression of data on disk.
%% Enabling (default) saves disk space. Disabling may reduce read
%% latency but increase overall disk activity. Option can be
%% changed at any time, but will not impact data on disk until
%% next time a file requires compaction.
{mapping, "leveldb.compression", "eleveldb.compression", [
{default, on},
{datatype, flag}
]}.
%% @doc Selection of compression algorithms. snappy is
%% original compression supplied for leveldb. lz4 is new
%% algorithm that compresses to similar volume but averages twice
%% as fast on writes and four times as fast on reads.
{mapping, "leveldb.compression.algorithm", "eleveldb.compression", [
{new_conf_value, lz4},
{datatype, {enum, [snappy, lz4]}}
]}.
{translation,
"eleveldb.compression",
fun(Conf) ->
Setting = cuttlefish:conf_get("leveldb.compression", Conf),
case Setting of
false -> false;
true ->
cuttlefish:conf_get("leveldb.compression.algorithm", Conf, snappy)
end
end}.
%% @doc Controls when a background compaction initiates solely
%% due to the number of delete tombstones within an individual
%% .sst table file. Value of 'off' disables the feature.
{mapping, "leveldb.compaction.trigger.tombstone_count", "eleveldb.delete_threshold", [
{default, 1000},
{datatype, [integer, {atom, off}]},
hidden
]}.
{translation,
"eleveldb.delete_threshold",
fun(Conf) ->
case cuttlefish:conf_get("leveldb.compaction.trigger.tombstone_count", Conf) of
off -> 0;
Int -> Int
end
end}.
%% @doc leveldb can be configured to use different mounts for
%% different levels. This tiered option defaults to off, but you can
%% configure it to trigger at levels 1-6. If you do this, anything
%% stored at the chosen level or greater will be stored on
%% leveldb.tiered.mounts.slow, while everything at the levels below will
%% be stored on leveldb.tiered.mounts.fast
%% Levels 3 or 4 are recommended settings.
%% WARNING: There is no dynamic reallocation of leveldb
%% data across mounts. If you change this setting without manually
%% moving the level files to the correct mounts, leveldb will act in
%% an unexpected state.
%% @see leveldb.tiered.mounts.fast
%% @see leveldb.tiered.mounts.slow
{mapping, "leveldb.tiered", "eleveldb.tiered_slow_level", [
{default, off},
{datatype, [
{atom, off},
{integer, 1},
{integer, 2},
{integer, 3},
{integer, 4},
{integer, 5},
{integer, 6}
]},
hidden
]}.
{translation, "eleveldb.tiered_slow_level",
fun(Conf) ->
case cuttlefish:conf_get("leveldb.tiered", Conf) of
off -> 0;
I -> I
end
end
}.
%% @see leveldb.tiered
{mapping, "leveldb.tiered.path.fast", "eleveldb.tiered_fast_prefix", [
{datatype, directory},
hidden
]}.
%% @see leveldb.tiered
{mapping, "leveldb.tiered.path.slow", "eleveldb.tiered_slow_prefix", [
{datatype, directory},
hidden
]}.
%% @doc This parameter enables/disables logic that saves a list
%% of cached objects (currently only open .sst file names) at
%% database close. The list is used on the next open to pre-populate
%% the cache. This typically eliminates heavy latencies associated
%% with .sst files opening for early user requests.
{mapping, "leveldb.cache_object_warming", "eleveldb.cache_object_warming", [
{default, true},
{datatype, {enum, [true, false]}},
hidden
]}.
%% @doc Enable global expiry. All leveldb databases / vnodes
%% will use same retention_time and/or whole_file_expiry settings.
%% Settings are unique for each leveldb instances in multi_backend.
{mapping, "leveldb.expiration", "eleveldb.expiry_enabled", [
{default, off},
{datatype, flag},
hidden
]}.
%% @doc Minutes until object expires. Gives number of minutes
%% a stored key/value will stay within the database before automatic
%% deletion. Set to unlimited to disable age based expiry.
{mapping, "leveldb.expiration.retention_time", "eleveldb.expiry_minutes", [
{default, unlimited},
{datatype, [{duration, m}, {atom, unlimited}]},
hidden
]}.
{translation, "eleveldb.expiry_minutes",
fun(Conf) ->
case cuttlefish:conf_get("leveldb.expiration.retention_time", Conf) of
unlimited -> 0;
I -> I
end
end
}.
%% @doc Expire entire .sst table file. Authorizes leveldb to
%% eliminate entire files that contain expired data (delete files
%% instead of removing expired key/values during compaction).
{mapping, "leveldb.expiration.mode", "eleveldb.whole_file_expiry", [
{default, whole_file},
{datatype, {flag, whole_file, normal}},
hidden
]}.