Skip to content

Commit

Permalink
release 3.1.102 source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaweicloud-SDK committed Sep 12, 2024
1 parent ed04eb6 commit 2db6407
Show file tree
Hide file tree
Showing 10 changed files with 375 additions and 1 deletion.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 3.1.102 2024-09-12

### HuaweiCloud SDK KVS

- _API Version_
- V1
- _Features_
- None
- _Bug Fix_
- None
- _Change_
- **ScanKv**
- changes of request param
- `+ sample_segments_count`
- `+ return_count_only`
- changes of response param
- `+ returned_segment_items`

# 3.1.101 2024-09-05

### HuaweiCloud SDK ECS
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 3.1.102 2024-09-12

### HuaweiCloud SDK KVS

- _接口版本_
- V1
- _新增特性_
-
- _解决问题_
-
- _特性变更_
- **ScanKv**
- 请求参数变更
- `+ sample_segments_count`
- `+ return_count_only`
- 响应参数变更
- `+ returned_segment_items`

# 3.1.101 2024-09-05

### HuaweiCloud SDK ECS
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.101
3.1.102
4 changes: 4 additions & 0 deletions cts/include/huaweicloud/cts/v3/CtsRegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class HUAWEICLOUD_CTS_V3_EXPORT CtsRegion {
{
"https://cts.ru-moscow-1.myhuaweicloud.com"
});
regions["ae-ad-1"] = Region("ae-ad-1",
{
"https://cts.ae-ad-1.myhuaweicloud.com"
});
return regions;
}
private:
Expand Down
78 changes: 78 additions & 0 deletions kvs/include/huaweicloud/kvs/v1/model/Returned_segment_item.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

#ifndef HUAWEICLOUD_SDK_KVS_V1_MODEL_Returned_segment_item_H_
#define HUAWEICLOUD_SDK_KVS_V1_MODEL_Returned_segment_item_H_

#include <huaweicloud/core/bson/Defines.h>
#include <huaweicloud/core/bson/Builder.h>
#include <huaweicloud/core/bson/Viewer.h>

#include <huaweicloud/kvs/v1/KvsExport.h>

#include <huaweicloud/core/utils/ModelBase.h>
#include <huaweicloud/core/utils/Utils.h>
#include <huaweicloud/core/http/HttpResponse.h>

#include <huaweicloud/core/bson/Bson.h>

namespace HuaweiCloud {
namespace Sdk {
namespace Kvs {
namespace V1 {
namespace Model {

using namespace HuaweiCloud::Sdk::Core::Utils;
using namespace HuaweiCloud::Sdk::Core::Http;
/// <summary>
/// 采样段的起始终止主键对。
/// </summary>
class HUAWEICLOUD_KVS_V1_EXPORT Returned_segment_item
: public ModelBase
{
public:
Returned_segment_item();
virtual ~Returned_segment_item();

/////////////////////////////////////////////
/// ModelBase overrides

void validate() override;
bool fromBson(const Viewer &viewer) override;
bool toBson(Builder &builder) const override;
/////////////////////////////////////////////
/// Returned_segment_item members

/// <summary>
/// 采样段区间起始值。
/// </summary>

Document getSegmentMinKey() const;
bool segmentMinKeyIsSet() const;
void unsetsegmentMinKey();
void setSegmentMinKey(const Document& value);

/// <summary>
/// 采样段区间终止值。
/// </summary>

Document getSegmentMaxKey() const;
bool segmentMaxKeyIsSet() const;
void unsetsegmentMaxKey();
void setSegmentMaxKey(const Document& value);


protected:
Document segmentMinKey_;
bool segmentMinKeyIsSet_;
Document segmentMaxKey_;
bool segmentMaxKeyIsSet_;

};


}
}
}
}
}

#endif // HUAWEICLOUD_SDK_KVS_V1_MODEL_Returned_segment_item_H_
22 changes: 22 additions & 0 deletions kvs/include/huaweicloud/kvs/v1/model/ScanKvRequestBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@ class HUAWEICLOUD_KVS_V1_EXPORT ScanKvRequestBody
void unsetfilterExpression();
void setFilterExpression(const Condition_expression& value);

/// <summary>
/// 对表进行采样,尽最大努力保证返回的段列表均分整张表。举例:sample_segments_count&#x3D;4,返回的段列表[MinKey, KV1)、[KV1,KV2)、[KV2,KV3)和[KV3,MaxKey)。用户可以使用scan-kv对这四个分区执行并发扫描,提高遍历效率。 - 范围: [1, 10000]。默认值:不执行采样。 - sample_segments_count仅能和table_name、start_key和end_key字段配合使用。Range分区模式下支持全表采样和范围采样;Hash分区模式仅支持全表扫描。 - 仅支持对Primary key进行采样,不支持本地/全局二级索引。 - 返回的段列表仅包含主键,不包含键值;且段列表是编码后的数据 ,不可修改。
/// </summary>

int32_t getSampleSegmentsCount() const;
bool sampleSegmentsCountIsSet() const;
void unsetsampleSegmentsCount();
void setSampleSegmentsCount(int32_t value);

