public class MultithreadedItemMappingIterator<F extends Item<?>,T extends Item<?>> extends ItemMappingIterator<F,T>
ATOMIZING, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD| Constructor and Description |
|---|
MultithreadedItemMappingIterator(SequenceIterator<F> base,
ItemMappingFunction<F,T> action) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
The user of a
SequenceIterator is encouraged to call the close() method if
no further items are required from the sequence of items delivered by the SequenceIterator. |
protected int |
getMaxThreads()
Overridable method that decides how many threads to use.
|
protected java.util.concurrent.ExecutorService |
makeExecutorService(int maxThreads)
Overridable method to create an
ExecutorService with a given concurrency |
T |
next()
Get the next item in the sequence.
|
getBaseIterator, getLength, getMappingFunction, getProperties, hasNext, isOneToOne, setOneToOneclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachOrFail, materializepublic MultithreadedItemMappingIterator(SequenceIterator<F> base, ItemMappingFunction<F,T> action) throws XPathException
XPathExceptionprotected int getMaxThreads()
Runtime.getRuntime().availableProcessors(), or 1 if greater.protected java.util.concurrent.ExecutorService makeExecutorService(int maxThreads)
ExecutorService with a given concurrencymaxThreads - the maximum number of threads to be usedExecutorServicepublic T next() throws XPathException
SequenceIteratornext in interface SequenceIterator<T extends Item<?>>next in class ItemMappingIterator<F extends Item<?>,T extends Item<?>>XPathException - if an error occurs retrieving the next itempublic void close()
SequenceIterator is encouraged to call the close() method if
no further items are required from the sequence of items delivered by the SequenceIterator.
This allows resources to be released. A SequenceIterator is NOT normally closed explicitly
if it has been read to completion. This implementation of the close() method shuts down
the ExecutorService used to schedule threads.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface SequenceIterator<T extends Item<?>>close in class ItemMappingIterator<F extends Item<?>,T extends Item<?>>Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.