/** * Extension point for subclasses that want to store additional data in the * inputs. Default just checks if inputs are empty. * * @param inputs the input chunk * @return true if it is empty * * @see #initializeUserData(Chunk) */ protected boolean isComplete(Chunk<I> inputs) { return inputs.isEmpty(); }
@Override protected boolean isComplete(Chunk<I> inputs) { /* * Need to remember the write skips across transactions, otherwise they * keep coming back. Since we register skips with the inputs they will * not be processed again but the output skips need to be saved for * registration later with the listeners. The inputs are going to be the * same for all transactions processing the same chunk, but the outputs * are not, so we stash them in user data on the inputs. */ @SuppressWarnings("unchecked") UserData<O> data = (UserData<O>) inputs.getUserData(); Chunk<O> previous = data.getOutputs(); return inputs.isEmpty() && previous.getSkips().isEmpty(); }
final UserData<O> data = (UserData<O>) inputs.getUserData(); final Chunk<O> cache = data.getOutputs(); final Iterator<O> cacheIterator = cache.isEmpty() ? null : new ArrayList<>(cache.getItems()).iterator(); final AtomicInteger count = new AtomicInteger(0);
/** * Extension point for subclasses that want to store additional data in the * inputs. Default just checks if inputs are empty. * * @param inputs the input chunk * @return true if it is empty * * @see #initializeUserData(Chunk) */ protected boolean isComplete(Chunk<I> inputs) { return inputs.isEmpty(); }
/** * Extension point for subclasses that want to store additional data in the * inputs. Default just checks if inputs are empty. * * @param inputs the input chunk * @return true if it is empty * * @see #initializeUserData(Chunk) */ protected boolean isComplete(Chunk<I> inputs) { return inputs.isEmpty(); }
/** * Extension point for subclasses that want to store additional data in the * inputs. Default just checks if inputs are empty. * * @param inputs the input chunk * @return true if it is empty * * @see #initializeUserData(Chunk) */ protected boolean isComplete(Chunk<I> inputs) { return inputs.isEmpty(); }
/** * Extension point for subclasses that want to store additional data in the * inputs. Default just checks if inputs are empty. * * @param inputs the input chunk * @return true if it is empty * * @see #initializeUserData(Chunk) */ protected boolean isComplete(Chunk<I> inputs) { return inputs.isEmpty(); }
@Override protected boolean isComplete(Chunk<I> inputs) { /* * Need to remember the write skips across transactions, otherwise they * keep coming back. Since we register skips with the inputs they will * not be processed again but the output skips need to be saved for * registration later with the listeners. The inputs are going to be the * same for all transactions processing the same chunk, but the outputs * are not, so we stash them in user data on the inputs. */ @SuppressWarnings("unchecked") UserData<O> data = (UserData<O>) inputs.getUserData(); Chunk<O> previous = data.getOutputs(); return inputs.isEmpty() && previous.getSkips().isEmpty(); }
@Override protected boolean isComplete(Chunk<I> inputs) { /* * Need to remember the write skips across transactions, otherwise they * keep coming back. Since we register skips with the inputs they will * not be processed again but the output skips need to be saved for * registration later with the listeners. The inputs are going to be the * same for all transactions processing the same chunk, but the outputs * are not, so we stash them in user data on the inputs. */ @SuppressWarnings("unchecked") UserData<O> data = (UserData<O>) inputs.getUserData(); Chunk<O> previous = data.getOutputs(); return inputs.isEmpty() && previous.getSkips().isEmpty(); }
@Override protected boolean isComplete(Chunk<I> inputs) { /* * Need to remember the write skips across transactions, otherwise they * keep coming back. Since we register skips with the inputs they will * not be processed again but the output skips need to be saved for * registration later with the listeners. The inputs are going to be the * same for all transactions processing the same chunk, but the outputs * are not, so we stash them in user data on the inputs. */ @SuppressWarnings("unchecked") UserData<O> data = (UserData<O>) inputs.getUserData(); Chunk<O> previous = data.getOutputs(); return inputs.isEmpty() && previous.getSkips().isEmpty(); }
@Override protected boolean isComplete(Chunk<I> inputs) { /* * Need to remember the write skips across transactions, otherwise they * keep coming back. Since we register skips with the inputs they will * not be processed again but the output skips need to be saved for * registration later with the listeners. The inputs are going to be the * same for all transactions processing the same chunk, but the outputs * are not, so we stash them in user data on the inputs. */ @SuppressWarnings("unchecked") UserData<O> data = (UserData<O>) inputs.getUserData(); Chunk<O> previous = data.getOutputs(); return inputs.isEmpty() && previous.getSkips().isEmpty(); }
final UserData<O> data = (UserData<O>) inputs.getUserData(); final Chunk<O> cache = data.getOutputs(); final Iterator<O> cacheIterator = cache.isEmpty() ? null : new ArrayList<O>(cache.getItems()).iterator(); final AtomicInteger count = new AtomicInteger(0);
final UserData<O> data = (UserData<O>) inputs.getUserData(); final Chunk<O> cache = data.getOutputs(); final Iterator<O> cacheIterator = cache.isEmpty() ? null : new ArrayList<O>(cache.getItems()).iterator(); final AtomicInteger count = new AtomicInteger(0);
final UserData<O> data = (UserData<O>) inputs.getUserData(); final Chunk<O> cache = data.getOutputs(); final Iterator<O> cacheIterator = cache.isEmpty() ? null : new ArrayList<O>(cache.getItems()).iterator(); final AtomicInteger count = new AtomicInteger(0);
final UserData<O> data = (UserData<O>) inputs.getUserData(); final Chunk<O> cache = data.getOutputs(); final Iterator<O> cacheIterator = cache.isEmpty() ? null : new ArrayList<O>(cache.getItems()).iterator(); final AtomicInteger count = new AtomicInteger(0);