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

Commit

Permalink
Change EMPTY_STRING defn to be a plain string so that we are ok getti…
Browse files Browse the repository at this point in the history
…ng its references (#2446)
  • Loading branch information
srkukarni authored Oct 18, 2017
1 parent 2ae8644 commit 3d7bf68
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion heron/common/src/cpp/basics/sptypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ typedef std::string sp_string;

#endif // SP_UNICODE

constexpr char const* EMPTY_STRING = "";
const std::string EMPTY_STRING = ""; // NOLINT

#endif /* end of header file */
4 changes: 2 additions & 2 deletions heron/common/src/cpp/config/physical-plan-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ void PhysicalPlanHelper::GetLocalSpouts(const proto::system::PhysicalPlan& _ppla
return;
}

const std::string PhysicalPlanHelper::GetComponentName(const proto::system::PhysicalPlan& _pplan,
int _task_id) {
const std::string& PhysicalPlanHelper::GetComponentName(const proto::system::PhysicalPlan& _pplan,
int _task_id) {
for (auto instance : _pplan.instances()) {
if (instance.info().task_id() == _task_id) {
return instance.info().component_name();
Expand Down
4 changes: 2 additions & 2 deletions heron/common/src/cpp/config/physical-plan-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class PhysicalPlanHelper {

// Returns the component name for the specified _task_id
// If the _task_id is not part of the _pplan, return empty string
static const std::string GetComponentName(const proto::system::PhysicalPlan& _pplan,
int _task_id);
static const std::string& GetComponentName(const proto::system::PhysicalPlan& _pplan,
int _task_id);

// For a particular _component, returns all the task_ids
static void GetComponentTaskIds(const proto::system::PhysicalPlan& _pplan,
Expand Down
2 changes: 1 addition & 1 deletion heron/common/src/cpp/network/httputils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ IncomingHTTPRequest::~IncomingHTTPRequest() {}

const sp_string& IncomingHTTPRequest::GetQuery() const { return query_; }

const sp_string IncomingHTTPRequest::GetValue(const sp_string& _key) const {
const sp_string& IncomingHTTPRequest::GetValue(const sp_string& _key) const {
for (size_t i = 0; i < kv_.size(); ++i) {
if (kv_[i].first == _key) {
return kv_[i].second;
Expand Down
2 changes: 1 addition & 1 deletion heron/common/src/cpp/network/httputils.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class IncomingHTTPRequest : public BaseHTTPRequest {
const HTTPKeyValuePairs& keyvalues() const { return kv_; }

//! Get the value of a particular key
const sp_string GetValue(const sp_string& _key) const;
const sp_string& GetValue(const sp_string& _key) const;

//! Get the all the values of a particular key
bool GetAllValues(const sp_string& _key, std::vector<sp_string>& _values) const;
Expand Down
2 changes: 1 addition & 1 deletion heron/tmaster/src/cpp/manager/stateful-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void StatefulController::HandleCheckpointSave(
}
}

const std::string StatefulController::GetNextInLineCheckpointId(const std::string& _ckpt_id) {
const std::string& StatefulController::GetNextInLineCheckpointId(const std::string& _ckpt_id) {
if (_ckpt_id.empty()) {
// There cannot be any checkpoints that are older than empty checkpoint
LOG(FATAL) << "Could not recover even from the empty state";
Expand Down
2 changes: 1 addition & 1 deletion heron/tmaster/src/cpp/manager/stateful-controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class StatefulController {

private:
// Get the youngest ckpt id that is older than the given ckpt_id
const std::string GetNextInLineCheckpointId(const std::string& _ckpt_id);
const std::string& GetNextInLineCheckpointId(const std::string& _ckpt_id);
// Creates a new ckpt record adding the latest one
proto::ckptmgr::StatefulConsistentCheckpoints*
AddNewConsistentCheckpoint(const std::string& _new_checkpoint,
Expand Down

0 comments on commit 3d7bf68

Please sign in to comment.