Setting Partitions for Topics

When you create or edit a stream, you can specify the default number of partitions to create for each topic that is subsequently created in the stream.

When deciding how many partitions to create by default for new topics in a stream, consider the expected volume of messages that will be published to the topics in the stream. High message volumes can be handled more efficiently by multiple consumers in consumer groups reading from multiple partitions than by a individual consumers each reading from a single partition.

There are two methods that you can you to set this default number if you are creating a stream, and two methods if the stream already exists:

When you are creating a stream

You can use a maprcli command or a Java API.

maprcli command
Use the -defaultpartitions parameter of the stream create command.
Java API
Use the Admin.createStream(String streamPathAndName, StreamDescriptor desc) API of the MapR Streams Java API library.
When you are editing a stream

Again, you can use a maprcli command or a Java API.

maprcli command
Use the -defaultpartitions parameter of the stream edit command.
Java API
Use the Admin.editStream(String streamPathAndName, StreamDescriptor desc) API of the MapR Streams Java API library.