mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 17:15:39 +08:00
fixes for comments outside python
This commit is contained in:
1 parent
729bba1ff8
commit
040216d489
5 files changed
+14
-15
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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]);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace plasma {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kErrorDetailTypeId[] = "plasma status detail";
|
||||
const char kErrorDetailTypeId[] = "plasma::PlasmaStatusDetail";
|
||||
|
||||
class PlasmaStatusDetail : public arrow::StatusDetail {
|
||||
public:
|
||||
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user