public class TupleStream extends java.lang.Object
Tuple
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 |
---|
TupleStream() |
Modifier and Type | Method and Description |
---|---|
static java.util.function.ToDoubleFunction<Tuple> |
posToDouble(int pos)
Method posToDouble returns the double value at the given tuple position.
|
static java.util.function.ToIntFunction<Tuple> |
posToInt(int pos)
Method posToInt returns the int value at the given tuple position.
|
static java.util.function.ToLongFunction<Tuple> |
posToLong(int pos)
Method posToLong returns the long value at the given tuple position.
|
static <R> java.util.function.Function<Tuple,? extends R> |
posToObject(int pos)
Method posToObject returns the object at the given tuple position.
|
static java.util.stream.Stream<Tuple> |
tupleStream(Tap tap,
FlowProcess flowProcess)
|
static java.util.stream.Stream<Tuple> |
tupleStream(Tap tap,
FlowProcess flowProcess,
Fields selector)
|
static java.util.stream.Stream<Tuple> |
tupleStreamCopy(Tap tap,
FlowProcess flowProcess)
|
static java.util.stream.Stream<Tuple> |
tupleStreamCopy(Tap tap,
FlowProcess flowProcess,
Fields selector)
|
static Tap |
writeDouble(java.util.stream.DoubleStream stream,
java.util.function.Supplier<Tap> into,
FlowProcess flowProcess)
Method writeDouble will add each
double instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeDouble(java.util.stream.DoubleStream stream,
Tap into,
FlowProcess flowProcess)
Method writeDouble will add each
double instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeInt(java.util.stream.IntStream stream,
java.util.function.Supplier<Tap> into,
FlowProcess flowProcess)
Method writeInt will add each
int instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeInt(java.util.stream.IntStream stream,
Tap into,
FlowProcess flowProcess)
Method writeInt will add each
int instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeLong(java.util.stream.LongStream stream,
java.util.function.Supplier<Tap> into,
FlowProcess flowProcess)
Method writeLong will add each
long instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeLong(java.util.stream.LongStream stream,
Tap into,
FlowProcess flowProcess)
Method writeLong will add each
long instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeTuple(java.util.stream.Stream<Tuple> stream,
java.util.function.Supplier<Tap> into,
FlowProcess flowProcess)
Method writeTuple will add each
Tuple instance to the TupleEntryCollector provided
by the given Tap instance. |
static Tap |
writeTuple(java.util.stream.Stream<Tuple> stream,
Tap into,
FlowProcess flowProcess)
Method writeTuple will add each
Tuple instance to the TupleEntryCollector provided
by the given Tap instance. |
public TupleStream()
public static java.util.stream.Stream<Tuple> tupleStream(Tap tap, FlowProcess flowProcess)
Stream
of Tuple
instances from the given
Tap
instance.
Also see Tap.tupleStream(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<Tuple> tupleStreamCopy(Tap tap, FlowProcess flowProcess)
Stream
of Tuple
instances from the given
Tap
instance.
This method returns an Tuple instance suitable for caching.
Also see Tap.tupleStreamCopy(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<Tuple> tupleStream(Tap tap, FlowProcess flowProcess, Fields selector)
Stream
of Tuple
instances from the given
Tap
instance.
Also see Tap.tupleStream(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 Tuplepublic static java.util.stream.Stream<Tuple> tupleStreamCopy(Tap tap, FlowProcess flowProcess, Fields selector)
Stream
of Tuple
instances from the given
Tap
instance.
This method returns an Tuple instance suitable for caching.
Also see Tap.tupleStreamCopy(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 Tuplepublic static <R> java.util.function.Function<Tuple,? extends R> posToObject(int pos)
R
- the object typepos
- the ordinal position to select frompublic static java.util.function.ToIntFunction<Tuple> posToInt(int pos)
pos
- the ordinal position to select frompublic static java.util.function.ToLongFunction<Tuple> posToLong(int pos)
pos
- the ordinal position to select frompublic static java.util.function.ToDoubleFunction<Tuple> posToDouble(int pos)
pos
- the ordinal position to select frompublic static Tap writeTuple(java.util.stream.Stream<Tuple> stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)
Tuple
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of Tuple instancesinto
- a Supplier that returns the Tap to sink each entry intoflowProcess
- represents the current platform configurationpublic static Tap writeTuple(java.util.stream.Stream<Tuple> stream, Tap into, FlowProcess flowProcess)
Tuple
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of Tuple instancesinto
- the Tap to sink each entry intoflowProcess
- represents the current platform configurationpublic static Tap writeInt(java.util.stream.IntStream stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)
int
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of int valuesinto
- a Supplier that returns the Tap to sink each value intoflowProcess
- represents the current platform configurationpublic static Tap writeInt(java.util.stream.IntStream stream, Tap into, FlowProcess flowProcess)
int
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of int valuesinto
- the Tap to sink each value intoflowProcess
- represents the current platform configurationpublic static Tap writeLong(java.util.stream.LongStream stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)
long
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of long valuesinto
- a Supplier that returns the Tap to sink each value intoflowProcess
- represents the current platform configurationpublic static Tap writeLong(java.util.stream.LongStream stream, Tap into, FlowProcess flowProcess)
long
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of long valuesinto
- the Tap to sink each value intoflowProcess
- represents the current platform configurationpublic static Tap writeDouble(java.util.stream.DoubleStream stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)
double
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of double valuesinto
- a Supplier that returns the Tap to sink each value intoflowProcess
- represents the current platform configurationpublic static Tap writeDouble(java.util.stream.DoubleStream stream, Tap into, FlowProcess flowProcess)
double
instance to the TupleEntryCollector
provided
by the given Tap
instance.stream
- a Stream of double valuesinto
- the Tap to sink each value intoflowProcess
- represents the current platform configurationCopyright © 2007-2017 Cascading Maintainers. All Rights Reserved.