Package com.rabbitmq.stream
Interface StreamCreator
-
public interface StreamCreatorAPI to configure and create a stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classStreamCreator.LeaderLocatorThe leader locator strategy.static interfaceStreamCreator.SuperStreamConfigurationSuper stream configuration.
-
Field Summary
Fields Modifier and Type Field Description static ByteCapacityMAX_SEGMENT_SIZESegment size is limited to 3 GB.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StreamCreatorargument(String key, String value)Set an argument for the stream creation.voidcreate()Create the stream.StreamCreatorfilterSize(int size)Set the size of the stream chunk filters.StreamCreatorinitialMemberCount(int initialMemberCount)Set the number of initial members the stream should have.StreamCreatorleaderLocator(StreamCreator.LeaderLocator leaderLocator)TheStreamCreator.LeaderLocatorstrategy.StreamCreatormaxAge(Duration maxAge)The maximum age of a stream before it gets truncated.StreamCreatormaxLengthBytes(ByteCapacity byteCapacity)The maximum size of the stream before it gets truncated.StreamCreatormaxSegmentSizeBytes(ByteCapacity byteCapacity)The maximum size of each stream segments.StreamCreatorname(String name)The name of the (super) stream.StreamCreatorstream(String stream)The name of the stream.StreamCreator.SuperStreamConfigurationsuperStream()Configure the super stream to create.
-
-
-
Field Detail
-
MAX_SEGMENT_SIZE
static final ByteCapacity MAX_SEGMENT_SIZE
Segment size is limited to 3 GB.
-
-
Method Detail
-
stream
StreamCreator stream(String stream)
The name of the stream.Alias for
name(String).- Parameters:
stream-- Returns:
- this creator instance
-
name
StreamCreator name(String name)
The name of the (super) stream.- Parameters:
name-- Returns:
- this creator instance
- Since:
- 0.15.0
-
maxLengthBytes
StreamCreator maxLengthBytes(ByteCapacity byteCapacity)
The maximum size of the stream before it gets truncated.- Parameters:
byteCapacity-- Returns:
- this creator instance
-
maxSegmentSizeBytes
StreamCreator maxSegmentSizeBytes(ByteCapacity byteCapacity)
The maximum size of each stream segments.Maximum size is
MAX_SEGMENT_SIZE(3 GB).- Parameters:
byteCapacity-- Returns:
- this creator instance
-
maxAge
StreamCreator maxAge(Duration maxAge)
The maximum age of a stream before it gets truncated.- Parameters:
maxAge-- Returns:
- this creator instance
-
leaderLocator
StreamCreator leaderLocator(StreamCreator.LeaderLocator leaderLocator)
TheStreamCreator.LeaderLocatorstrategy.- Parameters:
leaderLocator-- Returns:
- this creator instance
-
filterSize
StreamCreator filterSize(int size)
Set the size of the stream chunk filters.Must be between 16 and 255 bytes, default is 16.
Use a bloom filter calculator to size the filter accordingly to the possible number of filter values and the acceptable rate of false positives (RabbitMQ Stream uses 2 hash functions).
- Parameters:
size- (in bytes)- Returns:
- this creator instance
- See Also:
ProducerBuilder.filterValue(Function),ConsumerBuilder.filter()
-
initialMemberCount
StreamCreator initialMemberCount(int initialMemberCount)
Set the number of initial members the stream should have.- Parameters:
initialMemberCount- initial number of nodes- Returns:
- this creator instance
- See Also:
- Initial Replication Factor
-
argument
StreamCreator argument(String key, String value)
Set an argument for the stream creation.- Parameters:
key- argument keyvalue- argument value- Returns:
- this creator instance
-
superStream
StreamCreator.SuperStreamConfiguration superStream()
Configure the super stream to create.Requires RabbitMQ 3.13.0 or more.
- Returns:
- the super stream configuration
- Since:
- 0.15.0
-
create
void create()
Create the stream.This method is idempotent: the stream exists when it returns.
-
-