Package io.pravega.client
Interface ByteStreamClientFactory
-
- All Superinterfaces:
java.lang.AutoCloseable
@Beta public interface ByteStreamClientFactory extends java.lang.AutoCloseable
Used to create Writers and Readers operating on a Byte Stream. The byteStreamClient can create readers and writers that work on a stream of bytes. The stream must be pre-created with a single fixed segment. Sharing a stream between the byte stream API and the Event stream readers/writers will CORRUPT YOUR DATA in an unrecoverable way.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes the ByteStreamClientFactory.ByteStreamReader
createByteStreamReader(java.lang.String streamName)
Creates a new ByteStreamReader on the specified stream initialized with the last offset which was passed to ByteStreamWriter::truncateDataBefore(offset), or 0 if truncateDataBefore has not ever been called on this stream.ByteStreamWriter
createByteStreamWriter(java.lang.String streamName)
Creates a new ByteStreamWriter on the specified stream.static ByteStreamClientFactory
withScope(java.lang.String scope, ClientConfig config)
Creates a new instance of ByteStreamClientFactory.
-
-
-
Method Detail
-
withScope
static ByteStreamClientFactory withScope(java.lang.String scope, ClientConfig config)
Creates a new instance of ByteStreamClientFactory.- Parameters:
scope
- The scope string.config
- Configuration for the client.- Returns:
- Instance of ByteStreamClientFactory implementation.
-
createByteStreamReader
@Beta ByteStreamReader createByteStreamReader(java.lang.String streamName)
Creates a new ByteStreamReader on the specified stream initialized with the last offset which was passed to ByteStreamWriter::truncateDataBefore(offset), or 0 if truncateDataBefore has not ever been called on this stream. The first byte read from the return value of this method will be the first available byte in the stream, considering any possible truncation.- Parameters:
streamName
- the stream to read from.- Returns:
- A new ByteStreamReader
-
createByteStreamWriter
@Beta ByteStreamWriter createByteStreamWriter(java.lang.String streamName)
Creates a new ByteStreamWriter on the specified stream.- Parameters:
streamName
- The name of the stream to write to.- Returns:
- A new ByteStreamWriter.
-
close
void close()
Closes the ByteStreamClientFactory. This will close any connections created through it.- Specified by:
close
in interfacejava.lang.AutoCloseable
- See Also:
AutoCloseable.close()
-
-