MCPcopy Create free account
hub / github.com/cinience/RedisStudio / GetData

Method GetData

RedisStudio/SSDB/SSDBZSetModel.cpp:11–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9}
10
11bool SSDBZSetModel::GetData( const std::string& key, RedisResult& results )
12{
13 results.NewColumn("Score");
14 results.NewColumn("Value");
15 std::vector<std::string> values ;
16 if (GetClient()->zrange(key, 0, 20000, &values).ok())
17 {
18 for (std::size_t idx=0; idx<values.size();)
19 {
20 int64_t score = 0;
21 GetClient()->zget(key, values[idx], &score);
22 results.NewRow();
23 std::string& scorestr = results.Value(results.RowSize()-1, 0);
24 std::string& value = results.Value(results.RowSize()-1, 1);
25 value = values[idx++];
26 scorestr = values[idx++];
27 }
28 }
29 else
30 {
31 return false;
32 }
33 return true;
34}
35
36bool SSDBZSetModel::UpdateData(const std::string& key,
37 const std::string& oldValue,

Callers

nothing calls this directly

Calls 8

NewColumnMethod · 0.80
okMethod · 0.80
zrangeMethod · 0.80
zgetMethod · 0.80
NewRowMethod · 0.80
ValueMethod · 0.80
RowSizeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected