synchronized void removeLease(long inodeId) { final Lease lease = leasesById.get(inodeId); if (lease != null) { removeLease(lease, inodeId); } }
/** * Remove the lease for the specified holder and src */ synchronized void removeLease(String holder, INodeFile src) { Lease lease = getLease(holder); if (lease != null) { removeLease(lease, src.getId()); } else { LOG.warn("Removing non-existent lease! holder={} src={}", holder, src .getFullPathName()); } }
/** * Reassign lease for file src to the new holder. */ synchronized Lease reassignLease(Lease lease, INodeFile src, String newHolder) { assert newHolder != null : "new lease holder is null"; if (lease != null) { removeLease(lease, src.getId()); } return addLease(newHolder, src.getId()); }
/** * Remove leases and inodes related to a given path * @param removedUCFiles INodes whose leases need to be released * @param removedINodes Containing the list of inodes to be removed from * inodesMap * @param acquireINodeMapLock Whether to acquire the lock for inode removal */ void removeLeasesAndINodes(List<Long> removedUCFiles, List<INode> removedINodes, final boolean acquireINodeMapLock) { assert hasWriteLock(); for(long i : removedUCFiles) { leaseManager.removeLease(i); } // remove inodes from inodesMap if (removedINodes != null) { if (acquireINodeMapLock) { dir.writeLock(); } try { dir.removeFromInodeMap(removedINodes); } finally { if (acquireINodeMapLock) { dir.writeUnlock(); } } removedINodes.clear(); } }
if (fsnamesystem.isFileDeleted(lastINode)) { removeLease(lastINode.getId()); continue; removeLease(leaseToCheck, id);
void finalizeINodeFileUnderConstruction(String src, INodeFile pendingFile, int latestSnapshot, boolean allowCommittedBlock) throws IOException { assert hasWriteLock(); FileUnderConstructionFeature uc = pendingFile.getFileUnderConstructionFeature(); if (uc == null) { throw new IOException("Cannot finalize file " + src + " because it is not under construction"); } pendingFile.recordModification(latestSnapshot); // The file is no longer pending. // Create permanent INode, update blocks. No need to replace the inode here // since we just remove the uc feature from pendingFile pendingFile.toCompleteFile(now(), allowCommittedBlock? numCommittedAllowed: 0, blockManager.getMinReplication()); leaseManager.removeLease(uc.getClientName(), pendingFile); // close file and persist block allocations for this file closeFile(src, pendingFile); blockManager.checkRedundancy(pendingFile); }
/** * Remove the lease for the specified holder and src */ synchronized void removeLease(String holder, String src) { Lease lease = getLease(holder); if (lease != null) { removeLease(lease, src); } else { LOG.warn("Removing non-existent lease! holder=" + holder + " src=" + src); } }
/** * Reassign lease for file src to the new holder. */ synchronized Lease reassignLease(Lease lease, String src, String newHolder) { assert newHolder != null : "new lease holder is null"; if (lease != null) { removeLease(lease, src); } return addLease(newHolder, src); }
/** * Remove the lease for the specified holder and src */ synchronized void removeLease(StringBytesWritable holder, String src ) throws IOException { Lease lease = getLease(holder); if (lease != null) { removeLease(lease, src); } }
/** * Reassign lease for file src to the new holder. */ synchronized Lease reassignLease(Lease lease, String src, String newHolder) { assert newHolder != null : "new lease holder is null"; if (lease != null) { removeLease(lease, src); } return addLease(newHolder, src); }
synchronized void removeLeaseWithPrefixPath(String prefix) { for(Map.Entry<String, Lease> entry : findLeaseWithPrefixPath(prefix, sortedLeasesByPath).entrySet()) { if (LOG.isDebugEnabled()) { LOG.debug(LeaseManager.class.getSimpleName() + ".removeLeaseWithPrefixPath: entry=" + entry); } removeLease(entry.getValue(), entry.getKey()); } }
/** * Remove the lease for the specified holder and src */ synchronized void removeLease(String holder, String src) { Lease lease = getLease(holder); if (lease != null) { removeLease(lease, src); } }
synchronized void removeLeaseWithPrefixPath(String prefix) { for(Map.Entry<String, LeaseOpenTime> entry : findLeaseWithPrefixPath(prefix, sortedLeasesByPath)) { if (LOG.isDebugEnabled()) { LOG.debug(LeaseManager.class.getSimpleName() + ".removeLeaseWithPrefixPath: entry=" + entry); } removeLease(entry.getValue().lease, entry.getKey()); } }
synchronized void removeLeaseWithPrefixPath(String prefix) throws IOException { for(Map.Entry<String, Lease> entry : findLeaseWithPrefixPath(prefix, sortedLeasesByPath)) { if (LOG.isDebugEnabled()) { LOG.debug(LeaseManager.class.getSimpleName() + ".removeLeaseWithPrefixPath: entry=" + entry); } removeLease(entry.getValue(), entry.getKey()); } }
/** * Reassign lease for file src to the new holder. */ synchronized Lease reassignLease(Lease lease, String src, String newHolder) { assert newHolder != null : "new lease holder is null"; LeaseOpenTime leaseOpenTime = null; if (lease != null) { leaseOpenTime = removeLease(lease, src); } return addLease(newHolder, src, leaseOpenTime != null ? leaseOpenTime.openTime : System.currentTimeMillis()); }
synchronized void removeLeaseWithPrefixPath(String prefix) { for(Map.Entry<String, Lease> entry : findLeaseWithPrefixPath(prefix, sortedLeasesByPath).entrySet()) { if (LOG.isDebugEnabled()) { LOG.debug(LeaseManager.class.getSimpleName() + ".removeLeaseWithPrefixPath: entry=" + entry); } removeLease(entry.getValue(), entry.getKey()); } }
/** * Remove the lease for the specified holder and src */ synchronized void removeLease(String holder, String src) { Lease lease = getLease(holder); if (lease != null) { removeLease(lease, src); } else { LOG.warn("Removing non-existent lease! holder=" + holder + " src=" + src); } }
private void finalizeINodeFileUnderConstruction(String src, INodeFileUnderConstruction pendingFile) throws IOException { leaseManager.removeLease(pendingFile.clientName, src); // The file is no longer pending. // Create permanent INode, update blockmap INodeFile newFile = pendingFile.convertToInodeFile(); dir.replaceNode(src, pendingFile, newFile); // close file and persist block allocations for this file dir.closeFile(src, newFile); checkReplicationFactor(newFile); }
fsNamesys.getLeaseManager().removeLease(file.getId()); file.toCompleteFile(file.getModificationTime(), 0, fsNamesys.getBlockManager().getMinReplication());
private void finalizeINodeFileUnderConstruction(String src, INode[] inodes, INodeFileUnderConstruction pendingFile) throws IOException { // Put last block in needed replication queue if uder replicated replicateLastBlock(src, pendingFile); leaseManager.removeLease(pendingFile.getClientName(), src); DatanodeDescriptor[] descriptors = pendingFile.getTargets(); if (descriptors != null) { for (DatanodeDescriptor node : descriptors) { node.removeINode(pendingFile); } } // The file is no longer pending. // Create permanent INode, update blockmap INodeFile newFile = pendingFile.convertToInodeFile(); dir.replaceNode(src, inodes, pendingFile, newFile, true); // close file and persist block allocations for this file dir.closeFile(src, newFile); }