当前位置: 首页>>代码示例>>Java>>正文


Java ScannerBase.iterator方法代码示例

本文整理汇总了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();
        }
    };
}
 
开发者ID:calrissian,项目名称:accumulo-recipes,代码行数:19,代码来源:Scanners.java

示例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);
	}
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:41,代码来源:AccumuloConstraintsQuery.java

示例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));
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:15,代码来源:InputFormatAccumuloRangeQuery.java

示例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);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:12,代码来源:AbstractAccumuloRowQuery.java

示例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);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:14,代码来源:AccumuloFilteredIndexQuery.java

示例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;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:40,代码来源:AccumuloUtils.java

示例7: ConstrainedIteratorWrapper

import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
ConstrainedIteratorWrapper(final ScannerBase scanner) {
    this.scanner = scanner;
    i=scanner.iterator();
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:5,代码来源:AccumuloTemporalIndexer.java

示例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;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:71,代码来源:AccumuloDataStore.java

示例9: AbstractAccumuloIterator

import org.apache.accumulo.core.client.ScannerBase; //导入方法依赖的package包/类
/**
 * 
 */
public AbstractAccumuloIterator(ScannerBase sc) {
  this.sc = sc;
  this.iter = sc.iterator();
}
 
开发者ID:hltcoe,项目名称:rebar,代码行数:8,代码来源:AbstractAccumuloIterator.java


注:本文中的org.apache.accumulo.core.client.ScannerBase.iterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。