• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CommandBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kitesdk.morphline.api.CommandBuilder的典型用法代码示例。如果您正苦于以下问题:Java CommandBuilder类的具体用法?Java CommandBuilder怎么用?Java CommandBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommandBuilder类属于org.kitesdk.morphline.api包,在下文中一共展示了CommandBuilder类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: TokenizeText

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public TokenizeText(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
  super(builder, config, parent, child, context);
  this.inputFieldName = getConfigs().getString(config, "inputField");
  this.outputFieldName = getConfigs().getString(config, "outputField");      
  String solrFieldType = getConfigs().getString(config, "solrFieldType");      
  Config solrLocatorConfig = getConfigs().getConfig(config, "solrLocator");
  SolrLocator locator = new SolrLocator(solrLocatorConfig, context);
  LOG.debug("solrLocator: {}", locator);
  IndexSchema schema = locator.getIndexSchema();
  FieldType fieldType = schema.getFieldTypeByName(solrFieldType);
  if (fieldType == null) {
    throw new MorphlineCompilationException("Missing Solr field type in schema.xml for name: " + solrFieldType, config);
  }
  this.analyzer = fieldType.getIndexAnalyzer();
  Preconditions.checkNotNull(analyzer);
  try { // register CharTermAttribute for later (implicit) reuse
    this.token = analyzer.tokenStream("content", reader).addAttribute(CharTermAttribute.class);
  } catch (IOException e) {
    throw new MorphlineCompilationException("Cannot create token stream", config, e);
  }
  Preconditions.checkNotNull(token);
  validateArguments();
}
 
开发者ID:europeana,项目名称:search,代码行数:24,代码来源:TokenizeTextBuilder.java


示例2: GenerateSolrSequenceKey

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public GenerateSolrSequenceKey(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
  super(builder, config, parent, child, context);
  this.baseIdFieldName = getConfigs().getString(config, "baseIdField", Fields.BASE_ID);
  this.preserveExisting = getConfigs().getBoolean(config, "preserveExisting", true);      
  
  Config solrLocatorConfig = getConfigs().getConfig(config, "solrLocator");
  SolrLocator locator = new SolrLocator(solrLocatorConfig, context);
  LOG.debug("solrLocator: {}", locator);
  IndexSchema schema = locator.getIndexSchema();
  SchemaField uniqueKey = schema.getUniqueKeyField();
  uniqueKeyName = uniqueKey == null ? null : uniqueKey.getName();
  
  String tmpIdPrefix = getConfigs().getString(config, "idPrefix", null);  // for load testing only
  Random tmpRandomIdPrefx = null;
  if ("random".equals(tmpIdPrefix)) { // for load testing only
    tmpRandomIdPrefx = new Random(new SecureRandom().nextLong());    
    tmpIdPrefix = null;
  }
  idPrefix = tmpIdPrefix;
  randomIdPrefix = tmpRandomIdPrefx;
  validateArguments();
}
 
开发者ID:europeana,项目名称:search,代码行数:23,代码来源:GenerateSolrSequenceKeyBuilder.java


示例3: LoadElasticsearch

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
LoadElasticsearch(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
  super(builder, config, parent, child, context);
  elapsedTime = getTimer(Metrics.ELAPSED_TIME);
  Config elasticsearchConfig = getConfigs().getConfig(config, ELASTICSEARCH_CONFIGURATION);
  String loaderType = getConfigs().getString(config, DOCUMENT_LOADER_TYPE);
  indexName = new FieldExpression(getConfigs().getString(config, INDEX_NAME), getConfig());
  indexType = new FieldExpression(getConfigs().getString(config, TYPE), getConfig());
  ignoreFields = new LinkedHashSet<String>(getConfigs().getStringList(config, IGNORE_FIELDS, new ArrayList<String>()));
  ttl = getConfigs().getInt(config, TTL);
  validateArguments();

  DocumentLoaderFactory documentLoaderFactory = new DocumentLoaderFactory();
  try {
    loader = documentLoaderFactory.getClient(loaderType, elasticsearchConfig);
  } catch (IllegalArgumentException e) {
    throw new MorphlineRuntimeException(e);
  }
}
 
开发者ID:sematext,项目名称:kite-morphlines-elasticsearch,代码行数:19,代码来源:LoadElasticsearchBuilder.java


