Interface MutableRecordStream<K extends Comparable<K>>
- All Superinterfaces:
AutoCloseable,BaseStream<Record<K>,,Stream<Record<K>>> RecordStream<K>,Stream<Record<K>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T extends Object> -
Method Summary
Modifier and TypeMethodDescriptionbatch(int sizeHint) Returns an equivalent stream that uses the given batch size hint.voiddelete()Deletes everyRecordin the stream.Deletes everyRecordin the stream.distinct()Observes the stream pipeline and provides the pre-execution analysis information for this stream pipeline.inline()Returns an equivalent stream where any client side operations are performed inline with the server side.limit(long maxSize) voidmutate(UpdateOperation<? super K> transform) Performs an update transformation against theRecords in the stream.mutateThen(UpdateOperation<? super K> transform) Performs an update transformation against theRecords in the stream.parallel()skip(long n) sorted()sorted(Comparator<? super Record<K>> comparator) Returns aRecordStream<K>consisting of the elements of this stream, sorted according to the providedComparator.Methods inherited from interface java.util.stream.BaseStream
close, isParallel, iterator, spliteratorMethods inherited from interface java.util.stream.Stream
allMatch, anyMatch, collect, collect, count, dropWhile, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEachOrdered, map, mapMulti, mapMultiToDouble, mapMultiToInt, mapMultiToLong, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, reduce, reduce, reduce, takeWhile, toArray, toArray, toList
-
Method Details
-
mutate
Performs an update transformation against theRecords in the stream.This is a terminal operation.
- Parameters:
transform- the transformation to perform
-
mutateThen
Performs an update transformation against theRecords in the stream.This is an intermediate operation.
- Parameters:
transform- the transformation to perform- Returns:
- a
Streamof newTuples holding before and afterRecordinstances
-
delete
void delete()Deletes everyRecordin the stream.This is a terminal operation.
-
deleteThen
Deletes everyRecordin the stream.This is an intermediate operation.
- Returns:
- a
Streamof the deletedRecords
-
filter
- Specified by:
filterin interfaceRecordStream<K extends Comparable<K>>- Specified by:
filterin interfaceStream<K extends Comparable<K>>
-
distinct
MutableRecordStream<K> distinct()Description copied from interface:RecordStreamRecord streams are distinct by definition since they represent the records found within a dataset. Implementations may therefore choose to elide distinct operations from the pipeline.
- Specified by:
distinctin interfaceRecordStream<K extends Comparable<K>>- Specified by:
distinctin interfaceStream<K extends Comparable<K>>- Returns:
- a distinct stream (possibly the same stream)
-
sorted
RecordStream<K> sorted()This method will throw ajava.lang.UnsupportedOperationExceptionsincerecordsare notComparable.Sorting a
MutableRecordStreamreturns a non-mutableRecordStream.- Specified by:
sortedin interfaceRecordStream<K extends Comparable<K>>- Specified by:
sortedin interfaceStream<K extends Comparable<K>>- Returns:
- a new, non-mutable
RecordStream - See Also:
-
sorted
Returns aRecordStream<K>consisting of the elements of this stream, sorted according to the providedComparator.Following are the ways to get a
RecordStream<K>withrecordssorted by the key or sorted by the value of a cell.RecordStream<String> keySortedRecordStream = recordStream.sorted(Record.<K>keyFunction().asComparator()); RecordStream<String> cellSortedRecordStream = recordStream.sorted(NAME.valueOr("").asComparator());Sorting a
MutableRecordStreamreturns a non-mutableRecordStream.- Specified by:
sortedin interfaceRecordStream<K extends Comparable<K>>- Specified by:
sortedin interfaceStream<K extends Comparable<K>>- Parameters:
comparator- used to compareRecords in the stream- Returns:
- a new, non-mutable
RecordStream
-
peek
- Specified by:
peekin interfaceRecordStream<K extends Comparable<K>>- Specified by:
peekin interfaceStream<K extends Comparable<K>>
-
limit
- Specified by:
limitin interfaceRecordStream<K extends Comparable<K>>- Specified by:
limitin interfaceStream<K extends Comparable<K>>
-
skip
- Specified by:
skipin interfaceRecordStream<K extends Comparable<K>>- Specified by:
skipin interfaceStream<K extends Comparable<K>>
-
sequential
MutableRecordStream<K> sequential()- Specified by:
sequentialin interfaceBaseStream<Record<K extends Comparable<K>>,Stream<Record<K extends Comparable<K>>>> - Specified by:
sequentialin interfaceRecordStream<K extends Comparable<K>>
-
parallel
MutableRecordStream<K> parallel()- Specified by:
parallelin interfaceBaseStream<Record<K extends Comparable<K>>,Stream<Record<K extends Comparable<K>>>> - Specified by:
parallelin interfaceRecordStream<K extends Comparable<K>>
-
unordered
MutableRecordStream<K> unordered()- Specified by:
unorderedin interfaceBaseStream<Record<K extends Comparable<K>>,Stream<Record<K extends Comparable<K>>>> - Specified by:
unorderedin interfaceRecordStream<K extends Comparable<K>>
-
onClose
- Specified by:
onClosein interfaceBaseStream<Record<K extends Comparable<K>>,Stream<Record<K extends Comparable<K>>>> - Specified by:
onClosein interfaceRecordStream<K extends Comparable<K>>
-
explain
Description copied from interface:RecordStreamObserves the stream pipeline and provides the pre-execution analysis information for this stream pipeline.A typical sample usage is given below.
try (RecordStream<String> testStream = dataset.records()) { long count = testStream.explain(System.out::println).filter(...).count(); }Implementations may not call the consumer until after the stream has closed. Care must therefore be taken to avoid deadlocking stream processing by blocking the stream on waiting for the consumer to be called.
- Specified by:
explainin interfaceRecordStream<K extends Comparable<K>>- Parameters:
consumer-Consumerthat is passed an explanation of the stream execution plan- Returns:
- this
RecordStream<K>
-
batch
Description copied from interface:RecordStreamReturns an equivalent stream that uses the given batch size hint.Stream executions will attempt (when possible) to optimize execution by transferring multiple elements over the network at one time. The size hint provided here will be used as a hint to the batch sizes to use when transferring elements.
- Specified by:
batchin interfaceRecordStream<K extends Comparable<K>>- Returns:
- this
RecordStream<K>
-
inline
MutableRecordStream<K> inline()Description copied from interface:RecordStreamReturns an equivalent stream where any client side operations are performed inline with the server side.Inline execution runs the client side portion of a pipeline synchronously during the server side processing. This means that until the client side portion of the stream pipeline has finished executing the server stream will not advance to process the next element.
Unlike
RecordStream.batch(int)this operation is an edict and not a hint. This means marking a stream as inline overrides any previous or future batching instruction.- Specified by:
inlinein interfaceRecordStream<K extends Comparable<K>>- Returns:
- this
RecordStream<K> - See Also:
-