29 #include <Common/Version.h>
59 return n > 0 ? n : 80;
64 usage =
"Usage: %s [options]\n\nOptions";
66 if (strstr(usage,
"%s"))
73 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
82 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
84 if (!cmdline_hidden_descp)
85 cmdline_hidden_descp =
new Desc();
91 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
93 if (!cmdline_positional_descp)
100 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
105 cmdline_descp =
new Desc(desc);
109 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
112 file_descp =
new Desc(usage ? usage :
"Config Properties",
119 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
124 file_descp =
new Desc(desc);
136 ?
"hypertable.cfg" :
"conf/hypertable.cfg";
140 config /=
"conf/hypertable.cfg";
141 default_config = config.string();
146 (
"help,h",
"Show this help message and exit")
147 (
"help-config",
"Show help message for config properties")
148 (
"version",
"Show version information and exit")
149 (
"verbose,v",
boo()->zero_tokens()->default_value(
false),
150 "Show more verbose output")
151 (
"debug",
boo()->zero_tokens()->default_value(
false),
152 "Show debug output (shortcut of --logging-level debug)")
153 (
"quiet",
boo()->zero_tokens()->default_value(
false),
"Negate verbose")
154 (
"silent",
boo()->zero_tokens()->default_value(
false),
155 "Show as little output as possible")
156 (
"logging-level,l",
str()->default_value(
"info"),
157 "Logging level: debug, info, notice, warn, error, crit, alert, fatal")
158 (
"config",
str()->default_value(default_config),
"Configuration file.\n")
159 (
"induce-failure",
str(),
"Arguments for inducing failure")
160 (
"timeout,t",
i32(),
"System wide timeout in milliseconds")
162 alias(
"logging-level",
"Hypertable.Logging.Level");
163 alias(
"verbose",
"Hypertable.Verbose");
164 alias(
"silent",
"Hypertable.Silent");
165 alias(
"timeout",
"Hypertable.Request.Timeout");
170 (
"Comm.DispatchDelay",
i32()->default_value(0),
"[TESTING ONLY] "
171 "Delay dispatching of read requests by this number of milliseconds")
172 (
"Comm.UsePoll",
boo()->default_value(
false),
"Use POSIX poll() interface")
173 (
"Hypertable.Cluster.Name",
str(),
174 "Name of cluster used in Monitoring UI and admin notification messages")
175 (
"Hypertable.Verbose",
boo()->default_value(
false),
176 "Enable verbose output (system wide)")
177 (
"Hypertable.Silent",
boo()->default_value(
false),
178 "Disable verbose output (system wide)")
179 (
"Hypertable.Logging.Level",
str()->default_value(
"info"),
180 "Set system wide logging level (default: info)")
181 (
"Hypertable.DataDirectory",
str()->default_value(default_data_dir),
182 "Hypertable data directory root")
183 (
"Hypertable.Client.Workers",
i32()->default_value(20),
184 "Number of client worker threads created")
185 (
"Hypertable.Connection.Retry.Interval",
i32()->default_value(10000),
186 "Average time, in milliseconds, between connection retry atempts")
187 (
"Hypertable.LogFlushMethod.Meta",
str()->default_value(
"SYNC"),
188 "Log flush method for metadata (FLUSH flushes data to replicas, SYNC "
189 "persists data all the way down to physical storage)")
190 (
"Hypertable.LogFlushMethod.User",
str()->default_value(
"FLUSH"),
191 "Log flush method for user data (FLUSH flushes data to replicas, SYNC "
192 "persists data all the way down to physical storage)")
193 (
"Hypertable.Metrics.Ganglia.Disable",
boo()->default_value(
false),
194 "Disable publishing of metrics to Ganglia")
195 (
"Hypertable.Metrics.Ganglia.Port",
i16()->default_value(15860),
196 "UDP Port on which Hypertable gmond python extension module listens for metrics")
197 (
"Hypertable.LoadMetrics.Interval",
i32()->default_value(3600),
"Period of "
198 "time, in seconds, between writing metrics to sys/RS_METRICS")
199 (
"Hypertable.Request.Timeout",
i32()->default_value(600000),
"Length of "
200 "time, in milliseconds, before timing out requests (system wide)")
201 (
"Hypertable.MetaLog.HistorySize",
i32()->default_value(30),
"Number "
202 "of old MetaLog files to retain for historical purposes")
203 (
"Hypertable.MetaLog.MaxFileSize",
i64()->default_value(100*
M),
"Maximum "
204 "size a MetaLog file can grow before it is compacted")
205 (
"Hypertable.MetaLog.SkipErrors",
boo()->default_value(
false),
"Skipping "
206 "errors instead of throwing exceptions on metalog errors")
207 (
"Hypertable.MetaLog.WriteInterval",
i32()->default_value(30),
208 "Minimum write interval for Metalog in milliseconds")
209 (
"Hypertable.Network.Interface",
str(),
210 "Use this interface for network communication")
211 (
"CephBroker.Port",
i16(),
212 "Port number on which to listen (read by CephBroker only)")
213 (
"CephBroker.Workers",
i32()->default_value(20),
214 "Number of Ceph broker worker threads created, maybe")
215 (
"CephBroker.MonAddr",
str(),
216 "Ceph monitor address to connect to")
217 (
"HdfsBroker.SyncBlock",
boo()->default_value(
true),
218 "Pass SYNC_BLOCK flag to Filesystem.create() when creating files")
219 (
"HdfsBroker.Port",
i16(),
220 "Port number on which to listen (read by HdfsBroker only)")
221 (
"HdfsBroker.Hadoop.ConfDir",
str(),
"Hadoop configuration directory "
222 "(e.g. /etc/hadoop/conf or /usr/lib/hadoop/conf)")
223 (
"HdfsBroker.fs.default.name",
str(),
"Hadoop Filesystem "
224 "default name, same as fs.default.name property in Hadoop config "
225 "(e.g. hdfs://localhost:9000)")
226 (
"DfsBroker.Hdfs.NameNode.Host",
str()->default_value(
"default"),
227 "Name of host on which HDFS NameNode is running")
228 (
"DfsBroker.Hdfs.NameNode.Port",
i16()->default_value(0),
229 "Port number on which HDFS NameNode is running")
230 (
"HdfsBroker.Workers",
i32(),
231 "Number of HDFS broker worker threads created")
232 (
"HdfsBroker.Reactors",
i32(),
233 "Number of HDFS broker communication reactor threads created")
234 (
"Kfs.Broker.Workers",
i32()->default_value(20),
"Number of worker "
235 "threads for Kfs broker")
236 (
"Kfs.Broker.Reactors",
i32(),
"Number of Kfs broker reactor threads")
237 (
"Kfs.MetaServer.Name",
str(),
"Hostname of Kosmos meta server")
238 (
"Kfs.MetaServer.Port",
i16(),
"Port number for Kosmos meta server")
239 (
"Qfs.Broker.Workers",
i32()->default_value(20),
"Number of worker "
240 "threads for Qfs broker")
241 (
"Qfs.Broker.Reactors",
i32(),
"Number of Qfs broker reactor threads")
242 (
"Qfs.MetaServer.Name",
str()->default_value(
"localhost"),
"Hostname of "
244 (
"Qfs.MetaServer.Port",
i16()->default_value(20000),
"Port number for QFS "
246 (
"DfsBroker.Local.DirectIO",
boo(),
247 "DEPRECATED: renamed to FsBroker.Local.DirectIO")
248 (
"DfsBroker.Local.Port",
i16(),
249 "DEPRECATED: renamed to FsBroker.Local.Port")
250 (
"DfsBroker.Local.Root",
str(),
"DEPRECATED: renamed to FsBroker.Local.Root")
251 (
"DfsBroker.Local.Workers",
i32(),
252 "DEPRECATED: renamed to FsBroker.Local.Workers")
253 (
"DfsBroker.Local.Reactors",
i32(),
254 "DEPRECATED: renamed to FsBroker.Local.Reactors")
255 (
"DfsBroker.Host",
str(),
"DEPRECATED: renamed to FsBroker.Host")
256 (
"DfsBroker.Port",
i16(),
"DEPRECATED: renamed to FsBroker.Port")
257 (
"DfsBroker.Timeout",
i32(),
"DEPRECATED: renamed to FsBroker.Timeout")
258 (
"FsBroker.DisableFileRemoval",
boo()->default_value(
false),
259 "Rename files with .deleted extension instead of removing (for testing)")
260 (
"FsBroker.Local.DirectIO",
boo()->default_value(
false),
261 "Read and write files using direct i/o")
262 (
"FsBroker.Local.Port",
i16()->default_value(15863),
263 "Port number on which to listen (read by LocalBroker only)")
264 (
"FsBroker.Local.Root",
str(),
"Root of file and directory "
265 "hierarchy for local broker (if relative path, then is relative to "
266 "the Hypertable data directory root)")
267 (
"FsBroker.Local.Workers",
i32()->default_value(20),
268 "Number of local broker worker threads created")
269 (
"FsBroker.Local.Reactors",
i32(),
270 "Number of local broker communication reactor threads created")
271 (
"FsBroker.Host",
str()->default_value(
"localhost"),
272 "Host on which the FS broker is running (read by clients only)")
273 (
"FsBroker.Port",
i16()->default_value(15863),
274 "Port number on which FS broker is listening (read by clients only)")
275 (
"FsBroker.Timeout",
i32(),
"Length of time, "
276 "in milliseconds, to wait before timing out FS Broker requests. This "
277 "takes precedence over Hypertable.Request.Timeout")
278 (
"Hyperspace.Timeout",
i32()->default_value(30000),
"Timeout (millisec) "
279 "for hyperspace requests (preferred to Hypertable.Request.Timeout")
280 (
"Hyperspace.Maintenance.Interval",
i32()->default_value(60000),
"Hyperspace "
281 " maintenance interval (checkpoint BerkeleyDB, log cleanup etc)")
282 (
"Hyperspace.Checkpoint.Size",
i32()->default_value(1*
M),
"Run BerkeleyDB checkpoint"
283 " when logs exceed this size limit")
284 (
"Hyperspace.Client.Datagram.SendPort",
i16()->default_value(0),
285 "Client UDP send port for keepalive packets")
286 (
"Hyperspace.LogGc.Interval",
i32()->default_value(60000),
"Check for unused BerkeleyDB "
287 "log files after this much time")
288 (
"Hyperspace.LogGc.MaxUnusedLogs",
i32()->default_value(200),
"Number of unused BerkeleyDB "
289 "to keep around in case of lagging replicas")
290 (
"Hyperspace.Replica.Host",
strs(),
"Hostname of Hyperspace replica")
291 (
"Hyperspace.Replica.Port",
i16()->default_value(15861),
292 "Port number on which Hyperspace is or should be listening for requests")
293 (
"Hyperspace.Replica.Replication.Port",
i16()->default_value(15862),
294 "Hyperspace replication port ")
295 (
"Hyperspace.Replica.Replication.Timeout",
i32()->default_value(10000),
296 "Hyperspace replication master dies if it doesn't receive replication acknowledgement "
297 "within this period")
298 (
"Hyperspace.Replica.Workers",
i32()->default_value(20),
299 "Number of Hyperspace Replica worker threads created")
300 (
"Hyperspace.Replica.Reactors",
i32(),
301 "Number of Hyperspace Master communication reactor threads created")
302 (
"Hyperspace.Replica.Dir",
str()->default_value(
"hyperspace"),
303 "Root of hyperspace file and directory "
304 "heirarchy in local filesystem (if relative path, then is relative to "
305 "the Hypertable data directory root)")
306 (
"Hyperspace.KeepAlive.Interval",
i32()->default_value(30000),
307 "Hyperspace Keepalive interval (see Chubby paper)")
308 (
"Hyperspace.Lease.Interval",
i32()->default_value(60000),
309 "Hyperspace Lease interval (see Chubby paper)")
310 (
"Hyperspace.GracePeriod",
i32()->default_value(60000),
311 "Hyperspace Grace period (see Chubby paper)")
312 (
"Hyperspace.Session.Reconnect",
boo()->default_value(
false),
313 "Reconnect to Hyperspace on session expiry")
314 (
"Hypertable.Directory",
str()->default_value(
"hypertable"),
315 "Top-level hypertable directory name")
316 (
"Hypertable.Monitoring.Interval",
i32()->default_value(30000),
317 "Monitoring statistics gathering interval (in milliseconds)")
318 (
"Hypertable.Monitoring.Disable",
boo()->default_value(
false),
319 "Disables the generation of monitoring statistics")
320 (
"Hypertable.LoadBalancer.Enable",
boo()->default_value(
true),
321 "Enable automatic load balancing")
322 (
"Hypertable.LoadBalancer.Crontab",
str()->default_value(
"0 0 * * *"),
323 "Crontab entry to control when load balancer is run")
324 (
"Hypertable.LoadBalancer.BalanceDelay.Initial",
i32()->default_value(86400),
325 "Amount of time to wait after start up before running balancer")
326 (
"Hypertable.LoadBalancer.BalanceDelay.NewServer",
i32()->default_value(60),
327 "Amount of time to wait before running balancer when a new RangeServer is detected")
328 (
"Hypertable.LoadBalancer.LoadavgThreshold",
f64()->default_value(0.25),
329 "Servers with loadavg above this much above the mean will be considered by the "
330 "load balancer to be overloaded")
331 (
"Hypertable.HqlInterpreter.Mutator.NoLogSync",
boo()->default_value(
false),
332 "Suspends CommitLog sync operation on updates until command completion")
333 (
"Hypertable.RangeLocator.MetadataReadaheadCount",
i32()->default_value(10),
334 "Number of rows that the RangeLocator fetches from the METADATA")
335 (
"Hypertable.RangeLocator.MaxErrorQueueLength",
i32()->default_value(4),
336 "Maximum numbers of errors to be stored")
337 (
"Hypertable.RangeLocator.MetadataRetryInterval",
i32()->default_value(3000),
338 "Retry interval when connecting to a RangeServer to fetch metadata")
339 (
"Hypertable.RangeLocator.RootMetadataRetryInterval",
i32()->default_value(3000),
340 "Retry interval when connecting to the Root RangeServer")
341 (
"Hypertable.Mutator.FlushDelay",
i32()->default_value(0),
"Number of "
342 "milliseconds to wait prior to flushing scatter buffers (for testing)")
343 (
"Hypertable.Mutator.ScatterBuffer.FlushLimit.PerServer",
344 i32()->default_value(10*
M),
"Amount of updates (bytes) accumulated for a "
345 "single server to trigger a scatter buffer flush")
346 (
"Hypertable.Mutator.ScatterBuffer.FlushLimit.Aggregate",
347 i64()->default_value(50*
M),
"Amount of updates (bytes) accumulated for "
348 "all servers to trigger a scatter buffer flush")
349 (
"Hypertable.Scanner.QueueSize",
350 i32()->default_value(5),
"Size of Scanner ScanBlock queue")
351 (
"Hypertable.LocationCache.MaxEntries",
i64()->default_value(1*
M),
352 "Size of range location cache in number of entries")
353 (
"Hypertable.Master.Host",
str(),
354 "Host on which Hypertable Master is running")
355 (
"Hypertable.Master.Port",
i16()->default_value(15864),
356 "Port number on which Hypertable Master is or should be listening")
357 (
"Hypertable.Master.Workers",
i32()->default_value(100),
358 "Number of Hypertable Master worker threads created")
359 (
"Hypertable.Master.Reactors",
i32(),
360 "Number of Hypertable Master communication reactor threads created")
361 (
"Hypertable.Master.Gc.Interval",
i32()->default_value(300000),
362 "Garbage collection interval in milliseconds by Master")
363 (
"Hypertable.Master.Locations.IncludeMasterHash",
boo()->default_value(
false),
364 "Includes master hash (host:port) in RangeServer location id")
365 (
"Hypertable.Master.Split.SoftLimitEnabled",
boo()->default_value(
true),
366 "Enable aggressive splitting of tables with little data to spread out ranges")
367 (
"Hypertable.Master.DiskThreshold.Percentage",
i32()->default_value(90),
368 "Stop assigning ranges to RangeServers if disk usage is above this threshold")
369 (
"Hypertable.Master.FailedRangeServerLimit.Percentage",
i32()->default_value(80),
370 "Fail hard if less than this percentage of the RangeServers are unavailable "
372 (
"Hypertable.Master.NotificationInterval",
i32()->default_value(3600),
373 "Notification interval (in seconds) of abnormal state")
374 (
"Hypertable.Master.RecordGraphvizStream",
boo()->default_value(
false),
375 "Appends Graphviz output to run/op-graphviz-stream on each DAG change")
376 (
"Hypertable.Failover.GracePeriod",
i32()->default_value(30000),
377 "Master wait this long before trying to recover a RangeServer")
378 (
"Hypertable.Failover.Timeout",
i32()->default_value(300000),
379 "Timeout for failover operations")
380 (
"Hypertable.Failover.Quorum.Percentage",
i32()->default_value(90),
381 "Percentage of live RangeServers required for failover to proceed")
382 (
"Hypertable.Failover.RecoverInSeries",
boo()->default_value(
false),
383 "Carry out USER log recovery for failed servers in series")
384 (
"Hypertable.RangeServer.AccessGroup.GarbageThreshold.Percentage",
385 i32()->default_value(20),
"Perform major compaction when garbage accounts "
386 "for this percentage of the data")
387 (
"Hypertable.RangeServer.ControlFile.CheckInterval",
i32()->default_value(30000),
388 "Minimum time interval (milliseconds) to check for control files in run/ directory")
389 (
"Hypertable.RangeServer.LoadSystemTablesOnly",
boo()->default_value(
false),
390 "Instructs the RangeServer to only load system tables (for debugging)")
391 (
"Hypertable.RangeServer.LowActivityPeriod",
392 strs()->default_value(std::vector<std::string>(),
""),
393 "Periods of low activity during which RangeServer can perform heavy "
394 "maintenance (specified in crontab format)")
395 (
"Hypertable.RangeServer.MemoryLimit",
i64(),
"RangeServer memory limit")
396 (
"Hypertable.RangeServer.MemoryLimit.Percentage",
i32()->default_value(60),
397 "RangeServer memory limit specified as percentage of physical RAM")
398 (
"Hypertable.RangeServer.LowMemoryLimit.Percentage",
i32()->default_value(10),
399 "Amount of memory to free in low memory condition as percentage of RangeServer memory limit")
400 (
"Hypertable.RangeServer.MemoryLimit.EnsureUnused",
i64(),
"Amount of unused physical memory")
401 (
"Hypertable.RangeServer.MemoryLimit.EnsureUnused.Percentage",
i32(),
402 "Amount of unused physical memory specified as percentage of physical RAM")
403 (
"Hypertable.RangeServer.Port",
i16()->default_value(15865),
404 "Port number on which range servers are or should be listening")
405 (
"Hypertable.RangeServer.AccessGroup.CellCache.PageSize",
406 i32()->default_value(512*
KiB),
"Page size for CellCache pool allocator")
407 (
"Hypertable.RangeServer.AccessGroup.CellCache.ScannerCacheSize",
408 i32()->default_value(1024),
"CellCache scanner cache size")
409 (
"Hypertable.RangeServer.AccessGroup.ShadowCache",
410 boo()->default_value(
false),
"Enable CellStore shadow caching")
411 (
"Hypertable.RangeServer.AccessGroup.MaxMemory",
i64()->default_value(1*
G),
412 "Maximum bytes consumed by an Access Group")
413 (
"Hypertable.RangeServer.CellStore.TargetSize.Minimum",
414 i64()->default_value(10*
MiB),
415 "Merging compaction target CellStore size during normal activity period")
416 (
"Hypertable.RangeServer.CellStore.TargetSize.Maximum",
417 i64()->default_value(50*
MiB),
418 "Merging compaction target CellStore size during low activity period")
419 (
"Hypertable.RangeServer.CellStore.TargetSize.Window",
420 i64()->default_value(30*
MiB),
"Size window above target minimum for "
421 "CellStores in which merges will be considered")
422 (
"Hypertable.RangeServer.CellStore.Merge.RunLengthThreshold",
i32()->default_value(5),
423 "Trigger a merge if an adjacent run of merge candidate CellStores exceeds this length")
424 (
"Hypertable.RangeServer.CellStore.DefaultBlockSize",
425 i32()->default_value(64*
KiB),
"Default block size for cell stores")
426 (
"Hypertable.RangeServer.Data.DefaultReplication",
427 i32()->default_value(-1),
"Default replication for data")
428 (
"Hypertable.RangeServer.CellStore.DefaultCompressor",
429 str()->default_value(
"snappy"),
"Default compressor for cell stores")
430 (
"Hypertable.RangeServer.CellStore.DefaultBloomFilter",
431 str()->default_value(
"rows"),
"Default bloom filter for cell stores")
432 (
"Hypertable.RangeServer.CellStore.SkipBad",
433 boo()->default_value(
false),
"Skip over cell stores that are corrupt")
434 (
"Hypertable.RangeServer.CellStore.SkipNotFound",
435 boo()->default_value(
false),
"Skip over cell stores that are non-existent")
436 (
"Hypertable.RangeServer.IgnoreClockSkewErrors",
437 boo()->default_value(
false),
"Ignore clock skew errors")
438 (
"Hypertable.RangeServer.CommitInterval",
i32()->default_value(50),
439 "Default minimum group commit interval in milliseconds")
440 (
"Hypertable.RangeServer.BlockCache.Compressed",
boo()->default_value(
true),
441 "Controls whether or not block cache stores compressed blocks")
442 (
"Hypertable.RangeServer.BlockCache.MinMemory",
i64()->default_value(0),
443 "Minimum size of block cache")
444 (
"Hypertable.RangeServer.BlockCache.MaxMemory",
i64()->default_value(-1),
445 "Maximum (target) size of block cache")
446 (
"Hypertable.RangeServer.QueryCache.EnableMutexStatistics",
447 boo()->default_value(
true),
"Enable query cache mutex statistics")
448 (
"Hypertable.RangeServer.QueryCache.MaxMemory",
i64()->default_value(50*
M),
449 "Maximum size of query cache")
450 (
"Hypertable.RangeServer.Range.RowSize.Unlimited",
boo()->default_value(
false),
451 "Marks range active and unsplittable upon encountering row overflow condition. "
452 "Can cause ranges to grow extremely large. Use with caution!")
453 (
"Hypertable.RangeServer.Range.IgnoreCellsWithClockSkew",
boo()->default_value(
false),
454 "Forces Ranges to ingore inserted cells whose revision number is older than latest"
455 "revision found in CellStores.")
456 (
"Hypertable.RangeServer.Range.SplitSize",
i64()->default_value(512*
MiB),
457 "Size of range in bytes before splitting")
458 (
"Hypertable.RangeServer.Range.MaximumSize",
i64()->default_value(3*
G),
459 "Maximum size of a range in bytes before updates get throttled")
460 (
"Hypertable.RangeServer.Range.MetadataSplitSize",
i64(),
"Size of METADATA "
461 "range in bytes before splitting (for testing)")
462 (
"Hypertable.RangeServer.Range.SplitOff",
str()->default_value(
"high"),
463 "Portion of range to split off (high or low)")
464 (
"Hypertable.RangeServer.ClockSkew.Max",
i32()->default_value(3*
M),
465 "Maximum amount of clock skew (microseconds) the system will tolerate")
466 (
"Hypertable.RangeServer.CommitLog.DfsBroker.Host",
str(),
467 "Host of DFS Broker to use for Commit Log")
468 (
"Hypertable.RangeServer.CommitLog.DfsBroker.Port",
i16(),
469 "Port of DFS Broker to use for Commit Log")
470 (
"Hypertable.RangeServer.CommitLog.FragmentRemoval.RangeReferenceRequired",
boo()->default_value(
true),
471 "Only remove linked log fragments if they're part of a transfer log referenced by a range")
472 (
"Hypertable.RangeServer.CommitLog.PruneThreshold.Min",
i64()->default_value(1*
G),
473 "Lower threshold for amount of outstanding commit log before pruning")
474 (
"Hypertable.RangeServer.CommitLog.PruneThreshold.Max",
i64(),
475 "Upper threshold for amount of outstanding commit log before pruning")
476 (
"Hypertable.RangeServer.CommitLog.PruneThreshold.Max.MemoryPercentage",
477 i32()->default_value(50),
"Upper threshold in terms of % RAM for "
478 "amount of outstanding commit log before pruning")
479 (
"Hypertable.RangeServer.CommitLog.RollLimit",
i64()->default_value(100*
M),
480 "Roll commit log after this many bytes")
481 (
"Hypertable.RangeServer.CommitLog.Compressor",
482 str()->default_value(
"quicklz"),
483 "Commit log compressor to use (zlib, lzo, quicklz, snappy, bmz, none)")
484 (
"Hypertable.RangeServer.Testing.MaintenanceNeeded.PauseInterval",
i32()->default_value(0),
485 "TESTING: After update, if range needs maintenance, pause for this number of milliseconds")
486 (
"Hypertable.RangeServer.UpdateCoalesceLimit",
i64()->default_value(5*
M),
487 "Amount of update data to coalesce into single commit log sync")
488 (
"Hypertable.RangeServer.Failover.FlushLimit.PerRange",
489 i32()->default_value(10*
M),
"Amount of updates (bytes) accumulated for a "
490 "single range to trigger a replay buffer flush")
491 (
"Hypertable.RangeServer.Failover.FlushLimit.Aggregate",
492 i64()->default_value(100*
M),
"Amount of updates (bytes) accumulated for "
493 "all range to trigger a replay buffer flush")
494 (
"Hypertable.RangeServer.ReadyStatus",
str()->default_value(
"WARNING"),
495 "Status code indicating RangeServer is ready for operation")
496 (
"Hypertable.Metadata.Replication",
i32()->default_value(-1),
497 "Replication factor for commit log files")
498 (
"Hypertable.CommitLog.RollLimit",
i64()->default_value(100*
M),
499 "Roll commit log after this many bytes")
500 (
"Hypertable.CommitLog.Compressor",
str()->default_value(
"quicklz"),
501 "Commit log compressor to use (zlib, lzo, quicklz, snappy, bmz, none)")
502 (
"Hypertable.CommitLog.SkipErrors",
boo()->default_value(
false),
503 "Skip over any corruption encountered in the commit log")
504 (
"Hypertable.RangeServer.Scanner.Ttl",
i32()->default_value(1800*
K),
505 "Number of milliseconds of inactivity before destroying scanners")
506 (
"Hypertable.RangeServer.Scanner.BufferSize",
i64()->default_value(1*
M),
507 "Size of transfer buffer for scan results")
508 (
"Hypertable.RangeServer.Timer.Interval",
i32()->default_value(20000),
509 "Timer interval in milliseconds (reaping scanners, purging commit logs, etc.)")
510 (
"Hypertable.RangeServer.Maintenance.Interval",
i32()->default_value(30000),
511 "Maintenance scheduling interval in milliseconds")
512 (
"Hypertable.RangeServer.Maintenance.LowMemoryPrioritization",
boo()->default_value(
true),
513 "Use low memory prioritization algorithm for freeing memory in low memory mode")
514 (
"Hypertable.RangeServer.Maintenance.MaxAppQueuePause",
i32()->default_value(120000),
515 "Each time application queue is paused, keep it paused for no more than this many milliseconds")
516 (
"Hypertable.RangeServer.Maintenance.MergesPerInterval",
i32(),
517 "Limit on number of merging tasks to create per maintenance interval")
518 (
"Hypertable.RangeServer.Maintenance.MergingCompaction.Delay",
i32()->default_value(900000),
519 "Millisecond delay before scheduling merging compactions in non-low memory mode")
520 (
"Hypertable.RangeServer.Maintenance.MoveCompactionsPerInterval",
i32()->default_value(2),
521 "Limit on number of major compactions due to move per maintenance interval")
522 (
"Hypertable.RangeServer.Maintenance.InitializationPerInterval",
i32(),
523 "Limit on number of initialization tasks to create per maintenance interval")
524 (
"Hypertable.RangeServer.Monitoring.DataDirectories",
str()->default_value(
"/"),
525 "Comma-separated list of directory mount points of disk volumes to monitor")
526 (
"Hypertable.RangeServer.Workers",
i32()->default_value(50),
527 "Number of Range Server worker threads created")
528 (
"Hypertable.RangeServer.Reactors",
i32(),
529 "Number of Range Server communication reactor threads created")
530 (
"Hypertable.RangeServer.MaintenanceThreads",
i32(),
531 "Number of maintenance threads. Default is min(2, number-of-cores).")
532 (
"Hypertable.RangeServer.UpdateDelay",
i32()->default_value(0),
533 "Number of milliseconds to wait before carrying out an update (TESTING)")
534 (
"Hypertable.RangeServer.ProxyName",
str()->default_value(
""),
535 "Use this value for the proxy name (if set) instead of reading from run dir.")
536 (
"ThriftBroker.Timeout",
i32(),
"Timeout (ms) for thrift broker")
537 (
"ThriftBroker.Host",
str()->default_value(
"localhost"),
538 "Host on which the ThriftBroker is running (read by clients only)")
539 (
"ThriftBroker.Port",
i16()->default_value(15867),
"Port number for "
541 (
"ThriftBroker.Future.Capacity",
i32()->default_value(50*
M),
"Capacity "
542 "of result queue (in bytes) for Future objects")
543 (
"ThriftBroker.NextThreshold",
i32()->default_value(512*
K),
"Total size "
544 "threshold for (size of cell data) for thrift broker next calls")
545 (
"ThriftBroker.API.Logging",
boo()->default_value(
false),
"Enable or "
546 "disable Thrift API logging")
547 (
"ThriftBroker.Mutator.FlushInterval",
i32()->default_value(1000),
548 "Maximum flush interval in milliseconds")
549 (
"ThriftBroker.Workers",
i32()->default_value(50),
"Number of "
550 "worker threads for thrift broker")
551 (
"ThriftBroker.Hyperspace.Session.Reconnect",
boo()->default_value(
true),
552 "ThriftBroker will reconnect to Hyperspace on session expiry")
553 (
"ThriftBroker.SlowQueryLog.Enable",
boo()->default_value(
true),
554 "Enable slow query logging")
555 (
"ThriftBroker.SlowQueryLog.LatencyThreshold",
i32()->default_value(10000),
556 "Latency threshold above which a query is considered slow")
558 alias(
"Hypertable.RangeServer.CommitLog.RollLimit",
559 "Hypertable.CommitLog.RollLimit");
560 alias(
"Hypertable.RangeServer.CommitLog.Compressor",
561 "Hypertable.CommitLog.Compressor");
568 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
570 HT_TRY(
"parsing init arguments",
571 properties->parse_args(argc, argv,
cmdline_desc(), cmdline_hidden_descp,
572 cmdline_positional_descp, allow_unregistered));
576 std::quick_exit(EXIT_SUCCESS);
579 if (
has(
"help-config")) {
581 std::quick_exit(EXIT_SUCCESS);
584 if (
has(
"version")) {
586 std::quick_exit(EXIT_SUCCESS);
589 filename = get_str(
"config");
604 properties->load(fname, desc, allow_unregistered);
608 properties->alias(cmdline_opt, file_opt, overwrite);
612 properties->sync_aliases();
616 String loglevel = get_str(
"logging-level");
617 bool verbose = get_bool(
"verbose");
619 if (verbose && get_bool(
"quiet")) {
621 properties->set(
"verbose",
false);
623 if (get_bool(
"debug")) {
625 properties->set(
"logging-level", loglevel);
628 if (loglevel ==
"info")
630 else if (loglevel ==
"debug")
632 else if (loglevel ==
"notice")
634 else if (loglevel ==
"warn")
636 else if (loglevel ==
"error")
638 else if (loglevel ==
"crit")
640 else if (loglevel ==
"alert")
642 else if (loglevel ==
"fatal")
646 std::quick_exit(EXIT_SUCCESS);
655 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
657 allow_unregistered = choice;
662 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
667 std::lock_guard<std::recursive_mutex> lock(rec_mutex);
673 if (cmdline_hidden_descp) {
675 cmdline_hidden_descp = 0;
677 if (cmdline_positional_descp) {
679 cmdline_positional_descp = 0;
static int terminal_line_length()
static Desc * cmdline_hidden_descp
static bool allow_unregistered
PropertiesPtr properties
This singleton map stores all options.
std::string String
A String is simply a typedef to std::string.
Compatibility class for boost::filesystem::path.
Po::positional_options_description PositionalDesc
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
Po::typed_value< uint16_t > * i16(uint16_t *v=0)
Po::typed_value< String > * str(String *v=0)
static const ProcInfo & proc_info()
Retrieves updated Process information (see SystemInfo.h)
static bool exists(const String &fname)
Checks if a file or directory exists.
static void init_options()
void parse_file(const String &fname, const Desc &desc)
Parses a configuration file and stores all configuration options into the option descriptor.
Desc & cmdline_desc(const char *usage)
A macro which definds global functions like get_bool(), get_str(), get_i16() etc. ...
bool has(const String &name)
Check existence of a configuration value.
#define HT_EXPECT(_e_, _code_)
Compatibility class for boost::filesystem::path.
File system utility functions.
Po::typed_value< int64_t > * i64(int64_t *v=0)
Po::typed_value< int32_t > * i32(int32_t *v=0)
static String exe_name
The exe file name.
static String usage_str(const char *usage)
std::shared_ptr< Properties > PropertiesPtr
Logging routines and macros.
Desc & file_desc(const char *usage)
Get the config file options description.
Compatibility Macros for C/C++.
void cleanup()
Free all resources used.
Po::typed_value< bool > * boo(bool *v=0)
bool defaulted(const String &name)
Check if a configuration value is defaulted.
void parse_args(int argc, char *argv[])
Initialization helper; parses the argc/argv parameters into properties, reads the configuration file...
static Desc * cmdline_descp
bool allow_unregistered_options(bool choice)
Toggle allow unregistered options.
Po::typed_value< Strings > * strs(Strings *v=0)
static PositionalDesc * cmdline_positional_descp
void sync_aliases()
Sync alias values.
LogWriter * get()
Accessor for the LogWriter singleton instance.
std::recursive_mutex rec_mutex
A global (recursive) configuration mutex.
static String install_dir
The installation directory.
A String class based on std::string.
void set_level(int level)
Sets the message level; all messages with a higher level are discarded.
static const TermInfo & term_info()
Retrieves updated Terminal information (see SystemInfo.h)
#define HT_TRY(_s_, _code_)
Po::typed_value< double > * f64(double *v=0)
void alias(const String &cmdline_opt, const String &file_opt, bool overwrite)
Setup command line option alias for config file option.
Desc & cmdline_hidden_desc()
Get the command line hidden options description (for positional options)
System information and statistics based on libsigar.
PositionalDesc & cmdline_positional_desc()
Get the command line positional options description.
#define HT_THROW(_code_, _msg_)
const char * version_string()