• Data Ingestion Service

dis
  1. Help Center
  2. Data Ingestion Service
  3. User Guide
  4. DIS SDK Usage Guide
  5. Creating a Stream

Creating a Stream

Initialize a DIS client instance named dic. For details, see Initializing a DIS Client.

When you use the DIS SDK to create a DIS stream, specify the stream name, number of partitions in the stream, and stream type.

STREAM_TYPE_COMMON indicates a common stream, and STREAM_TYPE_ADVANCED indicates an advanced stream.

//Configure the channel name.
String streamName = "myStream";
//Configure the number of partitions in the stream.
Integer partitionCount = new Integer(3);
CreateStreamRequest createStreamRequest = new CreateStreamRequest();
createStreamRequest.setStreamName(streamName);
createStreamRequest.setPartitionCount(partitionCount);
//Configure the stream type.
createStreamRequest.setStreamType(CreateStreamRequest.STREAM_TYPE_COMMON);

After configuring CreateStreamRequest, you can create a stream by calling createStream.

dic.createStream(createStreamRequest);