public class TupleEntryStream extends java.lang.Object
TupleEntry
Stream
instances from
Tap
instances.
This class is a convenience class over the methods provided on the Tap class that provide the same functionality. This class exists to help overcome any generics compiler warnings.
Note, the returned Stream instance must be closed in order to clean up underlying resources. This is simply accomplished with a try-with-resources statement.
Constructor and Description |
---|
TupleEntryStream() |
Modifier and Type | Method and Description |
---|---|
static java.util.stream.Stream<TupleEntry> |
entryStream(Tap tap,
FlowProcess flowProcess)
|
static java.util.stream.Stream<TupleEntry> |
entryStream(Tap tap,
FlowProcess flowProcess,
Fields selector)
|
static java.util.stream.Stream<TupleEntry> |
entryStreamCopy(Tap tap,
FlowProcess flowProcess)
|
static java.util.stream.Stream<TupleEntry> |
entryStreamCopy(Tap tap,
FlowProcess flowProcess,
Fields selector)
|
static java.util.function.ToDoubleFunction<TupleEntry> |
fieldToDouble(java.lang.Comparable name)
Method fieldToDouble returns a
Function that returns the double in the given named field or position. |
static java.util.function.ToDoubleFunction<TupleEntry> |
fieldToDouble(Fields fields)
Method fieldToDouble returns a
Function that returns the double in the given named field or position. |
static java.util.function.ToIntFunction<TupleEntry> |
fieldToInt(java.lang.Comparable name)
Method fieldToInt returns a
Function that returns the int in the given named field or position. |
static java.util.function.ToIntFunction<TupleEntry> |
fieldToInt(Fields fields)
Method fieldToInt returns a
Function that returns the int in the given named field or position. |
static java.util.function.ToLongFunction<TupleEntry> |
fieldToLong(java.lang.Comparable name)
Method fieldToLong returns a
Function that returns the long in the given named field or position. |
static java.util.function.ToLongFunction<TupleEntry> |
fieldToLong(Fields fields)
Method fieldToLong returns a
Function that returns the long in the given named field or position. |
static <R> java.util.function.Function<TupleEntry,? extends R> |
fieldToObject(Fields fields)
Method fieldToObject returns a
Function that returns the object in the given named field or position. |
static <R> java.util.function.Function<TupleEntry,R> |
fieldToObject(Fields fields,
java.lang.Class<R> type)
Method fieldToObject returns a
Function that returns the object in the given named field or position
coerced to the requested Class . |
static <R> java.util.function.Function<TupleEntry,R> |
fieldToObject(Fields fields,
CoercibleType<R> type)
Method fieldToObject returns a
Function that returns the object in the given named field or position
coerced to the requested CoercibleType type. |
static Tap |
writeEntry(java.lang.Iterable<TupleEntry> iterable,
java.util.function.Supplier<Tap> into,
FlowProcess flowProcess)
Method writeEntry will add each
TupleEntry instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeEntry(java.lang.Iterable<TupleEntry> iterable,
Tap into,
FlowProcess flowProcess)
Method writeEntry will add each
TupleEntry instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeEntry(java.util.stream.Stream<TupleEntry> stream,
java.util.function.Supplier<Tap> into,
FlowProcess flowProcess)
Method writeEntry will add each
TupleEntry instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeEntry(java.util.stream.Stream<TupleEntry> stream,
Tap into,
FlowProcess flowProcess)
Method writeEntry will add each
TupleEntry instance to the TupleEntryCollector provided
by the given Tap instance. |
public TupleEntryStream()
public static java.util.stream.Stream<TupleEntry> entryStream(Tap tap, FlowProcess flowProcess)
Stream
of TupleEntry
instances from the given
Tap
instance.
Also see Tap.entryStream(FlowProcess)
.
Note, the returned Stream instance must be closed in order to clean up underlying resources. This is simply accomplished with a try-with-resources statement.
tap
- the Tap to openflowProcess
- represents the current platform configurationpublic static java.util.stream.Stream<TupleEntry> entryStreamCopy(Tap tap, FlowProcess flowProcess)
Stream
of TupleEntry
instances from the given
Tap
instance.
This method returns an TupleEntry instance suitable for caching.
Also see Tap.entryStreamCopy(FlowProcess)
.
Note, the returned Stream instance must be closed in order to clean up underlying resources. This is simply accomplished with a try-with-resources statement.
tap
- the Tap to openflowProcess
- represents the current platform configurationpublic static java.util.stream.Stream<TupleEntry> entryStream(Tap tap, FlowProcess flowProcess, Fields selector)
Stream
of TupleEntry
instances from the given
Tap
instance.
Also see Tap.entryStream(FlowProcess, Fields)
.
Note, the returned Stream instance must be closed in order to clean up underlying resources. This is simply accomplished with a try-with-resources statement.
tap
- the Tap to openflowProcess
- represents the current platform configurationselector
- the fields to select from the underlying TupleEntrypublic static java.util.stream.Stream<TupleEntry> entryStreamCopy(Tap tap, FlowProcess flowProcess, Fields selector)
Stream
of TupleEntry
instances from the given
Tap
instance.
This method returns an TupleEntry instance suitable for caching.
Also see Tap.entryStreamCopy(FlowProcess)
.
Note, the returned Stream instance must be closed in order to clean up underlying resources. This is simply accomplished with a try-with-resources statement.
tap
- the Tap to openflowProcess
- represents the current platform configurationselector
- the fields to select from the underlying TupleEntrypublic static <R> java.util.function.Function<TupleEntry,? extends R> fieldToObject(Fields fields)
Function
that returns the object in the given named field or position.R
- the type of the object returnedfields
- the field to select, only first field will be honoredpublic static <R> java.util.function.Function<TupleEntry,R> fieldToObject(Fields fields, CoercibleType<R> type)
Function
that returns the object in the given named field or position
coerced to the requested CoercibleType
type.R
- the type of the object returnedfields
- the field to select, only first field will be honoredtype
- the CoercibleType to coerce the selected value intopublic static <R> java.util.function.Function<TupleEntry,R> fieldToObject(Fields fields, java.lang.Class<R> type)
Function
that returns the object in the given named field or position
coerced to the requested Class
.R
- the type of the object returnedfields
- the field to select, only first field will be honoredtype
- the Class to coerce the selected value intopublic static java.util.function.ToIntFunction<TupleEntry> fieldToInt(Fields fields)
Function
that returns the int in the given named field or position.fields
- the field to select, only first field will be honoredpublic static java.util.function.ToIntFunction<TupleEntry> fieldToInt(java.lang.Comparable name)
Function
that returns the int in the given named field or position.name
- the field to selectpublic static java.util.function.ToLongFunction<TupleEntry> fieldToLong(Fields fields)
Function
that returns the long in the given named field or position.fields
- the field to select, only first field will be honoredpublic static java.util.function.ToLongFunction<TupleEntry> fieldToLong(java.lang.Comparable name)
Function
that returns the long in the given named field or position.name
- the field to selectpublic static java.util.function.ToDoubleFunction<TupleEntry> fieldToDouble(Fields fields)
Function
that returns the double in the given named field or position.fields
- the field to select, only first field will be honoredpublic static java.util.function.ToDoubleFunction<TupleEntry> fieldToDouble(java.lang.Comparable name)
Function
that returns the double in the given named field or position.name
- the field to selectpublic static Tap writeEntry(java.util.stream.Stream<TupleEntry> stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)
TupleEntry
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of TupleEntry instancesinto
- a Supplier that returns the Tap to sink each entry intoflowProcess
- represents the current platform configurationpublic static Tap writeEntry(java.util.stream.Stream<TupleEntry> stream, Tap into, FlowProcess flowProcess)
TupleEntry
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of TupleEntry instancesinto
- the Tap to sink each entry intoflowProcess
- represents the current platform configurationpublic static Tap writeEntry(java.lang.Iterable<TupleEntry> iterable, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)
TupleEntry
instance to the TupleEntryCollector
provided
by the given Tap
instance.iterable
- an Iterable of TupleEntry instancesinto
- a Supplier that returns the Tap to sink each entry intoflowProcess
- represents the current platform configurationpublic static Tap writeEntry(java.lang.Iterable<TupleEntry> iterable, Tap into, FlowProcess flowProcess)
TupleEntry
instance to the TupleEntryCollector
provided
by the given Tap
instance.iterable
- an Iterable of TupleEntry instancesinto
- the Tap to sink each entry intoflowProcess
- represents the current platform configurationCopyright © 2007-2017 Cascading Maintainers. All Rights Reserved.