/** Updates namespace and diskspace consumed for all * directories until the parent directory of file represented by path. * * @param path path for the file. * @param nsDelta the delta change of namespace * @param dsDelta the delta change of diskspace * @throws QuotaExceededException if the new count violates any quota limit * @throws FileNotFound if path does not exist. */ void updateSpaceConsumed(String path, long nsDelta, long dsDelta) throws QuotaExceededException, FileNotFoundException { updateSpaceConsumed(path, null, nsDelta, dsDelta); }
updateSpaceConsumed(iip, 0, -diff, replicationFactor); } catch (IOException e) { LOG.warn("Unexpected exception while updating disk space.", e);
/** * Update the cached quota space for a block that is being completed. * Must only be called once, as the block is being completed. * @param completeBlk - Completed block for which to update space * @param inodes - INodes in path to file containing completeBlk; if null * this will be resolved internally */ public void updateSpaceForCompleteBlock(BlockInfoContiguous completeBlk, INodesInPath inodes) throws IOException { assert namesystem.hasWriteLock(); INodesInPath iip = inodes != null ? inodes : INodesInPath.fromINode((INodeFile) completeBlk.getBlockCollection()); INodeFile fileINode = iip.getLastINode().asFile(); // Adjust disk space consumption if required final long diff = fileINode.getPreferredBlockSize() - completeBlk.getNumBytes(); if (diff > 0) { try { updateSpaceConsumed(iip, 0, -diff, fileINode.getFileReplication()); } catch (IOException e) { LOG.warn("Unexpected exception while updating disk space.", e); } } }
if (updateDiskspace && (dsNew = newnode.diskspaceConsumed()) != dsOld) { try { updateSpaceConsumed(path, 0, dsNew-dsOld); } catch (QuotaExceededException e) {
/** * Update the cached quota space for a block that is being completed. * Must only be called once, as the block is being completed. * @param completeBlk - Completed block for which to update space * @param inodes - INodes in path to file containing completeBlk; if null * this will be resolved internally */ public void updateSpaceForCompleteBlock(BlockInfoContiguous completeBlk, INodesInPath inodes) throws IOException { assert namesystem.hasWriteLock(); INodesInPath iip = inodes != null ? inodes : INodesInPath.fromINode((INodeFile) completeBlk.getBlockCollection()); INodeFile fileINode = iip.getLastINode().asFile(); // Adjust disk space consumption if required final long diff = fileINode.getPreferredBlockSize() - completeBlk.getNumBytes(); if (diff > 0) { try { updateSpaceConsumed(iip, 0, -diff, fileINode.getFileReplication()); } catch (IOException e) { LOG.warn("Unexpected exception while updating disk space.", e); } } }
if (updateDiskspace && (dsNew = newnode.diskspaceConsumed()) != dsOld) { try { updateSpaceConsumed(path, null, 0, dsNew-dsOld); } catch (QuotaExceededException e) {
dir.updateSpaceConsumed(path, 0, -diff*file.getReplication()); } catch (IOException e) { LOG.warn("Unexpected exception while updating disk space : " +
dir.updateSpaceConsumed(cons.getFullPathName(), inodes, 0, -diff * file.getReplication()); } catch (IOException e) {