本文整理了Java中org.apache.accumulo.core.iterators.YieldCallback.getPositionAndReset()
方法的一些代码示例,展示了YieldCallback.getPositionAndReset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YieldCallback.getPositionAndReset()
方法的具体详情如下:
包路径:org.apache.accumulo.core.iterators.YieldCallback
类名称:YieldCallback
方法名:getPositionAndReset
[英]Called by the client to get the yield position used as the start key (non-inclusive) of the range in a subsequent seek call when the iterator is rebuilt. This will also reset the state returned by hasYielded.
[中]由客户端调用,以在重建迭代器时,在后续的seek调用中获取用作范围的开始键(非包含)的屈服位置。这也将重置HasGender返回的状态。
代码示例来源:origin: apache/accumulo
if (yield.hasYielded()) {
throw new IOException(
"Coding error: hasTop returned true but has yielded at " + yield.getPositionAndReset());
continueKey = new Key(yield.getPositionAndReset());
skipContinueKey = true;
if (!range.contains(continueKey)) {
代码示例来源:origin: apache/accumulo
if (yield.hasYielded()) {
throw new IOException("Coding error: hasTop returned true but has yielded at "
+ yield.getPositionAndReset());
Key yieldPosition = yield.getPositionAndReset();
if (!range.contains(yieldPosition)) {
throw new IOException("Underlying iterator yielded to a position outside of its range: "
代码示例来源:origin: apache/accumulo
TreeMap<Key,Value> consume(IteratorTestInput testInput, SortedKeyValueIterator<Key,Value> skvi,
YieldCallback<Key> yield) throws IOException {
TreeMap<Key,Value> data = new TreeMap<>();
Key lastKey = null;
while (yield.hasYielded() || skvi.hasTop()) {
if (yield.hasYielded()) {
Range r = testInput.getRange();
Key yieldPosition = yield.getPositionAndReset();
if (!r.contains(yieldPosition)) {
throw new IOException("Underlying iterator yielded to a position outside of its range: "
+ yieldPosition + " not in " + r);
}
if (skvi.hasTop()) {
throw new IOException(
"Underlying iterator reports having a top, but has yielded: " + yieldPosition);
}
if (lastKey != null && yieldPosition.compareTo(lastKey) <= 0) {
throw new IOException(
"Underlying iterator yielded at a position that is not past the last key returned");
}
skvi.seek(new Range(yieldPosition, false, r.getEndKey(), r.isEndKeyInclusive()),
testInput.getFamilies(), testInput.isInclusive());
} else {
// Make sure to copy the K-V
data.put(new Key(skvi.getTopKey()), new Value(skvi.getTopValue()));
skvi.next();
}
}
return data;
}
代码示例来源:origin: apache/accumulo
iter.seek(range, columnFamilies, inclusive);
else if (yielded) {
Key yieldPosition = yield.get().getPositionAndReset();
if (!range.contains(yieldPosition)) {
throw new IOException("Underlying iterator yielded to a position outside of its range: "
if (yield.isPresent() && yield.get().hasYielded()) {
throw new IOException("Coding error: hasTop returned true but has yielded at "
+ yield.get().getPositionAndReset());
代码示例来源:origin: org.apache.accumulo/accumulo-tserver
if (yield.hasYielded()) {
throw new IOException(
"Coding error: hasTop returned true but has yielded at " + yield.getPositionAndReset());
continueKey = new Key(yield.getPositionAndReset());
skipContinueKey = true;
if (!range.contains(continueKey)) {
代码示例来源:origin: org.apache.accumulo/accumulo-tserver
if (yield.hasYielded()) {
throw new IOException("Coding error: hasTop returned true but has yielded at "
+ yield.getPositionAndReset());
Key yieldPosition = yield.getPositionAndReset();
if (!range.contains(yieldPosition)) {
throw new IOException("Underlying iterator yielded to a position outside of its range: "
代码示例来源:origin: org.apache.accumulo/accumulo-iterator-test-harness
TreeMap<Key,Value> consume(IteratorTestInput testInput, SortedKeyValueIterator<Key,Value> skvi,
YieldCallback<Key> yield) throws IOException {
TreeMap<Key,Value> data = new TreeMap<>();
Key lastKey = null;
while (yield.hasYielded() || skvi.hasTop()) {
if (yield.hasYielded()) {
Range r = testInput.getRange();
Key yieldPosition = yield.getPositionAndReset();
if (!r.contains(yieldPosition)) {
throw new IOException("Underlying iterator yielded to a position outside of its range: "
+ yieldPosition + " not in " + r);
}
if (skvi.hasTop()) {
throw new IOException(
"Underlying iterator reports having a top, but has yielded: " + yieldPosition);
}
if (lastKey != null && yieldPosition.compareTo(lastKey) <= 0) {
throw new IOException(
"Underlying iterator yielded at a position that is not past the last key returned");
}
skvi.seek(new Range(yieldPosition, false, r.getEndKey(), r.isEndKeyInclusive()),
testInput.getFamilies(), testInput.isInclusive());
} else {
// Make sure to copy the K-V
data.put(new Key(skvi.getTopKey()), new Value(skvi.getTopValue()));
skvi.next();
}
}
return data;
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
iter.seek(range, columnFamilies, inclusive);
else if (yielded) {
Key yieldPosition = yield.get().getPositionAndReset();
if (!range.contains(yieldPosition)) {
throw new IOException("Underlying iterator yielded to a position outside of its range: "
if (yield.isPresent() && yield.get().hasYielded()) {
throw new IOException("Coding error: hasTop returned true but has yielded at "
+ yield.get().getPositionAndReset());
内容来源于网络,如有侵权,请联系作者删除!