@Override WorkerQuery newQuery() { WorkerQuery query = super.newQuery(); if (query.getWorkerAddresses() == null) { query.setTargetType(options.valueOf(targetTypeSpec)); } return query; }
WorkerQuery newQuery() { WorkerQuery query = new WorkerQuery().setRandom(options.has(randomSpec)); List<String> workerAddresses = loadAddresses(options, workersSpec, AddressLevel.WORKER); if (workerAddresses == null) { List<String> agentAddresses = loadAddresses(options, agentsSpec, AddressLevel.AGENT); Integer maxCount = options.valueOf(maxCountSpec); if (maxCount != null) { if (maxCount <= 0) { throw new CommandLineExitException("--maxCount can't be smaller than 1"); } } return query .setAgentAddresses(agentAddresses) .setWorkerType(options.valueOf(workerTypeSpec)) .setVersionSpec(options.valueOf(versionSpecSpec)) .setWorkerTags(TagUtils.loadTags(options, workerTagsSpec)) .setMaxCount(maxCount); } else { return query.setWorkerAddresses(workerAddresses); } }