当前位置: 首页>>代码示例>>Java>>正文


Java SequencedExport类代码示例

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


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

示例1: export

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
@Override
public void export(Iterator<SequencedExport<String, RefUpdates>> exportIterator) {
  ArrayList<SequencedExport<String, RefUpdates>> exportList = new ArrayList<>();
  Iterators.addAll(exportList, exportIterator);

  synchronized (globalExports) {
    exportCalls++;

    for (SequencedExport<String, RefUpdates> se : exportList) {
      for (String addedRef : se.getValue().getAddedRefs()) {
        updateExports(se.getKey(), se.getSequence(), addedRef, false);
      }

      for (String deletedRef : se.getValue().getDeletedRefs()) {
        updateExports(se.getKey(), se.getSequence(), deletedRef, true);
      }
    }
  }
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:20,代码来源:ExportTestBase.java

示例2: translate

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
@Override
public void translate(SequencedExport<String, IndexUpdate> export, Consumer<Mutation> consumer) {
  if (export.getValue() instanceof DomainUpdate) {
    domainsExported.mark();
    IndexClient.genDomainMutations((DomainUpdate) export.getValue(), export.getSequence(),
        consumer);
  } else if (export.getValue() instanceof PageUpdate) {
    pagesExported.mark();
    IndexClient.genPageMutations((PageUpdate) export.getValue(), export.getSequence(), consumer);
  } else if (export.getValue() instanceof UriUpdate) {
    linksExported.mark();
    IndexClient.genUriMutations((UriUpdate) export.getValue(), export.getSequence(), consumer);
  } else {
    String msg =
        "An object with an IndexUpdate class (" + export.getValue().getClass().toString()
            + ") was placed on the export queue";
    log.error(msg);
    throw new IllegalStateException(msg);
  }
}
 
开发者ID:astralway,项目名称:webindex,代码行数:21,代码来源:IndexUpdateTranslator.java

示例3: export

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
@Override
public void export(Iterator<SequencedExport<K, V>> t) {
  ArrayList<Mutation> buffer = new ArrayList<>();
  Consumer<Mutation> consumer = m -> buffer.add(m);

  while (t.hasNext()) {
    translator.translate(t.next(), consumer);
  }

  if (buffer.size() > 0) {
    writer.write(buffer);
  }
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:14,代码来源:AccumuloExporter.java

示例4: translate

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
@Override
protected void translate(SequencedExport<String, Counts> export, Consumer<Mutation> consumer) {
  String phrase = export.getKey();
  long seq = export.getSequence();
  Counts counts = export.getValue();
  consumer.accept(PhraseCountTable.createMutation(phrase, seq, counts));
}
 
开发者ID:astralway,项目名称:phrasecount,代码行数:8,代码来源:PhraseExporter.java

示例5: translate

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
/**
 * @deprecated since 1.1.0 use
 *             {@link org.apache.fluo.recipes.accumulo.export.function.AccumuloExporter} with
 *             {@link #getTranslator()} instead.
 */
@Deprecated
@Override
protected void translate(SequencedExport<String, TxLog> export, Consumer<Mutation> consumer) {
  generateMutations(export.getSequence(), export.getValue(), consumer);
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:11,代码来源:AccumuloReplicator.java

示例6: processExports

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
@Override
protected void processExports(Iterator<SequencedExport<K, V>> exports) {
  accumuloWriter.export(exports);
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:5,代码来源:AccumuloExporter.java

示例7: andThen

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
/**
 * Returns a composed {@code Exporter} that exports, in sequence, to this then to {@code after}.
 * If performing either export throws an exception, it is relayed to the caller of the composed
 * operation. If performing this export operation throws an exception, the {@code after} export
 * will not be performed.
 *
 * @param after the export operation to perform after this operation
 * @return a composed {@code Exporter} that performs in sequence this export operation followed by
 *         the {@code after} export operation
 * @throws NullPointerException if {@code after} is null
 */
default Exporter<K, V> andThen(Exporter<K, V> after) {
  Objects.requireNonNull(after);
  return (Iterator<SequencedExport<K, V>> i) -> {
    export(i);
    after.export(i);
  };
}
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:19,代码来源:Exporter.java

示例8: translate

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
/**
 * This function should convert the export to zero or more mutations, passing the mutations to the
 * consumer.
 */
void translate(SequencedExport<K, V> export, Consumer<Mutation> mutationWriter);
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:6,代码来源:AccumuloTranslator.java

示例9: translate

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
/**
 * Implementations of this method should translate the given SequencedExport to 0 or more
 * Mutations.
 *
 * @param export the input that should be translated to mutations
 * @param consumer output mutations to this consumer
 */
protected abstract void translate(SequencedExport<K, V> export, Consumer<Mutation> consumer);
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:9,代码来源:AccumuloExporter.java

示例10: export

import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
/**
 * Performs this export operation.
 *
 * @param exports an iterator over the data to export
 */
void export(Iterator<SequencedExport<K, V>> exports);
 
开发者ID:apache,项目名称:fluo-recipes,代码行数:7,代码来源:Exporter.java


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