/// <summary>
/// 返回查询条件对应的KV总数. - 当KV总数小于limit条件时,返回KV查询结果和KV总数。 - 当KV总数多于limit条件时,只返回KV总数。
/// </summary>

bool isReturnCountOnly() const;
bool returnCountOnlyIsSet() const;
void unsetreturnCountOnly();
void setReturnCountOnly(bool value);


protected:
std::string tableName_;
Expand All @@ -111,6 +129,10 @@ class HUAWEICLOUD_KVS_V1_EXPORT ScanKvRequestBody
bool endKeyIsSet_;
Condition_expression filterExpression_;
bool filterExpressionIsSet_;
int32_t sampleSegmentsCount_;
bool sampleSegmentsCountIsSet_;
bool returnCountOnly_;
bool returnCountOnlyIsSet_;

};

Expand Down
12 changes: 12 additions & 0 deletions kvs/include/huaweicloud/kvs/v1/model/ScanKvResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <huaweicloud/core/utils/Utils.h>
#include <huaweicloud/core/http/HttpResponse.h>

#include <huaweicloud/kvs/v1/model/Returned_segment_item.h>
#include <huaweicloud/core/bson/Bson.h>
#include <vector>
#include <huaweicloud/kvs/v1/model/Returned_kv_item.h>
Expand Down Expand Up @@ -79,6 +80,15 @@ class HUAWEICLOUD_KVS_V1_EXPORT ScanKvResponse
void unsetreturnedKvItems();
void setReturnedKvItems(const std::vector<Returned_kv_item>& value);

/// <summary>
/// 采样段区间列表。
/// </summary>

std::vector<Returned_segment_item>& getReturnedSegmentItems();
bool returnedSegmentItemsIsSet() const;
void unsetreturnedSegmentItems();
void setReturnedSegmentItems(const std::vector<Returned_segment_item>& value);


protected:
int32_t returnedCount_;
Expand All @@ -89,6 +99,8 @@ class HUAWEICLOUD_KVS_V1_EXPORT ScanKvResponse
bool cursorKeyIsSet_;
std::vector<Returned_kv_item> returnedKvItems_;
bool returnedKvItemsIsSet_;
std::vector<Returned_segment_item> returnedSegmentItems_;
bool returnedSegmentItemsIsSet_;

#ifdef RTTR_FLAG
RTTR_ENABLE()
Expand Down
118 changes: 118 additions & 0 deletions kvs/src/v1/model/Returned_segment_item.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@


#include "huaweicloud/kvs/v1/model/Returned_segment_item.h"
#include <huaweicloud/core/utils/Utils.h>
namespace HuaweiCloud {
namespace Sdk {
namespace Kvs {
namespace V1 {
namespace Model {




Returned_segment_item::Returned_segment_item()
{
segmentMinKeyIsSet_ = false;
segmentMaxKeyIsSet_ = false;
}

Returned_segment_item::~Returned_segment_item() = default;

void Returned_segment_item::validate()
{
}

bool Returned_segment_item::toBson(Builder &builder) const
{

if (segmentMinKeyIsSet_ && !bson_append(builder, "segment_min_key", segmentMinKey_)) {
return false;
}
if (segmentMaxKeyIsSet_ && !bson_append(builder, "segment_max_key", segmentMaxKey_)) {
return false;
}

return true;
}

bool Returned_segment_item::fromBson(const Viewer &viewer)
{

Viewer::Iterator it = viewer.begin();
while (it != viewer.end()) {
const std::string &key = it->key();

if (key == "segment_min_key") {
if (!bson_get(it, segmentMinKey_)) {
return false;
}
segmentMinKeyIsSet_ = true;
++it;
continue;
}

if (key == "segment_max_key") {
if (!bson_get(it, segmentMaxKey_)) {
return false;
}
segmentMaxKeyIsSet_ = true;
++it;
continue;
}

++it;
}

return true;
}

Document Returned_segment_item::getSegmentMinKey() const
{
return segmentMinKey_;
}

void Returned_segment_item::setSegmentMinKey(const Document& value)
{
segmentMinKey_ = value;
segmentMinKeyIsSet_ = true;
}

bool Returned_segment_item::segmentMinKeyIsSet() const
{
return segmentMinKeyIsSet_;
}

void Returned_segment_item::unsetsegmentMinKey()
{
segmentMinKeyIsSet_ = false;
}

Document Returned_segment_item::getSegmentMaxKey() const
{
return segmentMaxKey_;
}

void Returned_segment_item::setSegmentMaxKey(const Document& value)
{
segmentMaxKey_ = value;
segmentMaxKeyIsSet_ = true;
}

bool Returned_segment_item::segmentMaxKeyIsSet() const
{
return segmentMaxKeyIsSet_;
}

void Returned_segment_item::unsetsegmentMaxKey()
{
segmentMaxKeyIsSet_ = false;
}

}
}
}
}
}


Loading

0 comments on commit 2db6407

Please sign in to comment.