Skip to content

Commit

Permalink
(#2) passing test ++
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 8, 2019
1 parent e4bbe7c commit 1600c00
Show file tree
Hide file tree
Showing 6 changed files with 772 additions and 748 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ namespace wrench {

this->releaseDaemonLock();

// If the job not done, just return
// If the job is not done, just return
if (this->completed_workunits[job].size() != this->all_workunits[job].size()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ namespace wrench {
files_to_write[f] = work->file_locations[f];
} else {
files_to_write[f] = FileLocation::LOCATION(this->scratch_space, this->scratch_space->getMountPoint() + "/" + job->getName());
this->files_stored_in_scratch.insert(f);
}
}
StorageService::writeFiles(files_to_write);
Expand Down
2 changes: 1 addition & 1 deletion src/wrench/services/storage/StorageService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ namespace wrench {
if (this->hasMultipleMountPoints()) {
throw std::invalid_argument("StorageService::getAbsolutePath(): The storage service has more than one mount point");
}
return this->file_systems.begin()->first;
return wrench::FileLocation::sanitizePath(this->file_systems.begin()->first);
}


Expand Down
7 changes: 5 additions & 2 deletions src/wrench/services/storage/simple/SimpleStorageService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,11 @@ namespace wrench {

if ((not fs->doesDirectoryExist(location->getAbsolutePathAtMountPoint())) or
(not fs->isFileInDirectory(file, location->getAbsolutePathAtMountPoint()))) {
failure_cause = std::shared_ptr<FailureCause>(
new FileNotFound(file, location));
// If this is scratch, we don't care, perhaps it was taken care of elsewhere...
if (not this->isScratch()) {
failure_cause = std::shared_ptr<FailureCause>(
new FileNotFound(file, location));
}
} else {
fs->removeFileFromDirectory(file, location->getAbsolutePathAtMountPoint());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace wrench {
createDirectory(absolute_path);
}

this->content[absolute_path].insert(file);
this->content[absolute_path].insert(file);
std::string key = FileLocation::sanitizePath(absolute_path) + file->getID();
if (this->reserved_space.find(key) == this->reserved_space.end()) {
this->occupied_space += file->getSize();
Expand Down
Loading

0 comments on commit 1600c00

Please sign in to comment.