Skip to content
Permalink
Browse files
GLog updated to 0.4.0. Also some C++ code cleanup to remove warnings (#…
  • Loading branch information
nicknezis committed Jan 7, 2021
1 parent 6e83c96 commit b363319cf9b9c5804782553498f6f837c5515ffa
Showing 11 changed files with 18 additions and 19 deletions.
@@ -279,9 +279,8 @@ http_archive(
http_archive(
name = "com_github_google_glog",
build_file = "@//:third_party/glog/glog.BUILD",
sha256 = "7580e408a2c0b5a89ca214739978ce6ff480b5e7d8d7698a2aa92fadc484d1e0",
strip_prefix = "glog-0.3.5",
urls = ["https://github.com/google/glog/archive/v0.3.5.tar.gz"],
strip_prefix = "glog-0.4.0",
urls = ["https://github.com/google/glog/archive/v0.4.0.tar.gz"],
)

http_archive(
@@ -125,8 +125,7 @@ void StMgrClient::HandleRegisterResponse(

if (response->has_pplan()) {
LOG(INFO) << "Registration response had a pplan";
using std::move;
pplanWatcher_(move(pool_unique_ptr<proto::system::PhysicalPlan>(response->release_pplan())));
pplanWatcher_(pool_unique_ptr<proto::system::PhysicalPlan>(response->release_pplan()));
}
}

@@ -145,7 +144,7 @@ void StMgrClient::HandlePhysicalPlan(
pool_unique_ptr<proto::stmgr::NewInstanceAssignmentMessage> msg) {
LOG(INFO) << "Got a Physical Plan from our stmgr " << instanceProto_.stmgr_id() << " running at "
<< get_clientoptions().get_host() << ":" << get_clientoptions().get_port();
pplanWatcher_(std::move(pool_unique_ptr<proto::system::PhysicalPlan>(msg->release_pplan())));
pplanWatcher_(pool_unique_ptr<proto::system::PhysicalPlan>(msg->release_pplan()));
}

void StMgrClient::HandleTupleMessage(pool_unique_ptr<proto::system::HeronTupleSet2> msg) {
@@ -89,7 +89,6 @@ class StMgrClient : public Client {

// Configs to be read
sp_int32 reconnect_other_streammgrs_interval_sec_;
sp_int32 reconnect_other_streammgrs_max_attempt_;

// Counters
sp_int64 ndropped_messages_;
@@ -35,7 +35,7 @@ namespace stmgr {
StreamConsumers::StreamConsumers(const proto::api::InputStream& _is,
const proto::api::StreamSchema& _schema,
const std::vector<sp_int32>& _task_ids) {
consumers_.push_back(std::move(Grouping::Create(_is.gtype(), _is, _schema, _task_ids)));
consumers_.push_back(Grouping::Create(_is.gtype(), _is, _schema, _task_ids));
}

StreamConsumers::~StreamConsumers() {
@@ -48,7 +48,7 @@ StreamConsumers::~StreamConsumers() {
void StreamConsumers::NewConsumer(const proto::api::InputStream& _is,
const proto::api::StreamSchema& _schema,
const std::vector<sp_int32>& _task_ids) {
consumers_.push_back(std::move(Grouping::Create(_is.gtype(), _is, _schema, _task_ids)));
consumers_.push_back(Grouping::Create(_is.gtype(), _is, _schema, _task_ids));
}

void StreamConsumers::GetListToSend(const proto::system::HeronDataTuple& _tuple,
@@ -49,13 +49,13 @@ DummyCkptMgrClient::DummyCkptMgrClient(std::shared_ptr<EventLoop> _eventLoop,
DummyCkptMgrClient::~DummyCkptMgrClient() {
}

void DummyCkptMgrClient::SaveInstanceState(heron::proto::ckptmgr::SaveInstanceStateRequest* _req) {
void DummyCkptMgrClient::SaveInstanceState(unique_ptr<heron::proto::ckptmgr::SaveInstanceStateRequest> _req) {
const std::string& ckpt_id = _req->checkpoint().checkpoint_id();
if (saves_.find(ckpt_id) == saves_.end()) {
saves_[ckpt_id] = std::set<int32_t>();
}
saves_[ckpt_id].insert(_req->instance().info().task_id());
delete _req;
_req.reset(nullptr);
}

void DummyCkptMgrClient::GetInstanceState(const heron::proto::system::Instance& _instance,
@@ -35,7 +35,7 @@ class DummyCkptMgrClient : public heron::stmgr::CkptMgrClient {

virtual ~DummyCkptMgrClient();

virtual void SaveInstanceState(heron::proto::ckptmgr::SaveInstanceStateRequest* _request);
virtual void SaveInstanceState(unique_ptr<heron::proto::ckptmgr::SaveInstanceStateRequest> _request);
virtual void GetInstanceState(const heron::proto::system::Instance& _instance,
const std::string& _checkpoint_id);

@@ -43,7 +43,7 @@ class DummyStMgrClientMgr : public heron::stmgr::StMgrClientMgr {
virtual void CloseConnectionsAndClear() { close_connections_called_ = true; }
bool CloseConnectionsCalled() const { return close_connections_called_; }

virtual void StartConnections(const heron::proto::system::PhysicalPlan*) {
virtual void StartConnections(heron::proto::system::PhysicalPlan const&) {
start_connections_called_ = true;
}
bool StartConnectionsCalled() const { return start_connections_called_; }
@@ -205,7 +205,7 @@ void TManager::OnPackingPlanFetch(shared_ptr<proto::system::PackingPlan> newPack
LOG(INFO) << "Packing plan changed. Deleting physical plan and restarting TManager to "
<< "reset internal state. Exiting.";
state_mgr_->DeletePhysicalPlan(tmanager_location_->topology_name(),
[this](proto::system::StatusCode status) {
[](proto::system::StatusCode status) {
::exit(1);
});
} else {
@@ -221,7 +221,7 @@ void TManager::EstablishTManager(EventLoop::Status) {
state_mgr_->SetTManagerLocation(*tmanager_location_, std::move(cb));

// if zk lost the tmanager location, tmanager quits to bail out and re-establish its location
auto cb2 = [this]() {
auto cb2 = []() {
LOG(ERROR) << " lost tmanager location in zk state manager. Bailing out..." << std::endl;
::exit(1);
};
@@ -400,15 +400,15 @@ TMetricsCollector::Metric::Metric(const sp_string& name,
all_time_nitems_(0),
bucket_interval_(bucket_interval) {
for (sp_int32 i = 0; i < nbuckets; ++i) {
data_.push_back(std::move(make_unique<TimeBucket>(bucket_interval_)));
data_.push_back(make_unique<TimeBucket>(bucket_interval_));
}
}

TMetricsCollector::Metric::~Metric() {}

void TMetricsCollector::Metric::Purge() {
data_.pop_back();
data_.push_front(std::move(make_unique<TimeBucket>(bucket_interval_)));
data_.push_front(make_unique<TimeBucket>(bucket_interval_));
}

void TMetricsCollector::Metric::AddValueToMetric(const sp_string& _value) {
@@ -42,9 +42,9 @@ DummyStMgr::DummyStMgr(std::shared_ptr<EventLoop> eventLoop, const NetworkOption
pplan_(nullptr),
got_restore_message_(false),
got_start_message_(false) {
InstallResponseHandler(std::move(make_unique<proto::tmanager::StMgrRegisterRequest>()),
InstallResponseHandler(make_unique<proto::tmanager::StMgrRegisterRequest>(),
&DummyStMgr::HandleRegisterResponse);
InstallResponseHandler(std::move(make_unique<proto::tmanager::StMgrHeartbeatRequest>()),
InstallResponseHandler(make_unique<proto::tmanager::StMgrHeartbeatRequest>(),
&DummyStMgr::HandleHeartbeatResponse);
InstallMessageHandler(&DummyStMgr::HandleNewAssignmentMessage);
InstallMessageHandler(&DummyStMgr::HandleRestoreTopologyStateRequest);
@@ -41,6 +41,7 @@ common_script = [
]

mac_script = "\n".join(common_script + [
'./autogen.sh',
'./configure --prefix=$$INSTALL_DIR --enable-shared=no',
'make install',
'rm -rf $$TMP_DIR',
@@ -50,6 +51,7 @@ linux_script = "\n".join(common_script + [
'export VAR_LIBS="-Wl,--rpath -Wl,$$UNWIND_DIR/lib -L$$UNWIND_DIR/lib"',
'export VAR_INCL="-I$$UNWIND_DIR/include"',
'export VAR_LD="-L$$UNWIND_DIR/lib"',
'./autogen.sh',
'autoreconf -f -i',
'./configure --prefix=$$INSTALL_DIR --enable-shared=no LIBS="$$VAR_LIBS" CPPFLAGS="$$VAR_INCL" LDFLAGS="$$VAR_LD"',
'make install LIBS="$$VAR_LIBS" CPPFLAGS="$$VAR_INCL" LDFLAGS="$$VAR_LD"',

0 comments on commit b363319

Please sign in to comment.