Copies the parsed command line options to the Config class @param config Configuration instance to override @since 2.0
(final ArgP argp, final Config config)
| 114 | * @since 2.0 |
| 115 | */ |
| 116 | static void overloadConfig(final ArgP argp, final Config config) { |
| 117 | |
| 118 | // loop and switch so we can map cli options to tsdb options |
| 119 | for (Map.Entry<String, String> entry : argp.getParsed().entrySet()) { |
| 120 | // map the overrides |
| 121 | if (entry.getKey().toLowerCase().equals("--auto-metric")) { |
| 122 | config.overrideConfig("tsd.core.auto_create_metrics", "true"); |
| 123 | } else if (entry.getKey().toLowerCase().equals("--disable-ui")) { |
| 124 | config.overrideConfig("tsd.core.enable_ui", "false"); |
| 125 | } else if (entry.getKey().toLowerCase().equals("--disable-api")) { |
| 126 | config.overrideConfig("tsd.core.enable_api", "false"); |
| 127 | } else if (entry.getKey().toLowerCase().equals("--table")) { |
| 128 | config.overrideConfig("tsd.storage.hbase.data_table", entry.getValue()); |
| 129 | } else if (entry.getKey().toLowerCase().equals("--uidtable")) { |
| 130 | config.overrideConfig("tsd.storage.hbase.uid_table", entry.getValue()); |
| 131 | } else if (entry.getKey().toLowerCase().equals("--zkquorum")) { |
| 132 | config.overrideConfig("tsd.storage.hbase.zk_quorum", |
| 133 | entry.getValue()); |
| 134 | } else if (entry.getKey().toLowerCase().equals("--zkbasedir")) { |
| 135 | config.overrideConfig("tsd.storage.hbase.zk_basedir", |
| 136 | entry.getValue()); |
| 137 | } else if (entry.getKey().toLowerCase().equals("--port")) { |
| 138 | config.overrideConfig("tsd.network.port", entry.getValue()); |
| 139 | } else if (entry.getKey().toLowerCase().equals("--staticroot")) { |
| 140 | config.overrideConfig("tsd.http.staticroot", entry.getValue()); |
| 141 | } else if (entry.getKey().toLowerCase().equals("--cachedir")) { |
| 142 | config.overrideConfig("tsd.http.cachedir", entry.getValue()); |
| 143 | } else if (entry.getKey().toLowerCase().equals("--flush-interval")) { |
| 144 | config.overrideConfig("tsd.core.flushinterval", entry.getValue()); |
| 145 | } else if (entry.getKey().toLowerCase().equals("--backlog")) { |
| 146 | config.overrideConfig("tsd.network.backlog", entry.getValue()); |
| 147 | } else if (entry.getKey().toLowerCase().equals("--read-only")) { |
| 148 | config.overrideConfig("tsd.mode", "ro"); |
| 149 | } else if (entry.getKey().toLowerCase().equals("--bind")) { |
| 150 | config.overrideConfig("tsd.network.bind", entry.getValue()); |
| 151 | } else if (entry.getKey().toLowerCase().equals("--async-io")) { |
| 152 | config.overrideConfig("tsd.network.async_io", entry.getValue()); |
| 153 | } else if (entry.getKey().toLowerCase().equals("--worker-threads")) { |
| 154 | config.overrideConfig("tsd.network.worker_threads", entry.getValue()); |
| 155 | } else if(entry.getKey().toLowerCase().equals("--use-otsdb-ts")) { |
| 156 | config.overrideConfig("tsd.storage.use_otsdb_timestamp", "true"); |
| 157 | } else if (entry.getKey().toLowerCase().equals("--dtc-ts")) { |
| 158 | config.overrideConfig("tsd.storage.get_date_tiered_compaction_start", entry.getValue()); |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | /** Changes the log level to 'WARN' unless --verbose is passed. */ |
| 164 | private static void honorVerboseFlag(final ArgP argp) { |