/** @return a string description of the parent. */ @VisibleForTesting public final String getParentString() { final INodeReference parentRef = getParentReference(); if (parentRef != null) { return "parentRef=" + parentRef.getLocalName() + "->"; } else { final INodeDirectory parentDir = getParent(); if (parentDir != null) { return "parentDir=" + parentDir.getLocalName() + "/"; } else { return "parent=null"; } } }
/** @return the parent directory */ public final INodeDirectory getParent() { return parent == null? null : parent.isReference()? getParentReference().getParent(): parent.asDirectory(); }
inode = ((WithCount) inode).getParentRef(snapshotId); } else { INode parent = inode.getParentReference() != null ? inode .getParentReference() : inode.getParent(); if (parent != null && parent instanceof INodeDirectory) { int sid = parent.asDirectory().searchChild(inode);
/** * When {@link #recordModification} is called on a referred node, * this method tells which snapshot the modification should be * associated with: the snapshot that belongs to the SRC tree of the rename * operation, or the snapshot belonging to the DST tree. * * @param latestInDst * id of the latest snapshot in the DST tree above the reference node * @return True: the modification should be recorded in the snapshot that * belongs to the SRC tree. False: the modification should be * recorded in the snapshot that belongs to the DST tree. */ public final boolean shouldRecordInSrcSnapshot(final int latestInDst) { Preconditions.checkState(!isReference()); if (latestInDst == Snapshot.CURRENT_STATE_ID) { return true; } INodeReference withCount = getParentReference(); if (withCount != null) { int dstSnapshotId = withCount.getParentReference().getDstSnapshotId(); if (dstSnapshotId != Snapshot.CURRENT_STATE_ID && dstSnapshotId >= latestInDst) { return true; } } return false; }
private INodeReference loadINodeReference( INodeReferenceSection.INodeReference r) { long referredId = r.getReferredId(); INode referred = fsDir.getInode(referredId); WithCount withCount = (WithCount) referred.getParentReference(); if (withCount == null) { withCount = new INodeReference.WithCount(null, referred); } final INodeReference ref; if (r.hasDstSnapshotId()) { // DstReference ref = new INodeReference.DstReference(null, withCount, r.getDstSnapshotId()); } else { ref = new INodeReference.WithName(null, withCount, r.getName() .toByteArray(), r.getLastSnapshotId()); } return ref; }
INodeReference ref = getReferredINode().getParentReference(); if (ref != null) { QuotaCounts current = reclaimContext.quotaDelta().getCountsCopy();
INodeReference ref = getReferredINode().getParentReference(); if (ref != null) {
/** @return a string description of the parent. */ @VisibleForTesting public final String getParentString() { final INodeReference parentRef = getParentReference(); if (parentRef != null) { return "parentRef=" + parentRef.getLocalName() + "->"; } else { final INodeDirectory parentDir = getParent(); if (parentDir != null) { return "parentDir=" + parentDir.getLocalName() + "/"; } else { return "parent=null"; } } }
/** @return the parent directory */ public final INodeDirectory getParent() { return parent == null? null : parent.isReference()? getParentReference().getParent(): parent.asDirectory(); }
/** @return the parent directory */ public final INodeDirectory getParent() { return parent == null? null : parent.isReference()? getParentReference().getParent(): parent.asDirectory(); }
inode = ((WithCount) inode).getParentRef(snapshotId); } else { INode parent = inode.getParentReference() != null ? inode .getParentReference() : inode.getParent(); if (parent != null && parent instanceof INodeDirectory) { int sid = parent.asDirectory().searchChild(inode);
/** * When {@link #recordModification} is called on a referred node, * this method tells which snapshot the modification should be * associated with: the snapshot that belongs to the SRC tree of the rename * operation, or the snapshot belonging to the DST tree. * * @param latestInDst * id of the latest snapshot in the DST tree above the reference node * @return True: the modification should be recorded in the snapshot that * belongs to the SRC tree. False: the modification should be * recorded in the snapshot that belongs to the DST tree. */ public final boolean shouldRecordInSrcSnapshot(final int latestInDst) { Preconditions.checkState(!isReference()); if (latestInDst == Snapshot.CURRENT_STATE_ID) { return true; } INodeReference withCount = getParentReference(); if (withCount != null) { int dstSnapshotId = withCount.getParentReference().getDstSnapshotId(); if (dstSnapshotId != Snapshot.CURRENT_STATE_ID && dstSnapshotId >= latestInDst) { return true; } } return false; }
inode = ((WithCount) inode).getParentRef(snapshotId); } else { INode parent = inode.getParentReference() != null ? inode .getParentReference() : inode.getParent(); if (parent != null && parent instanceof INodeDirectory) { int sid = parent.asDirectory().searchChild(inode);
/** @return a string description of the parent. */ @VisibleForTesting public final String getParentString() { final INodeReference parentRef = getParentReference(); if (parentRef != null) { return "parentRef=" + parentRef.getLocalName() + "->"; } else { final INodeDirectory parentDir = getParent(); if (parentDir != null) { return "parentDir=" + parentDir.getLocalName() + "/"; } else { return "parent=null"; } } }
/** * When {@link #recordModification} is called on a referred node, * this method tells which snapshot the modification should be * associated with: the snapshot that belongs to the SRC tree of the rename * operation, or the snapshot belonging to the DST tree. * * @param latestInDst * id of the latest snapshot in the DST tree above the reference node * @return True: the modification should be recorded in the snapshot that * belongs to the SRC tree. False: the modification should be * recorded in the snapshot that belongs to the DST tree. */ public final boolean shouldRecordInSrcSnapshot(final int latestInDst) { Preconditions.checkState(!isReference()); if (latestInDst == Snapshot.CURRENT_STATE_ID) { return true; } INodeReference withCount = getParentReference(); if (withCount != null) { int dstSnapshotId = withCount.getParentReference().getDstSnapshotId(); if (dstSnapshotId != Snapshot.CURRENT_STATE_ID && dstSnapshotId >= latestInDst) { return true; } } return false; }
private INodeReference loadINodeReference( INodeReferenceSection.INodeReference r) throws IOException { long referredId = r.getReferredId(); INode referred = fsDir.getInode(referredId); WithCount withCount = (WithCount) referred.getParentReference(); if (withCount == null) { withCount = new INodeReference.WithCount(null, referred); } final INodeReference ref; if (r.hasDstSnapshotId()) { // DstReference ref = new INodeReference.DstReference(null, withCount, r.getDstSnapshotId()); } else { ref = new INodeReference.WithName(null, withCount, r.getName() .toByteArray(), r.getLastSnapshotId()); } return ref; }
INodeReference ref = getReferredINode().getParentReference(); if (ref != null) { try {
private INodeReference loadINodeReference( INodeReferenceSection.INodeReference r) throws IOException { long referredId = r.getReferredId(); INode referred = fsDir.getInode(referredId); WithCount withCount = (WithCount) referred.getParentReference(); if (withCount == null) { withCount = new INodeReference.WithCount(null, referred); } final INodeReference ref; if (r.hasDstSnapshotId()) { // DstReference ref = new INodeReference.DstReference(null, withCount, r.getDstSnapshotId()); } else { ref = new INodeReference.WithName(null, withCount, r.getName() .toByteArray(), r.getLastSnapshotId()); } return ref; }
QuotaCounts counts = referred.cleanSubtree(bsps, snapshot, prior, collectedBlocks, removedINodes); INodeReference ref = getReferredINode().getParentReference(); if (ref != null) { ref.addSpaceConsumed(counts.negation(), true);
INodeReference ref = getReferredINode().getParentReference(); if (ref != null) { try {