Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit b363319

Browse files
authored
GLog updated to 0.4.0. Also some C++ code cleanup to remove warnings (#3655)
1 parent 6e83c96 commit b363319

File tree

11 files changed

+18
-19
lines changed

11 files changed

+18
-19
lines changed

WORKSPACE

+2-3
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,8 @@ http_archive(
279279
http_archive(
280280
name = "com_github_google_glog",
281281
build_file = "@//:third_party/glog/glog.BUILD",
282-
sha256 = "7580e408a2c0b5a89ca214739978ce6ff480b5e7d8d7698a2aa92fadc484d1e0",
283-
strip_prefix = "glog-0.3.5",
284-
urls = ["https://github.com/google/glog/archive/v0.3.5.tar.gz"],
282+
strip_prefix = "glog-0.4.0",
283+
urls = ["https://github.com/google/glog/archive/v0.4.0.tar.gz"],
285284
)
286285

287286
http_archive(

heron/instance/src/cpp/gateway/stmgr-client.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ void StMgrClient::HandleRegisterResponse(
125125

126126
if (response->has_pplan()) {
127127
LOG(INFO) << "Registration response had a pplan";
128-
using std::move;
129-
pplanWatcher_(move(pool_unique_ptr<proto::system::PhysicalPlan>(response->release_pplan())));
128+
pplanWatcher_(pool_unique_ptr<proto::system::PhysicalPlan>(response->release_pplan()));
130129
}
131130
}
132131

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

151150
void StMgrClient::HandleTupleMessage(pool_unique_ptr<proto::system::HeronTupleSet2> msg) {

heron/stmgr/src/cpp/manager/stmgr-client.h

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class StMgrClient : public Client {
8989

9090
// Configs to be read
9191
sp_int32 reconnect_other_streammgrs_interval_sec_;
92-
sp_int32 reconnect_other_streammgrs_max_attempt_;
9392

9493
// Counters
9594
sp_int64 ndropped_messages_;

heron/stmgr/src/cpp/manager/stream-consumers.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace stmgr {
3535
StreamConsumers::StreamConsumers(const proto::api::InputStream& _is,
3636
const proto::api::StreamSchema& _schema,
3737
const std::vector<sp_int32>& _task_ids) {
38-
consumers_.push_back(std::move(Grouping::Create(_is.gtype(), _is, _schema, _task_ids)));
38+
consumers_.push_back(Grouping::Create(_is.gtype(), _is, _schema, _task_ids));
3939
}
4040

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

5454
void StreamConsumers::GetListToSend(const proto::system::HeronDataTuple& _tuple,

heron/stmgr/tests/cpp/server/dummy_ckptmgr_client.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ DummyCkptMgrClient::DummyCkptMgrClient(std::shared_ptr<EventLoop> _eventLoop,
4949
DummyCkptMgrClient::~DummyCkptMgrClient() {
5050
}
5151

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

6161
void DummyCkptMgrClient::GetInstanceState(const heron::proto::system::Instance& _instance,

heron/stmgr/tests/cpp/server/dummy_ckptmgr_client.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DummyCkptMgrClient : public heron::stmgr::CkptMgrClient {
3535

3636
virtual ~DummyCkptMgrClient();
3737

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

heron/stmgr/tests/cpp/server/dummy_stmgr_clientmgr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DummyStMgrClientMgr : public heron::stmgr::StMgrClientMgr {
4343
virtual void CloseConnectionsAndClear() { close_connections_called_ = true; }
4444
bool CloseConnectionsCalled() const { return close_connections_called_; }
4545

46-
virtual void StartConnections(const heron::proto::system::PhysicalPlan*) {
46+
virtual void StartConnections(heron::proto::system::PhysicalPlan const&) {
4747
start_connections_called_ = true;
4848
}
4949
bool StartConnectionsCalled() const { return start_connections_called_; }

heron/tmanager/src/cpp/manager/tmanager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void TManager::OnPackingPlanFetch(shared_ptr<proto::system::PackingPlan> newPack
205205
LOG(INFO) << "Packing plan changed. Deleting physical plan and restarting TManager to "
206206
<< "reset internal state. Exiting.";
207207
state_mgr_->DeletePhysicalPlan(tmanager_location_->topology_name(),
208-
[this](proto::system::StatusCode status) {
208+
[](proto::system::StatusCode status) {
209209
::exit(1);
210210
});
211211
} else {
@@ -221,7 +221,7 @@ void TManager::EstablishTManager(EventLoop::Status) {
221221
state_mgr_->SetTManagerLocation(*tmanager_location_, std::move(cb));
222222

223223
// if zk lost the tmanager location, tmanager quits to bail out and re-establish its location
224-
auto cb2 = [this]() {
224+
auto cb2 = []() {
225225
LOG(ERROR) << " lost tmanager location in zk state manager. Bailing out..." << std::endl;
226226
::exit(1);
227227
};

heron/tmanager/src/cpp/manager/tmetrics-collector.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,15 @@ TMetricsCollector::Metric::Metric(const sp_string& name,
400400
all_time_nitems_(0),
401401
bucket_interval_(bucket_interval) {
402402
for (sp_int32 i = 0; i < nbuckets; ++i) {
403-
data_.push_back(std::move(make_unique<TimeBucket>(bucket_interval_)));
403+
data_.push_back(make_unique<TimeBucket>(bucket_interval_));
404404
}
405405
}
406406

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

409409
void TMetricsCollector::Metric::Purge() {
410410
data_.pop_back();
411-
data_.push_front(std::move(make_unique<TimeBucket>(bucket_interval_)));
411+
data_.push_front(make_unique<TimeBucket>(bucket_interval_));
412412
}
413413

414414
void TMetricsCollector::Metric::AddValueToMetric(const sp_string& _value) {

heron/tmanager/tests/cpp/server/dummystmgr.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ DummyStMgr::DummyStMgr(std::shared_ptr<EventLoop> eventLoop, const NetworkOption
4242
pplan_(nullptr),
4343
got_restore_message_(false),
4444
got_start_message_(false) {
45-
InstallResponseHandler(std::move(make_unique<proto::tmanager::StMgrRegisterRequest>()),
45+
InstallResponseHandler(make_unique<proto::tmanager::StMgrRegisterRequest>(),
4646
&DummyStMgr::HandleRegisterResponse);
47-
InstallResponseHandler(std::move(make_unique<proto::tmanager::StMgrHeartbeatRequest>()),
47+
InstallResponseHandler(make_unique<proto::tmanager::StMgrHeartbeatRequest>(),
4848
&DummyStMgr::HandleHeartbeatResponse);
4949
InstallMessageHandler(&DummyStMgr::HandleNewAssignmentMessage);
5050
InstallMessageHandler(&DummyStMgr::HandleRestoreTopologyStateRequest);

third_party/glog/glog.BUILD

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ common_script = [
4141
]
4242

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

0 commit comments

Comments
 (0)