Skip to content

Commit

Permalink
Partially corrected code that is a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
thinker0 committed Mar 25, 2022
1 parent dede7d5 commit 4eabf69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void BoltOutputCollectorImpl::ack(std::shared_ptr<api::tuple::Tuple> tup) {
int64_t tupSize = 0;
for (int i = 0; i < actualRepr->roots_size(); ++i) {
ack->add_roots()->CopyFrom(actualRepr->roots(i));
tupSize += actualRepr->roots(i).ByteSize();
tupSize += actualRepr->roots(i).ByteSizeLong();
}
collector_->addAckTuple(ack, tupSize);
int64_t currentTime = std::chrono::duration_cast<std::chrono::nanoseconds>(
Expand All @@ -118,7 +118,7 @@ void BoltOutputCollectorImpl::fail(std::shared_ptr<api::tuple::Tuple> tup) {
int64_t tupSize = 0;
for (int i = 0; i < actualRepr->roots_size(); ++i) {
fl->add_roots()->CopyFrom(actualRepr->roots(i));
tupSize += actualRepr->roots(i).ByteSize();
tupSize += actualRepr->roots(i).ByteSizeLong();
}
collector_->addFailTuple(fl, tupSize);
int64_t currentTime = std::chrono::duration_cast<std::chrono::nanoseconds>(
Expand Down
8 changes: 4 additions & 4 deletions heron/stmgr/src/cpp/util/tuple-cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void TupleCache::TupleList::add_ack_tuple(sp_int32 _src_task_id,
current_->set_src_task_id(_src_task_id);
current_size_ = 0;
}
sp_int64 tuple_size = _tuple.ByteSize();
sp_int64 tuple_size = _tuple.ByteSizeLong();
current_size_ += tuple_size;
*_total_size += tuple_size;
current_->mutable_control()->add_acks()->CopyFrom(_tuple);
Expand All @@ -209,7 +209,7 @@ void TupleCache::TupleList::add_fail_tuple(sp_int32 _src_task_id,
current_->set_src_task_id(_src_task_id);
current_size_ = 0;
}
sp_int64 tuple_size = _tuple.ByteSize();
sp_int64 tuple_size = _tuple.ByteSizeLong();
current_size_ += tuple_size;
*_total_size += tuple_size;
current_->mutable_control()->add_fails()->CopyFrom(_tuple);
Expand All @@ -228,7 +228,7 @@ void TupleCache::TupleList::add_emit_tuple(sp_int32 _src_task_id,
current_->set_src_task_id(_src_task_id);
current_size_ = 0;
}
sp_int64 tuple_size = _tuple.ByteSize();
sp_int64 tuple_size = _tuple.ByteSizeLong();
current_size_ += tuple_size;
*_total_size += tuple_size;
current_->mutable_control()->add_emits()->CopyFrom(_tuple);
Expand All @@ -242,7 +242,7 @@ void TupleCache::TupleList::add_checkpoint_tuple(
current_ = NULL;
current_size_ = 0;
}
sp_int64 tuple_size = _message->ByteSize();
sp_int64 tuple_size = _message->ByteSizeLong();
*_total_size += tuple_size;
tuples_.push_front(_message);
}
Expand Down
6 changes: 3 additions & 3 deletions heron/stmgr/tests/cpp/server/checkpoint-gateway_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ TEST(CheckpointGateway, overflow) {
// Now send another tuple from the upstreamer.
auto tup = new heron::proto::system::HeronTupleSet2();
tup->set_src_task_id(upstreamer);
sp_uint32 cached_size = tup->ByteSize();
sp_uint64 cached_size = tup->ByteSizeLong();
gateway->SendToInstance(local_bolt, tup);
if (upstream_map[local_bolt].empty()) {
// They only have one upstreamer, so the tuple is passed thru
Expand All @@ -420,14 +420,14 @@ TEST(CheckpointGateway, overflow) {
EXPECT_EQ(0, drainer3_markers.size());
tup = new heron::proto::system::HeronTupleSet2();
tup->set_src_task_id(upstreamer);
cached_size += tup->ByteSize();
cached_size += tup->ByteSizeLong();
total_sent++;
gateway->SendToInstance(local_bolt, tup);
}
// Send one more to tip over
tup = new heron::proto::system::HeronTupleSet2();
tup->set_src_task_id(upstreamer);
cached_size += tup->ByteSize();
cached_size += tup->ByteSizeLong();
total_sent++;
gateway->SendToInstance(local_bolt, tup);
EXPECT_EQ(total_sent, drainer1_tuples.size());
Expand Down

0 comments on commit 4eabf69

Please sign in to comment.