@Override public byte getStoragePolicyID() { byte id = getLocalStoragePolicyID(); if (id != BLOCK_STORAGE_POLICY_ID_UNSPECIFIED) { return id; } // if it is unspecified, check its parent return getParent() != null ? getParent().getStoragePolicyID() : BLOCK_STORAGE_POLICY_ID_UNSPECIFIED; }
@Override public byte getStoragePolicyID() { byte id = getLocalStoragePolicyID(); if (id == BLOCK_STORAGE_POLICY_ID_UNSPECIFIED) { id = this.getParent() != null ? this.getParent().getStoragePolicyID() : id; } // For Striped EC files, we support only suitable policies. Current // supported policies are HOT, COLD, ALL_SSD. // If the file was set with any other policies, then we just treat policy as // BLOCK_STORAGE_POLICY_ID_UNSPECIFIED. if (isStriped() && id != BLOCK_STORAGE_POLICY_ID_UNSPECIFIED && !ErasureCodingPolicyManager .checkStoragePolicySuitableForECStripedMode(id)) { id = HdfsConstants.BLOCK_STORAGE_POLICY_ID_UNSPECIFIED; if (LOG.isDebugEnabled()) { LOG.debug("The current effective storage policy id : " + id + " is not suitable for striped mode EC file : " + getName() + ". So, just returning unspecified storage policy id"); } } return id; }
/** * Update the count of each directory with quota in the namespace. * A directory's count is defined as the total number inodes in the tree * rooted at the directory. * * This is an update of existing state of the filesystem and does not * throw QuotaExceededException. */ void updateCountForQuota(int initThreads) { writeLock(); try { int threads = (initThreads < 1) ? 1 : initThreads; LOG.info("Initializing quota with " + threads + " thread(s)"); long start = Time.monotonicNow(); QuotaCounts counts = new QuotaCounts.Builder().build(); ForkJoinPool p = new ForkJoinPool(threads); RecursiveAction task = new InitQuotaTask(getBlockStoragePolicySuite(), rootDir.getStoragePolicyID(), rootDir, counts); p.execute(task); task.join(); p.shutdown(); LOG.info("Quota initialization completed in " + (Time.monotonicNow() - start) + " milliseconds\n" + counts); } finally { writeUnlock(); } }
@Override public byte getStoragePolicyID() { byte id = getLocalStoragePolicyID(); if (id != ID_UNSPECIFIED) { return id; } // if it is unspecified, check its parent return getParent() != null ? getParent().getStoragePolicyID() : ID_UNSPECIFIED; }
@Override public byte getStoragePolicyID() { byte id = getLocalStoragePolicyID(); if (id != ID_UNSPECIFIED) { return id; } // if it is unspecified, check its parent return getParent() != null ? getParent().getStoragePolicyID() : ID_UNSPECIFIED; }
@Override public byte getStoragePolicyID() { byte id = getLocalStoragePolicyID(); if (id == ID_UNSPECIFIED) { return this.getParent() != null ? this.getParent().getStoragePolicyID() : id; } return id; }
@Override public byte getStoragePolicyID() { byte id = getLocalStoragePolicyID(); if (id == ID_UNSPECIFIED) { return this.getParent() != null ? this.getParent().getStoragePolicyID() : id; } return id; }
/** * Update the count of each directory with quota in the namespace. * A directory's count is defined as the total number inodes in the tree * rooted at the directory. * * This is an update of existing state of the filesystem and does not * throw QuotaExceededException. */ static void updateCountForQuota(BlockStoragePolicySuite bsps, INodeDirectory root) { updateCountForQuotaRecursively(bsps, root.getStoragePolicyID(), root, new QuotaCounts.Builder().build()); }
/** * Update the count of each directory with quota in the namespace. * A directory's count is defined as the total number inodes in the tree * rooted at the directory. * * This is an update of existing state of the filesystem and does not * throw QuotaExceededException. */ static void updateCountForQuota(BlockStoragePolicySuite bsps, INodeDirectory root, int threads) { threads = (threads < 1) ? 1 : threads; LOG.info("Initializing quota with " + threads + " thread(s)"); long start = Time.now(); QuotaCounts counts = new QuotaCounts.Builder().build(); ForkJoinPool p = new ForkJoinPool(threads); RecursiveAction task = new InitQuotaTask(bsps, root.getStoragePolicyID(), root, counts); p.execute(task); task.join(); p.shutdown(); LOG.info("Quota initialization completed in " + (Time.now() - start) + " milliseconds\n" + counts); }