protected ContainsAnyOf(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.entrySet = new Configs().getEntrySet(config); }
protected ContainsAnyOf(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.entrySet = new Configs().getEntrySet(config); }
public AbstractAddValuesCommand(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); entrySet = new Configs().getEntrySet(config); for (Map.Entry<String, Object> entry : entrySet) { if (!(entry.getValue() instanceof Collection)) { entry.setValue(new FieldExpression(entry.getValue().toString(), getConfig())); } } }
public AbstractAddValuesCommand(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); entrySet = new Configs().getEntrySet(config); for (Map.Entry<String, Object> entry : entrySet) { if (!(entry.getValue() instanceof Collection)) { entry.setValue(new FieldExpression(entry.getValue().toString(), getConfig())); } } }
public Contains(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.entrySet = new Configs().getEntrySet(config); for (Map.Entry<String, Object> entry : entrySet) { if (!(entry.getValue() instanceof Collection)) { entry.setValue(new FieldExpression(entry.getValue().toString(), getConfig())); } } this.renderedConfig = config.root().render(); }
public Equals(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.entrySet = new Configs().getEntrySet(config); for (Map.Entry<String, Object> entry : entrySet) { if (!(entry.getValue() instanceof Collection)) { entry.setValue(new FieldExpression(entry.getValue().toString(), getConfig())); } } this.renderedConfig = config.root().render(); }
public Contains(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.entrySet = new Configs().getEntrySet(config); for (Map.Entry<String, Object> entry : entrySet) { if (!(entry.getValue() instanceof Collection)) { entry.setValue(new FieldExpression(entry.getValue().toString(), getConfig())); } } this.renderedConfig = config.root().render(); }
protected ReadXml(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); xpath = XPathFactory.newInstance().newXPath(); stepMap = Maps.newHashMap(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { docBuilder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } Config paths = getConfigs().getConfig(config, CONF_PATHS); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(paths)) { String fieldName = entry.getKey(); String path = entry.getValue().toString().trim(); stepMap.put(fieldName, path); } field = getConfigs().getString(config, CONF_FIELD, null); if (stepMap.size() == 0) { all = true; } LOG.debug("stepMap: {}", stepMap); }
public Equals(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.entrySet = new Configs().getEntrySet(config); for (Map.Entry<String, Object> entry : entrySet) { if (!(entry.getValue() instanceof Collection)) { entry.setValue(new FieldExpression(entry.getValue().toString(), getConfig())); } } this.renderedConfig = config.root().render(); }
private PatternMetricFilter(Config config) { Configs configs = new Configs(); Config includesConfig = configs.getConfig(config, "includes", null); if (includesConfig == null) { includes.add(new ExpressionPair(new MatchAllExpression(), new MatchAllExpression())); } else { for (Map.Entry<String, Object> entry : new Configs().getEntrySet(includesConfig)) { includes.add(parseExpressionPair(entry.getKey(), entry.getValue().toString(), includesConfig)); } } Config excludesConfig = configs.getConfig(config, "excludes", null); if (excludesConfig != null) { for (Map.Entry<String, Object> entry : new Configs().getEntrySet(excludesConfig)) { excludes.add(parseExpressionPair(entry.getKey(), entry.getValue().toString(), excludesConfig)); } } configs.validateArguments(config); }
private PatternMetricFilter(Config config) { Configs configs = new Configs(); Config includesConfig = configs.getConfig(config, "includes", null); if (includesConfig == null) { includes.add(new ExpressionPair(new MatchAllExpression(), new MatchAllExpression())); } else { for (Map.Entry<String, Object> entry : new Configs().getEntrySet(includesConfig)) { includes.add(parseExpressionPair(entry.getKey(), entry.getValue().toString(), includesConfig)); } } Config excludesConfig = configs.getConfig(config, "excludes", null); if (excludesConfig != null) { for (Map.Entry<String, Object> entry : new Configs().getEntrySet(excludesConfig)) { excludes.add(parseExpressionPair(entry.getKey(), entry.getValue().toString(), excludesConfig)); } } configs.validateArguments(config); }
public LoadSolr(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); Config solrLocatorConfig = getConfigs().getConfig(config, "solrLocator"); SolrLocator locator = new SolrLocator(solrLocatorConfig, context); LOG.debug("solrLocator: {}", locator); this.loader = locator.getLoader(); Config boostsConfig = getConfigs().getConfig(config, "boosts", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(boostsConfig)) { String fieldName = entry.getKey(); float boost = Float.parseFloat(entry.getValue().toString().trim()); boosts.put(fieldName, boost); } validateArguments(); this.elapsedTime = getTimer(Metrics.ELAPSED_TIME); }
public Translate(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.fieldName = getConfigs().getString(config, "field"); Config dict = getConfigs().getConfig(config, "dictionary"); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(dict)) { dictionary.put(entry.getKey(), entry.getValue()); } this.fallback = getConfigs().getString(config, "fallback", null); validateArguments(); }
public Translate(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.fieldName = getConfigs().getString(config, "field"); Config dict = getConfigs().getConfig(config, "dictionary"); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(dict)) { dictionary.put(entry.getKey(), entry.getValue()); } this.fallback = getConfigs().getString(config, "fallback", null); validateArguments(); }
public LoadSolr(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); Config solrLocatorConfig = getConfigs().getConfig(config, SOLR_LOCATOR_PARAM); SolrLocator locator = new SolrLocator(solrLocatorConfig, context); LOG.debug("solrLocator: {}", locator); this.loader = locator.getLoader(); Config boostsConfig = getConfigs().getConfig(config, "boosts", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(boostsConfig)) { String fieldName = entry.getKey(); float boost = Float.parseFloat(entry.getValue().toString().trim()); boosts.put(fieldName, boost); } this.isDryRun = context.getTypedSettings().getBoolean(TypedSettings.DRY_RUN_SETTING_NAME, false); validateArguments(); this.elapsedTime = getTimer(Metrics.ELAPSED_TIME); }
private void assertNameValueEquals(String key, String value, Config config) { for (Map.Entry<String, Object> entry : new Configs().getEntrySet(config)) { assertEquals(key, entry.getKey()); assertEquals(value, entry.getValue()); } }
public WriteAvroToByteArray(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.format = new Validator<Format>().validateEnum( config, getConfigs().getString(config, "format", Format.container.toString()), Format.class); String codec = getConfigs().getString(config, "codec", null); if (codec == null) { this.codecFactory = null; } else { this.codecFactory = CodecFactory.fromString(codec); } Config metadataConfig = getConfigs().getConfig(config, "metadata", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(metadataConfig)) { this.metadata.put(entry.getKey(), entry.getValue().toString()); } validateArguments(); }
public WriteAvroToByteArray(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.format = new Validator<Format>().validateEnum( config, getConfigs().getString(config, "format", Format.container.toString()), Format.class); String codec = getConfigs().getString(config, "codec", null); if (codec == null) { this.codecFactory = null; } else { this.codecFactory = CodecFactory.fromString(codec); } Config metadataConfig = getConfigs().getConfig(config, "metadata", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(metadataConfig)) { this.metadata.put(entry.getKey(), entry.getValue().toString()); } validateArguments(); }
public LoadSolr(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); Config solrLocatorConfig = getConfigs().getConfig(config, SOLR_LOCATOR_PARAM); SolrLocator locator = new SolrLocator(solrLocatorConfig, context); LOG.debug("solrLocator: {}", locator); RetryPolicyFactory retryPolicyFactory = parseRetryPolicyFactory( getConfigs().getConfig(config, "retryPolicy", null)); this.loader = locator.getLoader(retryPolicyFactory, new CodahaleMetricsFacade(context.getMetricRegistry())); Config boostsConfig = getConfigs().getConfig(config, "boosts", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(boostsConfig)) { String fieldName = entry.getKey(); float boost = Float.parseFloat(entry.getValue().toString().trim()); boosts.put(fieldName, boost); } this.rateLimiter = RateLimiter.create(getConfigs().getDouble(config, "maxRecordsPerSecond", Double.MAX_VALUE)); this.isDryRun = context.getTypedSettings().getBoolean(TypedSettings.DRY_RUN_SETTING_NAME, false); validateArguments(); this.elapsedTime = getTimer(Metrics.ELAPSED_TIME); }
public Grok(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); GrokDictionaries dict = new GrokDictionaries(config, getConfigs()); Config exprConfig = getConfigs().getConfig(config, "expressions", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(exprConfig)) { String expr = entry.getValue().toString(); this.regexes.add(new Regex(entry.getKey(), dict.compileExpression(expr).matcher(""))); } this.firstKey = (regexes.size() == 0 ? null : regexes.iterator().next().getRecordInputField()); String extractStr = getConfigs().getString(config, "extract", "true"); this.extractInPlace = extractStr.equals("inplace"); if (extractInPlace) { this.extract = true; } else { this.extract = getConfigs().getBoolean(config, "extract", true); } this.numRequiredMatches = new Validator<NumRequiredMatches>().validateEnum( config, getConfigs().getString(config, "numRequiredMatches", NumRequiredMatches.atLeastOnce.toString()), NumRequiredMatches.class); this.findSubstrings = getConfigs().getBoolean(config, "findSubstrings", false); this.addEmptyStrings = getConfigs().getBoolean(config, "addEmptyStrings", false); validateArguments(); this.renderedConfig = config.root().render(); }