Skip to content

Commit

Permalink
[HWORKS-908] Fix NPE in ProjectQouataController for a project that fa…
Browse files Browse the repository at this point in the history
…iled to get c… (#1663) (#1450)
  • Loading branch information
gibchikafa authored Jan 10, 2024
1 parent fb4f442 commit 30b04fe
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ public Quotas getQuotas(Project project) {
quotas.setYarnQuotaInSecs(yarnQuotaOpt.get().getQuotaRemaining());
quotas.setYarnUsedQuotaInSecs(yarnQuotaOpt.get().getTotal());
}

// HDFS project directory quota
Optional<HdfsDirectoryWithQuotaFeature> projectInodeAttrsOptional =
hdfsDirectoryWithQuotaFeatureFacade.getByInodeId(inodeController.getProjectRoot(project.getName()).getId());
Inode projectRootInode = inodeController.getProjectRoot(project.getName());
Optional<HdfsDirectoryWithQuotaFeature> projectInodeAttrsOptional = Optional.empty();
if (projectRootInode != null) {
projectInodeAttrsOptional = hdfsDirectoryWithQuotaFeatureFacade.getByInodeId(projectRootInode.getId());
}

if (projectInodeAttrsOptional.isPresent()) {
// storage quota
Long storageQuota = projectInodeAttrsOptional.get().getSsquota().longValue();
Expand Down

0 comments on commit 30b04fe

Please sign in to comment.