Skip to content

Commit

Permalink
fixes for comments outside python
Browse files Browse the repository at this point in the history
  • Loading branch information
emkornfield committed Jul 3, 2019
1 parent 729bba1 commit 040216d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion cpp/src/arrow/status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Status::Status(StatusCode code, const std::string& msg)

Status::Status(StatusCode code, std::string msg, std::shared_ptr<StatusDetail> detail) {
ARROW_CHECK_NE(code, StatusCode::OK) << "Cannot construct ok status with message";
assert(code != StatusCode::OK);
state_ = new State;
state_->code = code;
state_->msg = std::move(msg);
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/plasma/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -791,12 +791,12 @@ Status PlasmaClient::Impl::Seal(const ObjectID& object_id) {
auto object_entry = objects_in_use_.find(object_id);

if (object_entry == objects_in_use_.end()) {
return MakePlasmaError("Seal() called on an object without a reference to it",
PlasmaErrorCode::PlasmaObjectNonexistent);
return MakePlasmaError(PlasmaErrorCode::PlasmaObjectNonexistent,"Seal() called on an object without a reference to it"
);
}
if (object_entry->second->is_sealed) {
return MakePlasmaError("Seal() called on an already sealed object",
PlasmaErrorCode::PlasmaObjectAlreadySealed);
return MakePlasmaError(PlasmaErrorCode::PlasmaObjectAlreadySealed,"Seal() called on an already sealed object"
);
}

object_entry->second->is_sealed = true;
Expand Down Expand Up @@ -897,7 +897,7 @@ Status PlasmaClient::Impl::Hash(const ObjectID& object_id, uint8_t* digest) {
RETURN_NOT_OK(Get({object_id}, 0, &object_buffers));
// If the object was not retrieved, return false.
if (!object_buffers[0].data) {
return MakePlasmaError("Object not found", PlasmaErrorCode::PlasmaObjectNonexistent);
return MakePlasmaError(PlasmaErrorCode::PlasmaObjectNonexistent, "Object not found");
}
// Compute the hash.
uint64_t hash = ComputeObjectHash(object_buffers[0]);
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/plasma/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace plasma {

namespace {

const char kErrorDetailTypeId[] = "plasma status detail";
const char kErrorDetailTypeId[] = "plasma::PlasmaStatusDetail";

class PlasmaStatusDetail : public arrow::StatusDetail {
public:
Expand Down Expand Up @@ -76,7 +76,7 @@ bool IsPlasmaStatus(const arrow::Status& status, PlasmaErrorCode code) {

using arrow::Status;

arrow::Status MakePlasmaError(std::string message, PlasmaErrorCode code) {
arrow::Status MakePlasmaError(PlasmaErrorCode code, std::string message) {
arrow::StatusCode arrow_code = arrow::StatusCode::UnknownError;
switch (code) {
case PlasmaErrorCode::PlasmaObjectExists:
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/plasma/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum class PlasmaErrorCode : int8_t {
PlasmaObjectAlreadySealed = 4,
};

ARROW_EXPORT arrow::Status MakePlasmaError(std::string message, PlasmaErrorCode code);
ARROW_EXPORT arrow::Status MakePlasmaError(PlasmaErrorCode code, std::string message);
/// Return true iff the status indicates an already existing Plasma object.
ARROW_EXPORT bool IsPlasmaObjectExists(const arrow::Status& status);
/// Return true iff the status indicates a non-existent Plasma object.
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/plasma/protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ Status PlasmaErrorStatus(fb::PlasmaError plasma_error) {
case fb::PlasmaError::OK:
return Status::OK();
case fb::PlasmaError::ObjectExists:
return MakePlasmaError("object already exists in the plasma store",
PlasmaErrorCode::PlasmaObjectExists);
return MakePlasmaError(PlasmaErrorCode::PlasmaObjectExists, "object already exists in the plasma store"
);
case fb::PlasmaError::ObjectNonexistent:
return MakePlasmaError("object does not exist in the plasma store",
PlasmaErrorCode::PlasmaObjectNonexistent);
return MakePlasmaError(PlasmaErrorCode::PlasmaObjectNonexistent, "object does not exist in the plasma store",
);
case fb::PlasmaError::OutOfMemory:
return MakePlasmaError("object does not fit in the plasma store",
PlasmaErrorCode::PlasmaStoreFull);
return MakePlasmaError(PlasmaErrorCode::PlasmaStoreFull, "object does not fit in the plasma store",
);
default:
ARROW_LOG(FATAL) << "unknown plasma error code " << static_cast<int>(plasma_error);
}
Expand Down

0 comments on commit 040216d

Please sign in to comment.