示例4: TokenizeText

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public TokenizeText(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
  super(builder, config, parent, child, context);
  this.inputFieldName = getConfigs().getString(config, "inputField");
  this.outputFieldName = getConfigs().getString(config, "outputField");      
  String solrFieldType = getConfigs().getString(config, "solrFieldType");      
  Config solrLocatorConfig = getConfigs().getConfig(config, "solrLocator");
  SolrLocator locator = new SolrLocator(solrLocatorConfig, context);
  LOG.debug("solrLocator: {}", locator);
  IndexSchema schema = locator.getIndexSchema();
  FieldType fieldType = schema.getFieldTypeByName(solrFieldType);
  if (fieldType == null) {
    throw new MorphlineCompilationException("Missing Solr field type in schema.xml for name: " + solrFieldType, config);
  }
  this.analyzer = fieldType.getAnalyzer();
  Preconditions.checkNotNull(analyzer);
  try { // register CharTermAttribute for later (implicit) reuse
    this.token = analyzer.tokenStream("content", reader).addAttribute(CharTermAttribute.class);
  } catch (IOException e) {
    throw new MorphlineCompilationException("Cannot create token stream", config, e);
  }
  Preconditions.checkNotNull(token);
  validateArguments();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:TokenizeTextBuilder.java


示例5: SanitizeUnknownSolrFields

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public SanitizeUnknownSolrFields(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.schema = locator.getIndexSchema();
  Preconditions.checkNotNull(schema);
  LOG.trace("Solr schema: \n{}", Joiner.on("\n").join(new TreeMap(schema.getFields()).values()));
  
  String str = getConfigs().getString(config, "renameToPrefix", "").trim();
  this.renameToPrefix = str.length() > 0 ? str : null;  
  validateArguments();
}
 
开发者ID:europeana,项目名称:search,代码行数:15,代码来源:SanitizeUnknownSolrFieldsBuilder.java


示例6: LoadSolr

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
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);
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:LoadSolrBuilder.java


示例7: ToUpperCase

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public ToUpperCase(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    this.fieldName = getConfigs().getString(config, "field");
    this.locale = getConfigs().getLocale(config, "locale", Locale.ROOT);
    LOG.debug("fieldName: {}", fieldName);
    validateArguments();
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:8,代码来源:ToUpperCaseBuilder.java


示例8: ToLowerCase

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public ToLowerCase(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    this.fieldName = getConfigs().getString(config, "field");
    this.locale = getConfigs().getLocale(config, "locale", Locale.ROOT);
    LOG.debug("fieldName: {}", fieldName);
    validateArguments();
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:8,代码来源:ToLowerCaseBuilder.java


示例9: Split

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public Split(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    this.fieldName = getConfigs().getString(config, "field");
    this.separator = getConfigs().getString(config, "separator");
    this.newFields = getConfigs().getStringList(config, "newFields");
    this.dropUndeclaredField = getConfigs().getBoolean(config, "dropUndeclaredField", true);
    this.trimSegments = getConfigs().getBoolean(config, "trimSegments", true);
    LOG.debug("fieldName: {}", fieldName);
    validateArguments();
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:11,代码来源:SplitBuilder.java


示例10: DateCheck

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public DateCheck(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    this.fieldName = getConfigs().getString(config, "field");
    this.operator = getConfigs().getString(config, "operator");
    this.pattern = getConfigs().getString(config, "pattern");
    LOG.debug("fieldName: {}", fieldName);
    validateArguments();
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:9,代码来源:LatestSongCommand.java


示例11: MyToLowerCase

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public MyToLowerCase(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
  super(builder, config, parent, child, context);
  this.fieldName = getConfigs().getString(config, "field");
  this.locale = getConfigs().getLocale(config, "locale", Locale.ROOT);
  this.reverse = getConfigs().getBoolean(config, "reverse", false);
  LOG.debug("fieldName: {}", fieldName);
  validateArguments();
}
 
开发者ID:kite-sdk,项目名称:kite-examples,代码行数:9,代码来源:MyToLowerCaseBuilder.java


示例12: ExtractHBaseCells

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public ExtractHBaseCells(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    for (Config mapping : getConfigs().getConfigList(config, "mappings")) {
        mappings.add(new Mapping(mapping, context));
    }
    validateArguments();
}
 
开发者ID:NGDATA,项目名称:hbase-indexer,代码行数:8,代码来源:ExtractHBaseCellsBuilder.java


示例13: Capitalize

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public Capitalize(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    this.fieldName = getConfigs().getString(config, "field");
    LOG.debug("fieldName: {}", fieldName);
    validateArguments();
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:7,代码来源:CapitalizeBuilder.java


示例14: Reverse

import org.kitesdk.morphline.api.CommandBuilder; //导入依赖的package包/类
public Reverse(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
    super(builder, config, parent, child, context);
    this.fieldName = getConfigs().getString(config, "field");
    LOG.debug("fieldName: {}", fieldName);
    validateArguments();
}
 
开发者ID:sequenceiq,项目名称:sequenceiq-samples,代码行数:7,代码来源:ReverseBuilder.java



注:本文中的org.kitesdk.morphline.api.CommandBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PDEPluginImages类代码示例发布时间:2022-05-22
下一篇:
Java JcEnumeration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap