本文整理汇总了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);
}
}
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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);
}
示例6: processExports
import org.apache.fluo.recipes.core.export.SequencedExport; //导入依赖的package包/类
@Override
protected void processExports(Iterator<SequencedExport<K, V>> exports) {
accumuloWriter.export(exports);
}
示例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);
};
}
示例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);
示例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);
示例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);