org.apache.accumulo.core.iterators.YieldingKeyValueIterator类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.apache.accumulo.core.iterators.YieldingKeyValueIterator类的一些代码示例,展示了YieldingKeyValueIterator类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YieldingKeyValueIterator类的具体详情如下:
包路径:org.apache.accumulo.core.iterators.YieldingKeyValueIterator
类名称: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);
 }
}

相关文章

YieldingKeyValueIterator类方法