
# 变更分区数量
参考[初始化DIS客户端](https://support.huaweicloud.com/sdkreference-dis/dis_06_0015.html)的操作初始化一个DIS客户端实例，实例名称为dic。
其中，"streamName"的配置值要与[开通DIS通道](https://support.huaweicloud.com/usermanual-dis/dis_01_0601.html)中"通道名称"的值一致，"endpoint"，"ak"，"sk"，"region"，"projectId"信息请参见[获取认证信息](https://support.huaweicloud.com/sdkreference-dis/dis_06_0010.html)。
```
// 目标分区数量
int targetPartitionCount = 2;
        
UpdatePartitionCountRequest update = new UpdatePartitionCountRequest();
update.setStreamName(streamName);
update.setTargetPartitionCount(targetPartitionCount);
try
{
     UpdatePartitionCountResult updatePartitionCountResult = dic.updatePartitionCount(update);
     LOGGER.info("Success to update partition count, {}", updatePartitionCountResult);
}
catch (Exception e)
{
     LOGGER.error("Failed to update partition count", e);
}
```
变更分区数量成功的返回信息如下。
```
Success to update partition count, UpdatePartitionCountResult [currentPartitionCount=2, streamName=mystream, targetPartitionCount=2]
```
