private static INodeDirectory createRoot(FSNamesystem namesystem) { final INodeDirectory r = new INodeDirectory( INodeId.ROOT_INODE_ID, INodeDirectory.ROOT_NAME, namesystem.createFsOwnerPermissions(new FsPermission((short) 0755)), 0L); r.addDirectoryWithQuotaFeature( new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(DirectoryWithQuotaFeature.DEFAULT_NAMESPACE_QUOTA). storageSpaceQuota(DirectoryWithQuotaFeature.DEFAULT_STORAGE_SPACE_QUOTA). build()); r.addSnapshottableFeature(); r.setSnapshotQuota(0); return r; }
if (nsQuota >= 0 || dsQuota >= 0) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(nsQuota).storageSpaceQuota(dsQuota).build());
private static INodeDirectory createRoot(FSNamesystem namesystem) { final INodeDirectory r = new INodeDirectory( INodeId.ROOT_INODE_ID, INodeDirectory.ROOT_NAME, namesystem.createFsOwnerPermissions(new FsPermission((short) 0755)), 0L); r.addDirectoryWithQuotaFeature( new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(DirectoryWithQuotaFeature.DEFAULT_NAMESPACE_QUOTA). storageSpaceQuota(DirectoryWithQuotaFeature.DEFAULT_STORAGE_SPACE_QUOTA). build()); r.addSnapshottableFeature(); r.setSnapshotQuota(0); return r; }
if (nsQuota >= 0 || dsQuota >= 0) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(nsQuota).storageSpaceQuota(dsQuota).build());
if (nsQuota >= 0 || dsQuota >= 0) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(nsQuota).storageSpaceQuota(dsQuota).build());
if (nsQuota >= 0 || dsQuota >= 0) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(nsQuota).storageSpaceQuota(dsQuota).build()); if (q == null) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature. Builder().typeQuotas(typeQuotas).build()); } else { q.setQuota(typeQuotas);
if (nsQuota >= 0 || dsQuota >= 0) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(nsQuota).storageSpaceQuota(dsQuota).build()); if (q == null) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature. Builder().typeQuotas(typeQuotas).build()); } else { q.setQuota(typeQuotas);
void setQuota(BlockStoragePolicySuite bsps, long nsQuota, long ssQuota, StorageType type) { DirectoryWithQuotaFeature quota = getDirectoryWithQuotaFeature(); if (quota != null) { // already has quota; so set the quota to the new values if (type != null) { quota.setQuota(ssQuota, type); } else { quota.setQuota(nsQuota, ssQuota); } if (!isQuotaSet() && !isRoot()) { removeFeature(quota); } } else { final QuotaCounts c = computeQuotaUsage(bsps); DirectoryWithQuotaFeature.Builder builder = new DirectoryWithQuotaFeature.Builder().nameSpaceQuota(nsQuota); if (type != null) { builder.typeQuota(type, ssQuota); } else { builder.storageSpaceQuota(ssQuota); } addDirectoryWithQuotaFeature(builder.build()).setSpaceConsumed(c); } }
void setQuota(BlockStoragePolicySuite bsps, long nsQuota, long ssQuota, StorageType type) { DirectoryWithQuotaFeature quota = getDirectoryWithQuotaFeature(); if (quota != null) { // already has quota; so set the quota to the new values if (type != null) { quota.setQuota(ssQuota, type); } else { quota.setQuota(nsQuota, ssQuota); } if (!isQuotaSet() && !isRoot()) { removeFeature(quota); } } else { final QuotaCounts c = computeQuotaUsage(bsps); DirectoryWithQuotaFeature.Builder builder = new DirectoryWithQuotaFeature.Builder().nameSpaceQuota(nsQuota); if (type != null) { builder.typeQuota(type, ssQuota); } else { builder.storageSpaceQuota(ssQuota); } addDirectoryWithQuotaFeature(builder.build()).setSpaceConsumed(c); } }
private static INodeDirectory createRoot(FSNamesystem namesystem) { final INodeDirectory r = new INodeDirectory( INodeId.ROOT_INODE_ID, INodeDirectory.ROOT_NAME, namesystem.createFsOwnerPermissions(new FsPermission((short) 0755)), 0L); r.addDirectoryWithQuotaFeature( new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(DirectoryWithQuotaFeature.DEFAULT_NAMESPACE_QUOTA). storageSpaceQuota(DirectoryWithQuotaFeature.DEFAULT_STORAGE_SPACE_QUOTA). build()); r.addSnapshottableFeature(); r.setSnapshotQuota(0); return r; }
if (nsQuota >= 0 || dsQuota >= 0) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature.Builder(). nameSpaceQuota(nsQuota).storageSpaceQuota(dsQuota).build()); if (q == null) { dir.addDirectoryWithQuotaFeature(new DirectoryWithQuotaFeature. Builder().typeQuotas(typeQuotas).build()); } else { q.setQuota(typeQuotas);
void setQuota(BlockStoragePolicySuite bsps, long nsQuota, long ssQuota, StorageType type) { DirectoryWithQuotaFeature quota = getDirectoryWithQuotaFeature(); if (quota != null) { // already has quota; so set the quota to the new values if (type != null) { quota.setQuota(ssQuota, type); } else { quota.setQuota(nsQuota, ssQuota); } if (!isQuotaSet() && !isRoot()) { removeFeature(quota); } } else { final QuotaCounts c = computeQuotaUsage(bsps); DirectoryWithQuotaFeature.Builder builder = new DirectoryWithQuotaFeature.Builder().nameSpaceQuota(nsQuota); if (type != null) { builder.typeQuota(type, ssQuota); } else { builder.storageSpaceQuota(ssQuota); } addDirectoryWithQuotaFeature(builder.build()).setSpaceConsumed(c); } }