S
- The type of the elements in this collectionpublic interface LCollection<S>
PCollection
interface, allowing distributed operations to be expressed in
terms of lambda expressions and method references, instead of creating a new class implementation for each operation.Modifier and Type | Method and Description |
---|---|
default <K> LTable<K,S> |
by(SFunction<S,K> extractFn,
PType<K> pType)
Key this LCollection by a key extracted from the element to yield a
LTable mapping the key to the whole
element. |
default LCollection<S> |
cache()
Cache the underlying
PCollection |
default LCollection<S> |
cache(CachingOptions options)
Cache the underlying
PCollection |
default LTable<S,Long> |
count()
Count distict values in this LCollection, yielding an
LTable mapping each value to the number
of occurrences in the collection. |
LCollectionFactory |
factory()
Get the
LCollectionFactory which can be used to create new Ltype instances |
default LCollection<S> |
filter(SPredicate<S> predicate)
Filter the collection using the supplied predicate.
|
default <K,V> LTable<K,V> |
filterMap(SFunction<S,Optional<Pair<K,V>>> fn,
PTableType<K,V> pType)
Combination of a filter and map operation by using a function with
Optional return type. |
default <T> LCollection<T> |
filterMap(SFunction<S,Optional<T>> fn,
PType<T> pType)
Combination of a filter and map operation by using a function with
Optional return type. |
default <K,V> LTable<K,V> |
flatMap(SFunction<S,java.util.stream.Stream<Pair<K,V>>> fn,
PTableType<K,V> pType)
Map each element to zero or more output elements using the provided stream-returning function to yield an
LTable |
default <T> LCollection<T> |
flatMap(SFunction<S,java.util.stream.Stream<T>> fn,
PType<T> pType)
Map each element to zero or more output elements using the provided stream-returning function.
|
default LCollection<S> |
increment(Enum<?> counter)
Increment a counter for every element in the collection
|
default LCollection<S> |
increment(String counterGroup,
String counterName)
Increment a counter for every element in the collection
|
default LCollection<S> |
incrementIf(Enum<?> counter,
SPredicate<S> condition)
Increment a counter for every element satisfying the conditional predicate supplied.
|
default LCollection<S> |
incrementIf(String counterGroup,
String counterName,
SPredicate<S> condition)
Increment a counter for every element satisfying the conditional predicate supplied.
|
default <K,V> LTable<K,V> |
map(SFunction<S,Pair<K,V>> fn,
PTableType<K,V> pType)
Map the elements of this collection 1-1 through the supplied function to yield an
LTable |
default <T> LCollection<T> |
map(SFunction<S,T> fn,
PType<T> pType)
Map the elements of this collection 1-1 through the supplied function.
|
default java.util.stream.Stream<S> |
materialize()
Obtain the contents of this LCollection as a
Stream that can be processed locally. |
default <K,V> LTable<K,V> |
parallelDo(DoFn<S,Pair<K,V>> fn,
PTableType<K,V> pType)
|
default <T> LCollection<T> |
parallelDo(DoFn<S,T> fn,
PType<T> pType)
Transform this LCollection using a standard Crunch
DoFn |
default <K,V> LTable<K,V> |
parallelDo(LDoFn<S,Pair<K,V>> fn,
PTableType<K,V> pType)
Transform this LCollection using a Lambda-friendly
LDoFn . |
default <T> LCollection<T> |
parallelDo(LDoFn<S,T> fn,
PType<T> pType)
Transform this LCollection using a Lambda-friendly
LDoFn . |
default PTypeFamily |
ptf()
Get the
PTypeFamily representing how elements of this collection may be serialized. |
default PType<S> |
pType()
Get the
PType representing how elements of this collection may be serialized. |
PCollection<S> |
underlying()
Get the underlying
PCollection for this LCollection |
default LCollection<S> |
union(LCollection<S> other)
Union this LCollection with another LCollection of the same type
|
default LCollection<S> |
union(PCollection<S> other)
Union this LCollection with a
PCollection of the same type |
default LCollection<S> |
write(Target target)
Write this collection to the specified
Target |
default LCollection<S> |
write(Target target,
Target.WriteMode writeMode)
Write this collection to the specified
Target with the given Target.WriteMode |
PCollection<S> underlying()
PCollection
for this LCollectionLCollectionFactory factory()
LCollectionFactory
which can be used to create new Ltype instancesdefault <T> LCollection<T> parallelDo(DoFn<S,T> fn, PType<T> pType)
DoFn
default <K,V> LTable<K,V> parallelDo(DoFn<S,Pair<K,V>> fn, PTableType<K,V> pType)
default <T> LCollection<T> parallelDo(LDoFn<S,T> fn, PType<T> pType)
LDoFn
.default <K,V> LTable<K,V> parallelDo(LDoFn<S,Pair<K,V>> fn, PTableType<K,V> pType)
LDoFn
.default <T> LCollection<T> map(SFunction<S,T> fn, PType<T> pType)
default <K,V> LTable<K,V> map(SFunction<S,Pair<K,V>> fn, PTableType<K,V> pType)
LTable
default <T> LCollection<T> flatMap(SFunction<S,java.util.stream.Stream<T>> fn, PType<T> pType)
default <K,V> LTable<K,V> flatMap(SFunction<S,java.util.stream.Stream<Pair<K,V>>> fn, PTableType<K,V> pType)
LTable
default <T> LCollection<T> filterMap(SFunction<S,Optional<T>> fn, PType<T> pType)
Optional
return type.default <K,V> LTable<K,V> filterMap(SFunction<S,Optional<Pair<K,V>>> fn, PTableType<K,V> pType)
Optional
return type.default LCollection<S> filter(SPredicate<S> predicate)
default LCollection<S> union(LCollection<S> other)
default LCollection<S> union(PCollection<S> other)
PCollection
of the same typedefault LCollection<S> increment(Enum<?> counter)
default LCollection<S> increment(String counterGroup, String counterName)
default LCollection<S> incrementIf(Enum<?> counter, SPredicate<S> condition)
default LCollection<S> incrementIf(String counterGroup, String counterName, SPredicate<S> condition)
default LCollection<S> cache()
PCollection
default LCollection<S> cache(CachingOptions options)
PCollection
default <K> LTable<K,S> by(SFunction<S,K> extractFn, PType<K> pType)
LTable
mapping the key to the whole
element.default LTable<S,Long> count()
LTable
mapping each value to the number
of occurrences in the collection.default java.util.stream.Stream<S> materialize()
Stream
that can be processed locally. Note, this may trigger
your job to execute in a distributed environment if the pipeline has not yet been run.default PTypeFamily ptf()
PTypeFamily
representing how elements of this collection may be serialized.default PType<S> pType()
PType
representing how elements of this collection may be serialized.default LCollection<S> write(Target target)
Target
default LCollection<S> write(Target target, Target.WriteMode writeMode)
Target
with the given Target.WriteMode
Copyright © 2016 The Apache Software Foundation. All rights reserved.