MCPcopy Create free account
hub / github.com/apache/solr / runImpl

Method runImpl

solr/core/src/java/org/apache/solr/cli/PostTool.java:274–321  ·  view source on GitHub ↗
(CommandLine cli)

Source from the content-addressed store, hash-verified

272 }
273
274 @Override
275 public void runImpl(CommandLine cli) throws Exception {
276 solrUpdateUrl = null;
277 if (CLIUtils.hasConnectionOption(cli)) {
278 String url =
279 CLIUtils.normalizeSolrUrl(cli)
280 + "/solr/"
281 + cli.getOptionValue(COLLECTION_NAME_OPTION)
282 + "/update";
283 solrUpdateUrl = new URI(url);
284
285 } else {
286 String url =
287 CLIUtils.getDefaultSolrUrl()
288 + "/solr/"
289 + cli.getOptionValue(COLLECTION_NAME_OPTION)
290 + "/update";
291 solrUpdateUrl = new URI(url);
292 }
293
294 String mode = cli.getOptionValue(MODE_OPTION, DATA_MODE_FILES);
295
296 dryRun = cli.hasOption(DRY_RUN_OPTION);
297
298 if (cli.hasOption(TYPE_OPTION)) {
299 type = cli.getOptionValue(TYPE_OPTION);
300 // Turn off automatically looking up the mimetype in favour of what is passed in.
301 auto = false;
302 }
303 format =
304 cli.hasOption(FORMAT_OPTION) ? FORMAT_SOLR : ""; // i.e not solr formatted json commands
305 fileTypes = cli.getOptionValue(FILE_TYPES_OPTION, PostTool.DEFAULT_FILE_TYPES);
306
307 int defaultDelay = (mode.equals((DATA_MODE_WEB)) ? 10 : 0);
308 delay = cli.getParsedOptionValue(DELAY_OPTION, defaultDelay);
309 recursive = cli.getParsedOptionValue(RECURSIVE_OPTION, 1);
310
311 out = isVerbose() ? CLIO.getOutStream() : null;
312 commit = !cli.hasOption(SKIP_COMMIT_OPTION);
313 optimize = cli.hasOption(OPTIMIZE_OPTION);
314
315 credentials = cli.getOptionValue(CommonCLIOptions.CREDENTIALS_OPTION);
316 args = cli.getArgs();
317
318 params = cli.getOptionValue(PARAMS_OPTION, "");
319
320 execute(mode);
321 }
322
323 /**
324 * After initialization, call execute to start the post job. This method delegates to the correct

Callers

nothing calls this directly

Calls 8

hasConnectionOptionMethod · 0.95
normalizeSolrUrlMethod · 0.95
getDefaultSolrUrlMethod · 0.95
getOutStreamMethod · 0.95
executeMethod · 0.95
isVerboseMethod · 0.80
equalsMethod · 0.45
getArgsMethod · 0.45

Tested by

no test coverage detected