stream topic create

Creates a topic in the specified stream.

Permissions Required

To run this command, your user ID must have the following permissions:
NOTE
The mapr user is not treated as a superuser. HPE Ezmeral Data Fabric Streams does not allow the mapr user to run this command unless that user is given the relevant permission or permissions with access-control expressions.

Syntax

CLI
maprcli stream topic create
	 -path <Stream Path> 
	 -topic <Topic Name> 
	[ -partitions <Number of partitions> default: attribute defaultpartitions on the stream ]
       [ -timestamptype Timestamp type: createtime | logappendtime default: createtime ]
REST http[s]://<host>:<port>/rest/stream/topic/create?path=<path>&topic=<name>

Parameters

Parameter Description
path The path and name of the stream in which to create the topic.
topic The name of the topic to create.

A name can include alphanumeric characters and the period, underscore, and dash characters.

partitions The number of partitions to use for the topic. After you create the topic, you can increase the number of partitions, but you cannot reduce the number. The default number of partitions for new topics is set by the defaultpartitions parameter in the commands maprcli stream create and maprcli stream edit.
IMPORTANT
A CDC changelog stream's default partitions can impact how many partitions a stream topic can have. This is because once you create a stream topic for a changelog stream, the number of topic partitions is locked. The number of topic partitions cannot change.
  • If the stream topic create command is used to create a stream topic, then the number of topic partitions can be set at creation time and then is locked.
  • If the table changelog add command is used to add a stream topic (as well as establish a relationship between the source table and the changelog stream), then the number of topic partitions is inherited from the changelog stream and is locked.
timestamptype Specifies the type of timestamp stored in the topic's message. Value: createtime | logappendtime Default: createtime. The topic inherits the default value from the stream unless the topic sets the timestamp type to a different value.

A createtime value is the time defined by the user or application (when creating the message). If user or application does not define this value (or passes null), the client uses the current system timestamp.

A logappendtime value is the time when the message (log) was appended to the server.