You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/06/16 07:56:21 UTC

[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1004: fix: fix empty hashkey copy_data

acelyc111 commented on code in PR #1004:
URL: https://github.com/apache/incubator-pegasus/pull/1004#discussion_r898803586


##########
src/test/function_test/test_copy.cpp:
##########
@@ -0,0 +1,506 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 <cstdlib>
+#include <string>
+#include <vector>
+#include <map>
+
+#include <dsn/dist/replication/replication_ddl_client.h>
+#include <dsn/service_api_c.h>
+#include <geo/lib/geo_client.h>
+#include <gtest/gtest.h>
+#include <pegasus/client.h>
+#include <unistd.h>
+
+#include "base/pegasus_const.h"
+#include "base/pegasus_utils.h"
+#include "global_env.h"
+#include "shell/commands.h"
+
+using namespace ::pegasus;
+
+extern std::shared_ptr<dsn::replication::replication_ddl_client> ddl_client;
+static const char CCH[] = "_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+static const int max_batch_count = 500;
+static const int timeout_ms = 5000;
+static const int max_multi_set_concurrency = 20;
+static const int default_partitions = 4;
+static const std::string empty_hash_key = "";
+static const std::string srouce_app_name = "copy_data_source";
+static const std::string destination_app_name = "copy_data_destination";
+static char buffer[256];
+static std::map<std::string, std::map<std::string, std::string>> base_data;
+static pegasus_client *srouce_client;
+static pegasus_client *destination_client;
+
+static void check_and_put(std::map<std::string, std::map<std::string, std::string>> &data,

Review Comment:
   Seems there are some duplicate code to some other files in src/test/function_test/*, could you please do some refactor at first?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org