Skip to content

Commit

Permalink
merge for subscribe info test
Browse files Browse the repository at this point in the history
  • Loading branch information
luyaoluo committed Dec 30, 2021
1 parent 35d4e19 commit 014c802
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 28 deletions.
2 changes: 0 additions & 2 deletions include/aca_message_pulsar_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ class ACA_Message_Pulsar_Consumer {

ACA_Message_Pulsar_Consumer();

// ACA_Message_Pulsar_Consumer(string topic, string brokers, string subscription_name);

~ACA_Message_Pulsar_Consumer();

void init(string topic, string brokers, string subscription_name);
Expand Down
20 changes: 1 addition & 19 deletions src/comm/aca_message_pulsar_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,6 @@ void ACA_Message_Pulsar_Consumer::init(string topic, string brokers, string subs
this->ptr_multicast_client= new Client(brokers);
this->ptr_unicast_client = new Client(brokers);
}
//ACA_Message_Pulsar_Consumer::ACA_Message_Pulsar_Consumer(string topic, string brokers, string subscription_name)
//{
// setUnicastTopicName(topic);
// recovered_topic=topic;
// setMulticastTopicName(topic);
// setBrokers(brokers);
// setUnicastSubscriptionName(subscription_name);
// setMulticastSubscriptionName(subscription_name);
//
// ACA_LOG_DEBUG("Broker list: %s\n", this->brokers_list.c_str());
// ACA_LOG_DEBUG("Unicast consumer topic name: %s\n", this->unicast_topic_name.c_str());
// ACA_LOG_DEBUG("Unicast consumer subscription name: %s\n", this->unicast_subscription_name.c_str());
// ACA_LOG_DEBUG("Multicast consumer topic name: %s\n", this->multicast_topic_name.c_str());
// ACA_LOG_DEBUG("Multicast consumer subscription name: %s\n", this->multicast_subscription_name.c_str());
//
// // Create the clients
// this->ptr_multicast_client= new Client(brokers);
// this->ptr_unicast_client = new Client(brokers);
//}

ACA_Message_Pulsar_Consumer::~ACA_Message_Pulsar_Consumer()
{
Expand Down Expand Up @@ -139,6 +120,7 @@ string ACA_Message_Pulsar_Consumer::getUnicastSubscriptionName() const
return this->unicast_subscription_name;
}

//TODO: get recovered topic from database?
string ACA_Message_Pulsar_Consumer::getRecoveredTopicName()
{
return "recovered topic test";
Expand Down
12 changes: 5 additions & 7 deletions test/func_tests/gs_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,14 @@ class SubscribeInfoProvisionerClient {
}
}

void update_subscribe_info(const SubscribeOperation &operation, const string &key, const string &topic){

SubscribeOperationReply reply;

void update_subscribe_info(const SubscribeOperation operation, const string key, const string topic, SubscribeOperationReply &reply)
{
NodeSubscribeInfo info;
info.set_subscribe_operation(operation);
info.set_key(key);
info.set_topic(topic);

push_info(info,reply);
push_info(info, reply);
}

private:
Expand Down Expand Up @@ -780,10 +778,10 @@ int run_as_topic_client() {

ACA_LOG_INFO("%s", "-------------- sending one subscribe info --------------\n");

GoalStateOperationReply reply;
SubscribeOperationReply reply;
auto before_send_info = std::chrono::steady_clock::now();

subscribe_client.update_subscribe_info(operation, hashValue, updateTopic);
subscribe_client.update_subscribe_info(operation, hashValue, updateTopic, reply);

auto after_send_info = std::chrono::steady_clock::now();
auto send_info_time =
Expand Down

0 comments on commit 014c802

Please sign in to comment.