/** * Creates a {@link JavaRDD} that represents all events from the given stream. * * @param namespace namespace in which the stream exists * @param streamName name of the stream * @return A new {@link JavaRDD} instance that reads from the given stream * @throws DatasetInstantiationException if the stream doesn't exist */ public JavaRDD<StreamEvent> fromStream(String namespace, String streamName) { return fromStream(namespace, streamName, 0, Long.MAX_VALUE); }
/** * Creates a {@link JavaRDD} that represents all events from the given stream. * * @param streamName name of the stream * @return A new {@link JavaRDD} instance that reads from the given stream * @throws DatasetInstantiationException if the stream doesn't exist */ public JavaRDD<StreamEvent> fromStream(String streamName) { return fromStream(streamName, 0, Long.MAX_VALUE); }
/** * Creates a {@link JavaPairRDD} that represents all events from the given stream. The key in the * resulting {@link JavaPairRDD} is the event timestamp. The stream body will * be decoded as the give value type. Currently it supports {@link Text}, {@link String} and {@link ByteWritable}. * * @param streamName name of the stream * @param valueType type of the stream body to decode to * @return A new {@link JavaRDD} instance that reads from the given stream * @throws DatasetInstantiationException if the stream doesn't exist */ public <V> JavaPairRDD<Long, V> fromStream(String streamName, Class<V> valueType) { return fromStream(streamName, 0, Long.MAX_VALUE, valueType); }
/** * Creates a {@link JavaPairRDD} that represents all events from the given stream. The key in the * resulting {@link JavaPairRDD} is the event timestamp. The stream body will * be decoded as the give value type. Currently it supports {@link Text}, {@link String} and {@link ByteWritable}. * * @param namespace namespace in which the stream exists * @param streamName name of the stream * @param valueType type of the stream body to decode to * @return A new {@link JavaRDD} instance that reads from the given stream * @throws DatasetInstantiationException if the stream doesn't exist */ public <V> JavaPairRDD<Long, V> fromStream(String namespace, String streamName, Class<V> valueType) { return fromStream(namespace, streamName, 0, Long.MAX_VALUE, valueType); }
/** * Creates a {@link JavaPairRDD} that represents all events from the given stream. * The first entry in the pair is a {@link Long}, representing the * event timestamp, while the second entry is a {@link GenericStreamEventData}, * which contains data decoded from the stream event body base on * the given {@link FormatSpecification}. * * @param streamName name of the stream * @param formatSpec the {@link FormatSpecification} describing the format in the stream * @param <T> value type * @return a new {@link JavaPairRDD} instance that reads from the given stream. * @throws DatasetInstantiationException if the Stream doesn't exist */ public <T> JavaPairRDD<Long, GenericStreamEventData<T>> fromStream(String streamName, FormatSpecification formatSpec, Class<T> dataType) { return fromStream(streamName, formatSpec, 0, Long.MAX_VALUE, dataType); }
/** * Creates a {@link JavaPairRDD} that represents all events from the given stream. * The first entry in the pair is a {@link Long}, representing the * event timestamp, while the second entry is a {@link GenericStreamEventData}, * which contains data decoded from the stream event body base on * the given {@link FormatSpecification}. * * @param namespace namespace in which the stream exists * @param streamName name of the stream * @param formatSpec the {@link FormatSpecification} describing the format in the stream * @param <T> value type * @return a new {@link JavaPairRDD} instance that reads from the given stream. * @throws DatasetInstantiationException if the Stream doesn't exist */ public <T> JavaPairRDD<Long, GenericStreamEventData<T>> fromStream(String namespace, String streamName, FormatSpecification formatSpec, Class<T> dataType) { return fromStream(namespace, streamName, formatSpec, 0, Long.MAX_VALUE, dataType); }