-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conform the max-txn-ops requirement of etcd. (#126)
We don't need such flags for etcd server anymore, by splitting a large update set to many transactions. We compute etcd ops by DFS when persisting object, ensuring the correctness of segmented updates for etcd.
- Loading branch information
1 parent
4fdf5e9
commit 60ab766
Showing
5 changed files
with
107 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** Copyright 2020-2021 Alibaba Group Holding Limited. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <thread> | ||
|
||
#include "arrow/status.h" | ||
#include "arrow/util/io_util.h" | ||
#include "arrow/util/logging.h" | ||
#include "glog/logging.h" | ||
|
||
#include "basic/ds/array.h" | ||
#include "basic/ds/hashmap.h" | ||
#include "basic/ds/tuple.h" | ||
#include "client/client.h" | ||
#include "client/ds/object_meta.h" | ||
#include "common/util/typename.h" | ||
|
||
using namespace vineyard; // NOLINT(build/namespaces) | ||
|
||
int main(int argc, char** argv) { | ||
if (argc < 2) { | ||
printf("usage ./large_meta_test <ipc_socket>"); | ||
return 1; | ||
} | ||
std::string ipc_socket = std::string(argv[1]); | ||
|
||
Client client; | ||
VINEYARD_CHECK_OK(client.Connect(ipc_socket)); | ||
LOG(INFO) << "Connected to IPCServer: " << ipc_socket; | ||
|
||
const size_t element_size = 10240; | ||
|
||
TupleBuilder tup_builder(client); | ||
tup_builder.SetSize(element_size); | ||
for (size_t idx = 0; idx < element_size; ++idx) { | ||
std::vector<double> double_array = {1.0, static_cast<double>(element_size), | ||
static_cast<double>(idx)}; | ||
auto builder = std::make_shared<ArrayBuilder<double>>(client, double_array); | ||
tup_builder.SetValue(idx, builder); | ||
} | ||
|
||
auto tup = std::dynamic_pointer_cast<Tuple>(tup_builder.Seal(client)); | ||
VINEYARD_CHECK_OK(client.Persist(tup->id())); | ||
|
||
for (size_t idx = 0; idx < element_size; ++idx) { | ||
auto item = tup->At(idx); | ||
CHECK_EQ(item->meta().GetTypeName(), type_name<Array<double>>()); | ||
auto arr = std::dynamic_pointer_cast<Array<double>>(item); | ||
CHECK_EQ(arr->size(), 3); | ||
CHECK_DOUBLE_EQ(arr->data()[0], 1.0); | ||
CHECK_DOUBLE_EQ(arr->data()[1], static_cast<double>(element_size)); | ||
CHECK_DOUBLE_EQ(arr->data()[2], static_cast<double>(idx)); | ||
} | ||
|
||
LOG(INFO) << "Passed large metadata tests..."; | ||
|
||
client.Disconnect(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters