|
| 1 | +require 'rubygems' |
| 2 | +require 'loquacious' |
| 3 | + |
| 4 | +# |
| 5 | +# The configuration for the highlights tokyo tyrant instance |
| 6 | +# |
| 7 | +# The options available in the instance_defaults section of the manager |
| 8 | +# configuration are also able to be set here. |
| 9 | +# |
| 10 | +Loquacious::Configuration.for( "highlights" ) do |
| 11 | + |
| 12 | + desc "The hostname this instance will listen on. The default is all" |
| 13 | + host "0.0.0.0" |
| 14 | + |
| 15 | + desc "The port this tyrant will listen on. The default is 1978" |
| 16 | + port 19870 |
| 17 | + |
| 18 | + desc <<-txt |
| 19 | + The type of database this instance will be. Options are: |
| 20 | + | memory-hash - an in memory hash database |
| 21 | + | memory-tree - an in memory B+ tree database |
| 22 | + | hash - an on disk hash database |
| 23 | + | tree - an on disk B+ tree database |
| 24 | + | fixed - an on disk fixed length database |
| 25 | + | table - an on disk table database |
| 26 | + txt |
| 27 | + type "table" |
| 28 | + |
| 29 | + desc <<-txt |
| 30 | + Mode of the server in relation to the database. It can be a combination of |
| 31 | + the following: |
| 32 | + | w - it is a database writer |
| 33 | + | r - it is a database reader |
| 34 | + | c - it creates the database if it does not exist |
| 35 | + | t - it truncates the database if it does exist |
| 36 | + | e - do not lock the database when doing operations |
| 37 | + | f - use a non-blocking lock when doing operations |
| 38 | + txt |
| 39 | + mode "wc" |
| 40 | + |
| 41 | + |
| 42 | + desc <<-txt |
| 43 | + The options for data stored in the database. They include one of the |
| 44 | + compression options: |
| 45 | + | d - Deflate |
| 46 | + | b - BZIP2 |
| 47 | + | t - TCBS |
| 48 | + and |
| 49 | + | l - allow the database to be larger than 2GB |
| 50 | + txt |
| 51 | + opts "ld" |
| 52 | + |
| 53 | + desc <<-txt |
| 54 | + Tuning parameters. Each of these alters a tuning parameter on the database. |
| 55 | + Not all of them are applicable to all database types |
| 56 | + txt |
| 57 | + |
| 58 | + tuning_params { |
| 59 | + desc <<-txt |
| 60 | + The number of elements in the bucket array. Supported in hash, B+ tree |
| 61 | + and table databases. It is also used in the in-memory hash database. |
| 62 | + It should be between 1 and 4 times the number of all records to be stored. |
| 63 | + txt |
| 64 | + bnum 40 |
| 65 | + |
| 66 | + desc <<-txt |
| 67 | + The maximum number of records to store in the database. This is only |
| 68 | + used in the in-memory databases. |
| 69 | + txt |
| 70 | + capnum nil |
| 71 | + |
| 72 | + desc <<-txt |
| 73 | + The maximum amount of memory to use in the server. This is only used |
| 74 | + in the in-memory databases. |
| 75 | + txt |
| 76 | + capsize nil |
| 77 | + |
| 78 | + desc <<-txt |
| 79 | + Aligment power. The byte alignment of records. This specifies a power |
| 80 | + of two. The default value is 4 meaning that all records are aligned on |
| 81 | + 16 byte boundaries. |
| 82 | +
|
| 83 | + This applies to on disk Hash, B+ tree and Table databases. |
| 84 | + txt |
| 85 | + apow nil |
| 86 | + |
| 87 | + desc <<-txt |
| 88 | + Free block pool power. This is the maximum number of elements in the free |
| 89 | + block pool as a power of 2. The default is 10 meaning that there are a |
| 90 | + maximum of 1024 free blocks. |
| 91 | + |
| 92 | + This applies to on disk hash, B+ tree and Table databases. |
| 93 | + txt |
| 94 | + fpow nil |
| 95 | + |
| 96 | + desc <<-txt |
| 97 | + The maximum number of records to be cached. If set to 0 or less then |
| 98 | + the cache is disabled. That is the default. |
| 99 | +
|
| 100 | + This applies to on disk Hash and Table databases. |
| 101 | + txt |
| 102 | + rcnum nil |
| 103 | + |
| 104 | + desc <<-txt |
| 105 | + The size of the memory mapped region. By default this is 64 megabytes. |
| 106 | +
|
| 107 | + This applies to on disk Hash, B+ tree and Table databases. |
| 108 | + txt |
| 109 | + xmsiz |
| 110 | + |
| 111 | + desc <<-txt |
| 112 | + Auto defragmentation configuration. This controls how the automatic |
| 113 | + defragmentation of databases is preformed. It is the 'step' |
| 114 | + number. It is off by default. |
| 115 | +
|
| 116 | + This applies to on disk Hash, B+ tree and Table databases. |
| 117 | + txt |
| 118 | + dfunit nil |
| 119 | + |
| 120 | + desc <<-txt |
| 121 | + The maximum number of leaf nodes to be cached. The default is 4096. |
| 122 | +
|
| 123 | + This applies to B+ tree and Table databses |
| 124 | + txt |
| 125 | + lcnum nil |
| 126 | + |
| 127 | + desc <<-txt |
| 128 | + The maximum number of non-leaf nodes to be cached. The default is 512. |
| 129 | + |
| 130 | + This applies to B+ tree and Table databses |
| 131 | + txt |
| 132 | + ncnum nil |
| 133 | + |
| 134 | + desc <<-txt |
| 135 | + The number of members in each leaf page. The default is 128. |
| 136 | +
|
| 137 | + This applies to B+ tree databases. |
| 138 | + txt |
| 139 | + lmemb nil |
| 140 | + |
| 141 | + desc <<-txt |
| 142 | + The number of members in each non-leaf page. The default is 128. |
| 143 | +
|
| 144 | + This applies to B+ tree databases. |
| 145 | + txt |
| 146 | + nmemb nil |
| 147 | + |
| 148 | + desc <<-txt |
| 149 | + The width of the value of each record in a fixed length database. |
| 150 | + The default is 255. |
| 151 | + txt |
| 152 | + width nil |
| 153 | + |
| 154 | + desc <<-txt |
| 155 | + The file size limit of the fixed database file. The default is 256 MB. |
| 156 | + txt |
| 157 | + limsiz nil |
| 158 | + |
| 159 | + } |
| 160 | + |
| 161 | + desc <<-txt |
| 162 | + The directory holding the database file. By default this is relative |
| 163 | + to the instance directory. If you want to put it somewhere else, then |
| 164 | + put the full path here. |
| 165 | + txt |
| 166 | + data_dir "data" |
| 167 | + |
| 168 | + desc <<-txt |
| 169 | + The directory holding the update logs. By default this is relative |
| 170 | + to the instance directory. If you want to put it somewhere else, then |
| 171 | + put the full path here. |
| 172 | + txt |
| 173 | + ulog_dir "ulog" |
| 174 | + |
| 175 | + |
| 176 | + desc <<-txt |
| 177 | + The pid file location. By default this is relative to the instance |
| 178 | + directory. If you want it place somewhere else, then put the full |
| 179 | + path here. |
| 180 | + txt |
| 181 | + pid_file "highlights.pid" |
| 182 | + |
| 183 | + |
| 184 | + desc <<-txt |
| 185 | + The log file location. By default this is relative to the instance |
| 186 | + directory. If you want it place somewhere else, then put the full |
| 187 | + path here. |
| 188 | + txt |
| 189 | + log_file "log/highlights.log" |
| 190 | + |
| 191 | + |
| 192 | + desc <<-txt |
| 193 | + If this instance is to replicate the data from another instance then |
| 194 | + set that instances host here. |
| 195 | + txt |
| 196 | + master_server nil |
| 197 | + |
| 198 | + desc <<-txt |
| 199 | + If this instance is to replicate the data from another instance then |
| 200 | + set that instances port here. |
| 201 | + txt |
| 202 | + master_port nil |
| 203 | + |
| 204 | + desc <<-txt |
| 205 | + This is the server id of this instance when it is part of a replication. |
| 206 | + This must be set, and it must be unique within the set of hosts doing |
| 207 | + replication. |
| 208 | + txt |
| 209 | + server_id nil |
| 210 | + |
| 211 | + desc <<-txt |
| 212 | + If this server is replicating data from a master, then it must have |
| 213 | + this set to the location of a replication timestamp file. The |
| 214 | + default is relative to the instance directory. |
| 215 | + txt |
| 216 | + replication_timestamp_file "highlights.rts" |
| 217 | + |
| 218 | + desc <<-txt |
| 219 | + The name of a file to load as a lua extension. By default this |
| 220 | + is relative to the root of the instance directory. This file will |
| 221 | + only be loaded if it exists. |
| 222 | + txt |
| 223 | + lua_extension_file "lua/highlights.lua" |
| 224 | + |
| 225 | + desc <<-txt |
| 226 | + You may specify a lua function and a periodicity in which it is to |
| 227 | + be called. This lua function must be available from within the |
| 228 | + lua_extension_file that is loaded. |
| 229 | +
|
| 230 | + The periodicity is really the time to wait between calls. |
| 231 | + txt |
| 232 | + periodic_command { |
| 233 | + desc "The function to call" |
| 234 | + name nil |
| 235 | + |
| 236 | + desc "how often to call" |
| 237 | + period nil |
| 238 | + } |
| 239 | +end |
| 240 | + |
| 241 | +if $0 == __FILE__ then |
| 242 | + help = Loquacious::Configuration.help_for("highlights", :colorize => true) |
| 243 | + help.show :values => true |
| 244 | +end |
0 commit comments