Package com.cloudera.cdk.morphline.base

Examples of com.cloudera.cdk.morphline.base.Configs


      } catch (IOException e) {
        throw new MorphlineCompilationException("Cannot parse UserAgent database: " + databaseFile, config, e);
      }
     
      Config outputFields = getConfigs().getConfig(config, "outputFields", ConfigFactory.empty());
      for (Map.Entry<String, Object> entry : new Configs().getEntrySet(outputFields)) {
        mappings.add(
            new Mapping(
                entry.getKey(),
                entry.getValue().toString().trim(),
                parser,
View Full Code Here


    boolean isLicensedSaxonEdition = getConfigs().getBoolean(config, "isLicensedSaxonEdition", false);
    this.processor = new Processor(isLicensedSaxonEdition);
    this.documentBuilder = processor.newDocumentBuilder();
   
    Config features = getConfigs().getConfig(config, "features", ConfigFactory.empty());
    for (Map.Entry<String, Object> entry : new Configs().getEntrySet(features)) {
      processor.setConfigurationProperty(entry.getKey(), entry.getValue());
    }
  }
View Full Code Here

          throw new MorphlineCompilationException("Must not define both query and queryFile at the same time", config);
        }
       
        XQueryEvaluator evaluator = executable.load();
        Config variables = getConfigs().getConfig(fragment, "externalVariables", ConfigFactory.empty());
        for (Map.Entry<String, Object> entry : new Configs().getEntrySet(variables)) {
          XdmValue xdmValue = XdmNode.wrap(new UntypedAtomicValue(entry.getValue().toString()));
          evaluator.setExternalVariable(new QName(entry.getKey()), xdmValue);
        }
        Config fileVariables = getConfigs().getConfig(fragment, "externalFileVariables", ConfigFactory.empty());
        for (Map.Entry<String, Object> entry : new Configs().getEntrySet(fileVariables)) {
          File file = new File(entry.getValue().toString());
          XdmValue doc = parseXmlDocument(file);
          evaluator.setExternalVariable(new QName(entry.getKey()), doc);
        }
        if (isTracing) {
View Full Code Here

    private final Set<Map.Entry<String, Object>> entrySet;
    private final String renderedConfig; // cached value
   
    public Contains(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
      super(builder, config, parent, child, context);     
      this.entrySet = new Configs().getEntrySet(config);
      this.renderedConfig = config.root().render();
    }
View Full Code Here

    public ExtractJsonPaths(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
      super(builder, config, parent, child, context);
      ListMultimap<String, String> stepMultiMap = ArrayListMultimap.create();
      this.flatten = getConfigs().getBoolean(config, "flatten", true);
      Config paths = getConfigs().getConfig(config, "paths");
      for (Map.Entry<String, Object> entry : new Configs().getEntrySet(paths)) {
        String fieldName = entry.getKey();       
        String path = entry.getValue().toString().trim();
        if (path.contains("//")) {
          throw new MorphlineCompilationException("No support for descendant axis available yet", config);
        }
View Full Code Here

  }

  public SolrLocator(Config config, MorphlineContext context) {
    this(context);
    this.config = config;
    Configs configs = new Configs();
    collectionName = configs.getString(config, "collection", null);
    zkHost = configs.getString(config, "zkHost", null);
    solrHomeDir = configs.getString(config, "solrHomeDir", null);
    solrUrl = configs.getString(config, "solrUrl", null);   
    batchSize = configs.getInt(config, "batchSize", batchSize);
    LOG.trace("Constructed solrLocator: {}", this);
    configs.validateArguments(config);
  }
View Full Code Here

    public ExtractAvroPaths(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
      super(builder, config, parent, child, context);
      ListMultimap<String, String> stepMultiMap = ArrayListMultimap.create();
      this.flatten = getConfigs().getBoolean(config, "flatten", true);
      Config paths = getConfigs().getConfig(config, "paths");
      for (Map.Entry<String, Object> entry : new Configs().getEntrySet(paths)) {
        String fieldName = entry.getKey();       
        String path = entry.getValue().toString().trim();
        if (path.contains("//")) {
          throw new MorphlineCompilationException("No support for descendant axis available yet", config);
        }
View Full Code Here

      return new PatternMetricFilter(filterConfig);
    }
  }
 
  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);
  }
View Full Code Here

      } else {
        this.fixedSchema = null;
      }
     
      Config mappingsConfig = getConfigs().getConfig(config, "mappings", ConfigFactory.empty());
      for (Map.Entry<String, Object> entry : new Configs().getEntrySet(mappingsConfig)) {
        mappings.put(entry.getKey(), entry.getValue().toString());
      }
      validateArguments();
    }
View Full Code Here

    assertTimeUnitEquals(TimeUnit.NANOSECONDS, "ns");
  }
 
  private void assertTimeUnitEquals(TimeUnit unit, String str) {
    Config config = ConfigFactory.parseString("foo : " + str);
    assertSame(unit, new Configs().getTimeUnit(config, "foo"));   
  }
View Full Code Here

TOP

Related Classes of com.cloudera.cdk.morphline.base.Configs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.