Skip to content

Commit

Permalink
Fixed class code format
Browse files Browse the repository at this point in the history
  • Loading branch information
enricovianello committed Dec 21, 2015
1 parent 2e708d2 commit 4ffa389
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/main/java/it/grid/storm/space/SimpleSpaceUpdaterHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,53 @@ private StorageSpaceData getStorageSpaceDataForVFS(VirtualFSInterface vfs) {
public boolean increaseUsedSpace(VirtualFSInterface vfs, long size) {

log.debug("Increase {} used space: {} bytes ", vfs.getAliasName(), size);

if (size < 0) {
log.error("Size to add is a negative value: {}", size);
return false;
return false;
}
if (size == 0) {
log.debug("Size is zero, vfs {} used space won't be increased!", vfs.getAliasName());
log.debug("Size is zero, vfs {} used space won't be increased!",
vfs.getAliasName());
return true;
}

log.debug("Get StorageSpaceData from vfs ...");
StorageSpaceData ssd = getStorageSpaceDataForVFS(vfs);

if (ssd == null) {
log.error("Unable to get StorageSpaceData from alias name {}", vfs.getAliasName());
return false;
log.error("Unable to get StorageSpaceData from alias name {}",
vfs.getAliasName());
return false;
}

return rsc.increaseUsedSpace(ssd.getSpaceToken().getValue(), size);
}

@Override
public boolean decreaseUsedSpace(VirtualFSInterface vfs, long size) {

log.debug("Decrease {} used space: {} bytes ", vfs.getAliasName(), size);

if (size < 0) {
log.error("Size to remove is a negative value: {}", size);
return false;
return false;
}
if (size == 0) {
log.debug("Size is zero, vfs {} used space won't be decreased!", vfs.getAliasName());
log.debug("Size is zero, vfs {} used space won't be decreased!",
vfs.getAliasName());
return true;
}

log.debug("Get StorageSpaceData from vfs ...");
StorageSpaceData ssd = getStorageSpaceDataForVFS(vfs);

if (ssd == null) {
log.error("Unable to get StorageSpaceData from alias name {}", vfs.getAliasName());
return false;
}

log.error("Unable to get StorageSpaceData from alias name {}",
vfs.getAliasName());
return false;
}

return rsc.decreaseUsedSpace(ssd.getSpaceToken().getValue(), size);
}

Expand Down

0 comments on commit 4ffa389

Please sign in to comment.