Changing Partition Quantity

Initialize a DIS client as instructed in Initializing a DIS SDK Client Instance.

Use the DIS SDK to change the number of partitions.

string streamName = "streamName";
int count= 3;
            
var dic = new DISIngestionClient();
            var request = new UpdateShardsRequest
            {
//Stream name.
                StreamName = streamName,
//Number of the target partitions.
                TargetPartitionCount = count,
            };

            var response = dic.UpdatePartition(request);
            Console.Out.WriteLine(response);

Viewing Execution Results

Information similar to the following is displayed on the console:

{UpdateShardsResult{stream_name='dis-shaw', current_partition_count='1', target_partition_count='3'}}
Table 1 Description of response parameter UpdateShardsResult

Parameter

Type

Description

stream_name

String

Name of the stream whose partition quantity needs to be changed.

current_partition_count

int

Number of the current partitions

target_partition_count

int

Number of the target partitions.