本文整理了Java中org.apache.accumulo.core.iterators.YieldingKeyValueIterator
类的一些代码示例,展示了YieldingKeyValueIterator
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YieldingKeyValueIterator
类的具体详情如下:
包路径:org.apache.accumulo.core.iterators.YieldingKeyValueIterator
类名称:YieldingKeyValueIterator
[英]An iterator that supports yielding on a next or seek call (only used by SortedKeyValueIterators)
[中]一个迭代器,支持在下一次或seek调用时让步(仅由SortedKeyValue迭代器使用)
代码示例来源:origin: org.apache.accumulo/accumulo-core
@Override
public void enableYielding(YieldCallback<Key> yield) {
this.yield = Optional.of(yield);
// if we require row isolation, then we cannot support yielding in the middle.
if (!onlySwitchAfterRow) {
if (iter != null && iter instanceof YieldingKeyValueIterator) {
((YieldingKeyValueIterator<Key,Value>) iter).enableYielding(yield);
}
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
synchronized (copies) {
this.range = range;
this.inclusive = inclusive;
this.columnFamilies = columnFamilies;
if (iter == null) {
iter = source.iterator();
if (!onlySwitchAfterRow && yield.isPresent()) {
if (iter instanceof YieldingKeyValueIterator) {
((YieldingKeyValueIterator<Key,Value>) iter).enableYielding(yield.get());
}
}
}
readNext(true);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
private boolean switchSource() throws IOException {
if (!source.isCurrent()) {
source = source.getNewDataSource();
iter = source.iterator();
if (!onlySwitchAfterRow && yield.isPresent()) {
if (iter instanceof YieldingKeyValueIterator) {
((YieldingKeyValueIterator<Key,Value>) iter).enableYielding(yield.get());
}
}
return true;
}
return false;
}
代码示例来源:origin: org.apache.accumulo/accumulo-tserver
((YieldingKeyValueIterator<Key,Value>) iter).enableYielding(yield);
代码示例来源:origin: org.apache.accumulo/accumulo-tserver
((YieldingKeyValueIterator<Key,Value>) mmfi).enableYielding(yield);
boolean yielded = false;
代码示例来源:origin: org.apache.accumulo/accumulo-iterator-test-harness
@Override
public IteratorTestOutput test(IteratorTestInput testInput) {
final SortedKeyValueIterator<Key,Value> skvi = IteratorTestUtil.instantiateIterator(testInput);
final SortedKeyValueIterator<Key,Value> source = IteratorTestUtil.createSource(testInput);
try {
skvi.init(source, testInput.getIteratorOptions(), new SimpleIteratorEnvironment());
YieldCallback<Key> yield = new YieldCallback<>();
if (skvi instanceof YieldingKeyValueIterator) {
((YieldingKeyValueIterator<Key,Value>) skvi).enableYielding(yield);
}
skvi.seek(testInput.getRange(), testInput.getFamilies(), testInput.isInclusive());
return new IteratorTestOutput(consume(testInput, skvi, yield));
} catch (IOException e) {
return new IteratorTestOutput(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!