数据接入服务 DIS
数据接入服务 DIS
- 最新动态
- 产品介绍
- 快速入门
- 用户指南
- 最佳实践
- API参考
- SDK参考
- 常见问题
- 文档下载
- 通用参考
本文导读
展开导读
链接复制成功!
变更分区数量
参考初始化DIS客户端的操作初始化一个DIS客户端实例,实例名称为dic。
其中,“streamName”的配置值要与开通DIS通道中“通道名称”的值一致,“endpoint”,“ak”,“sk”,“region”,“projectId”信息请参见获取认证信息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// 目标分区数量 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); } |
变更分区数量成功的返回信息如下。
1 |
Success to update partition count, UpdatePartitionCountResult [currentPartitionCount=2, streamName=mystream, targetPartitionCount=2] |
父主题: 使用SDK(Java)