Skip to content

Commit

Permalink
Merge pull request #62 from HDFGroup/kimmy/error_handling
Browse files Browse the repository at this point in the history
Kimmy/error handling
  • Loading branch information
jya-kmu committed Jan 9, 2021
2 parents 6d49602 + b977d35 commit 68cfedc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
17 changes: 6 additions & 11 deletions src/api/bucket.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,12 @@ Status Bucket::PlaceBlobs(std::vector<PlacementSchema> &schemas,

for (size_t i = 0; i < schemas.size(); ++i) {
PlacementSchema &schema = schemas[i];
if (schema.size()) {
hermes::Blob blob = {};
blob.data = (u8 *)blobs[i].data();
blob.size = blobs[i].size() * sizeof(T);
// TODO(chogan): @errorhandling What about partial failure?
result = PlaceBlob(&hermes_->context_, &hermes_->rpc_, schema, blob,
names[i].c_str(), id_);
} else {
// TODO(chogan): @errorhandling
result = 1;
}
hermes::Blob blob = {};
blob.data = (u8 *)blobs[i].data();
blob.size = blobs[i].size() * sizeof(T);
// TODO(chogan): @errorhandling What about partial failure?
result = PlaceBlob(&hermes_->context_, &hermes_->rpc_, schema, blob,
names[i].c_str(), id_);
}

return result;
Expand Down
9 changes: 6 additions & 3 deletions src/data_placement_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,12 @@ Status CalculatePlacement(SharedMemoryContext *context, RpcContext *rpc,
}

// Aggregate placement schemas from the same target
for (auto it = output_tmp.begin(); it != output_tmp.end(); ++it) {
PlacementSchema schema = AggregateBlobSchema((*it));
output.push_back(schema);
if (!result) {
for (auto it = output_tmp.begin(); it != output_tmp.end(); ++it) {
PlacementSchema schema = AggregateBlobSchema((*it));
CHECK(schema.size() > 0) << "PlacementSchema is empty";
output.push_back(schema);
}
}

return result;
Expand Down

0 comments on commit 68cfedc

Please sign in to comment.