本文整理汇总了Java中org.apache.accumulo.core.client.ScannerBase.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java ScannerBase.iterator方法的具体用法?Java ScannerBase.iterator怎么用?Java ScannerBase.iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.client.ScannerBase
的用法示例。
在下文中一共展示了ScannerBase.iterator方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: closeableIterable
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
/**
* Converts a {@link ScannerBase} into a {@link CloseableIterable}
*/
public static CloseableIterable<Entry<Key, Value>> closeableIterable(final ScannerBase scanner) {
checkNotNull(scanner);
return new FluentCloseableIterable<Entry<Key, Value>>() {
@Override
protected void doClose() throws IOException {
if (scanner instanceof BatchScanner)
((BatchScanner) scanner).close();
}
@Override
protected Iterator<Entry<Key, Value>> retrieveIterator() {
return scanner.iterator();
}
};
}
示例2: initIterator
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
@Override
protected Iterator initIterator(
final AdapterStore adapterStore,
final ScannerBase scanner ) {
if (isAggregation()) {
// aggregate the stats to a single value here
try {
final Iterator<Entry<Key, Value>> it = scanner.iterator();
Mergeable mergedAggregationResult = null;
if (!it.hasNext()) {
return Iterators.emptyIterator();
}
else {
while (it.hasNext()) {
final Entry<Key, Value> input = it.next();
if (input.getValue() != null) {
if (mergedAggregationResult == null) {
mergedAggregationResult = (Mergeable) AccumuloUtils.fromBinary(input.getValue().get());
}
else {
mergedAggregationResult.merge((Mergeable) AccumuloUtils.fromBinary(input
.getValue()
.get()));
}
}
}
}
return Iterators.singletonIterator(mergedAggregationResult);
}
finally {
scanner.close();
}
}
else {
return super.initIterator(
adapterStore,
scanner);
}
}
示例3: initIterator
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
@Override
protected Iterator initIterator(
final AdapterStore adapterStore,
final ScannerBase scanner ) {
return new InputFormatIteratorWrapper(
useWholeRowIterator(),
adapterStore,
index,
scanner.iterator(),
isOutputWritable,
clientFilters.isEmpty() ? null : clientFilters.size() == 1 ? clientFilters.get(0)
: new FilterList<QueryFilter>(
clientFilters));
}
示例4: initIterator
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
protected Iterator initIterator(
final AdapterStore adapterStore,
final ScannerBase scanner ) {
return new AccumuloEntryIteratorWrapper(
useWholeRowIterator(),
adapterStore,
index,
scanner.iterator(),
null,
scanCallback);
}
示例5: initIterator
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
protected Iterator initIterator(
final AdapterStore adapterStore,
final ScannerBase scanner ) {
return new AccumuloEntryIteratorWrapper(
useWholeRowIterator(),
adapterStore,
index,
scanner.iterator(),
clientFilters.isEmpty() ? null : clientFilters.size() == 1 ? clientFilters.get(0)
: new FilterList<QueryFilter>(
clientFilters),
scanCallback);
}
示例6: getIterator
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
private static CloseableIterator<Entry<Key, Value>> getIterator(
final Connector connector,
final String namespace,
final PrimaryIndex index )
throws AccumuloException,
AccumuloSecurityException,
IOException,
TableNotFoundException {
CloseableIterator<Entry<Key, Value>> iterator = null;
final AccumuloOperations operations = new BasicAccumuloOperations(
connector,
namespace);
final AccumuloIndexStore indexStore = new AccumuloIndexStore(
operations);
final AccumuloAdapterStore adapterStore = new AccumuloAdapterStore(
operations);
if (indexStore.indexExists(index.getId())) {
final ScannerBase scanner = operations.createBatchScanner(index.getId().getString());
((BatchScanner) scanner).setRanges(AccumuloUtils.byteArrayRangesToAccumuloRanges(null));
final IteratorSetting iteratorSettings = new IteratorSetting(
10,
"GEOWAVE_WHOLE_ROW_ITERATOR",
WholeRowIterator.class);
scanner.addScanIterator(iteratorSettings);
final Iterator<Entry<Key, Value>> it = new IteratorWrapper(
adapterStore,
index,
scanner.iterator(),
new DedupeFilter());
iterator = new CloseableIteratorWrapper<Entry<Key, Value>>(
new ScannerClosableWrapper(
scanner),
it);
}
return iterator;
}
示例7: ConstrainedIteratorWrapper
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
ConstrainedIteratorWrapper(final ScannerBase scanner) {
this.scanner = scanner;
i=scanner.iterator();
}
示例8: getEntryRows
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
@SuppressFBWarnings(value = "DLS_DEAD_LOCAL_STORE", justification = "i is part of loop condition")
@Override
protected CloseableIterator<Object> getEntryRows(
final PrimaryIndex index,
final AdapterStore adapterStore,
final List<ByteArrayId> dataIds,
final DataAdapter<?> adapter,
final ScanCallback<Object> scanCallback,
final DedupeFilter dedupeFilter,
final String[] authorizations,
final boolean delete ) {
try {
final ScannerBase scanner = accumuloOperations.createScanner(
index.getId().getString(),
authorizations);
final DifferingFieldVisibilityEntryCount visibilityCount = DifferingFieldVisibilityEntryCount
.getVisibilityCounts(
index,
Collections.singletonList(adapter.getAdapterId()),
statisticsStore,
authorizations);
scanner.fetchColumnFamily(new Text(
adapter.getAdapterId().getBytes()));
if (visibilityCount.isAnyEntryDifferingFieldVisiblity()) {
final IteratorSetting rowIteratorSettings = new IteratorSetting(
SingleEntryFilterIterator.WHOLE_ROW_ITERATOR_PRIORITY,
SingleEntryFilterIterator.WHOLE_ROW_ITERATOR_NAME,
WholeRowIterator.class);
scanner.addScanIterator(rowIteratorSettings);
}
final IteratorSetting filterIteratorSettings = new IteratorSetting(
SingleEntryFilterIterator.ENTRY_FILTER_ITERATOR_PRIORITY,
SingleEntryFilterIterator.ENTRY_FILTER_ITERATOR_NAME,
SingleEntryFilterIterator.class);
filterIteratorSettings.addOption(
SingleEntryFilterIterator.ADAPTER_ID,
ByteArrayUtils.byteArrayToString(adapter.getAdapterId().getBytes()));
filterIteratorSettings.addOption(
SingleEntryFilterIterator.WHOLE_ROW_ENCODED_KEY,
Boolean.toString(visibilityCount.isAnyEntryDifferingFieldVisiblity()));
filterIteratorSettings.addOption(
SingleEntryFilterIterator.DATA_IDS,
SingleEntryFilterIterator.encodeIDs(dataIds));
scanner.addScanIterator(filterIteratorSettings);
return new CloseableIteratorWrapper<Object>(
new ScannerClosableWrapper(
scanner),
new AccumuloEntryIteratorWrapper(
visibilityCount.isAnyEntryDifferingFieldVisiblity(),
adapterStore,
index,
scanner.iterator(),
dedupeFilter,
scanCallback));
}
catch (final TableNotFoundException e) {
LOGGER.warn(
"Unable to query table '" + index.getId().getString() + "'. Table does not exist.",
e);
}
return null;
}
示例9: AbstractAccumuloIterator
import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
/**
*
*/
public AbstractAccumuloIterator(ScannerBase sc) {
this.sc = sc;
this.iter = sc.iterator();
}