static CodecFactory codecFactory(OptionSet opts, OptionSpec<String> codec, OptionSpec<Integer> level, String defaultCodec) { String codecName = opts.hasArgument(codec) ? codec.value(opts) : defaultCodec; if(codecName.equals(DEFLATE_CODEC)) { return CodecFactory.deflateCodec(level.value(opts)); } else if(codecName.equals(DataFileConstants.XZ_CODEC)) { return CodecFactory.xzCodec(level.value(opts)); } else { return CodecFactory.fromString(codec.value(opts)); } } }
data.setMutators(this.mutators.values(userArgs)); data.setFeatures(this.features.values(userArgs)); data.setDependencyAnalysisMaxDistance(this.depth.value(userArgs)); data.addChildJVMArgs(this.jvmArgs.values(userArgs)); data.setFullMutationMatrix(this.fullMutationMatrixSpec.value(userArgs)); data.setNumberOfThreads(this.threadsSpec.value(userArgs)); data.setTimeoutFactor(this.timeoutFactorSpec.value(userArgs)); data.setTimeoutConstant(this.timeoutConstSpec.value(userArgs)); data.setLoggingClasses(this.avoidCallsSpec.values(userArgs)); data.setExcludedMethods(this.excludedMethodsSpec.values(userArgs)); data.setFailWhenNoMutations(this.failWhenNoMutations.value(userArgs)); data.setCodePaths(this.codePaths.values(userArgs)); data.setMutationUnitSize(this.mutationUnitSizeSpec.value(userArgs)); data.setHistoryInputLocation(this.historyInputSpec.value(userArgs)); data.setHistoryOutputLocation(this.historyOutputSpec.value(userArgs)); data.setMutationThreshold(this.mutationThreshHoldSpec.value(userArgs)); data.setMaximumAllowedSurvivors(this.maxSurvivingSpec.value(userArgs)); data.setCoverageThreshold(this.coverageThreshHoldSpec.value(userArgs)); data.setMutationEngine(this.mutationEngine.value(userArgs)); data.setFreeFormProperties(listToProperties(this.pluginPropertiesSpec .values(userArgs))); data.setJavaExecutable(this.javaExecutable.value(userArgs));
return 1; if (data.value(opts) != null) { this.response = Util.jsonToGenericDatum(expectedMessage.getResponse(), data.value(opts)); } else if (file.value(opts) != null) { this.response = Util.datumFromFile(expectedMessage.getResponse(), file.value(opts)); } else { err.println("One of -data or -file must be specified.");
.ofType(String.class); OptionSet opts = p.parse(args.toArray(new String[0])); String keyName = keyOption.value(opts);
Boolean noPretty = optionSet.has(noPrettyOption); List<String> nargs = (List<String>)optionSet.nonOptionArguments(); String schemaFile = schemaFileOption.value(optionSet);
String schemaFile = schemaFileOption.value(optionSet);
new AvroColumnWriter<>(reader.getSchema(), new ColumnFileMetaData() .setCodec(codec.value(opts))); for (Object datum : reader) writer.write(datum);
String schemastr = inschema.value(opts); String schemafile = file.value(opts); Long seed = seedOpt.value(opts); if (schemastr == null && schemafile == null) { err.println("Need input schema (--schema-file) or (--schema)"); writer.create(schema, Util.fileOrStdout(args.get(0), out)); Integer countValue = count.value(opts); if (countValue == null) { err.println("Need count (--count)");
final Path path = getPath(folderOption.value(options)).getParent(); final Path shardParent = path.getParent(); final Path shardParentParent = shardParent.getParent(); indexName = Objects.requireNonNull(indexNameOption.value(options), "Index name is required"); shardId = Objects.requireNonNull(shardIdOption.value(options), "Shard ID is required");
public String getPassword(){ return rdbjdbcpasswd.value(options); } }
public String getPassword(){ return rdbjdbcpasswd.value(options); } }
String setting = arguments.value(options); if (setting == null) { throw new UserException(ExitCodes.USAGE, "The setting name can not be null");
final Path pidFile = pidfileOption.value(options); final boolean quiet = options.has(quietOption);
static CodecFactory codecFactory(OptionSet opts, OptionSpec<String> codec, OptionSpec<Integer> level, String defaultCodec) { String codecName = opts.hasArgument(codec) ? codec.value(opts) : defaultCodec; if(codecName.equals(DEFLATE_CODEC)) { return CodecFactory.deflateCodec(level.value(opts)); } else if(codecName.equals(DataFileConstants.XZ_CODEC)) { return CodecFactory.xzCodec(level.value(opts)); } else { return CodecFactory.fromString(codec.value(opts)); } } }
private void deleteIndexerHttp(OptionSet options, String indexerName) throws Exception { String path = httpOption.value(options); path += (path.endsWith("/")?"":"/") + indexerName; HttpDelete httpDelete = new HttpDelete(path); String response = HttpUtil.getResponse(HttpUtil.sendRequest(httpDelete)); if (response != null) { System.out.println(response); } else { throw new RuntimeException("Expected non-null response"); } } }
private void addIndexerHttp(OptionSet options, IndexerDefinition indexer) throws Exception { HttpPost httpPost = new HttpPost(httpOption.value(options)); byte [] jsonBytes = IndexerDefinitionJsonSerDeser.INSTANCE.toJsonBytes(indexer); httpPost.setEntity(new ByteArrayEntity(jsonBytes)); String response = HttpUtil.getResponse(HttpUtil.sendRequest(httpPost)); if (response != null) { System.out.println(response); } else { throw new RuntimeException("Expected non-null response"); } } }
private List<IndexerDefinition> getIndexersHttp(OptionSet options) throws Exception { HttpGet httpGet = new HttpGet(httpOption.value(options)); byte [] response = HttpUtil.sendRequest(httpGet); List<IndexerDefinitionBuilder> builders = IndexerDefinitionsJsonSerDeser.INSTANCE.fromJsonBytes(response); List<IndexerDefinition> indexers = new ArrayList<IndexerDefinition>(); for (IndexerDefinitionBuilder builder : builders) { indexers.add(builder.build()); } return indexers; }