@Override public boolean metadataEquals(INodeDirectoryAttributes other) { return other != null && getQuotaCounts().equals(other.getQuotaCounts()) && getPermissionLong() == other.getPermissionLong() && getAclFeature() == other.getAclFeature() && getXAttrFeature() == other.getXAttrFeature(); } }
public static INodeSection.INodeDirectory.Builder buildINodeDirectory( INodeDirectoryAttributes dir, final SaverContext state) { QuotaCounts quota = dir.getQuotaCounts(); INodeSection.INodeDirectory.Builder b = INodeSection.INodeDirectory .newBuilder().setModificationTime(dir.getModificationTime()) .setNsQuota(quota.getNameSpace()) .setDsQuota(quota.getStorageSpace()) .setPermission(buildPermissionStatus(dir)); if (quota.getTypeSpaces().anyGreaterOrEqual(0)) { b.setTypeQuotas(buildQuotaByStorageTypeEntries(quota)); } AclFeature f = dir.getAclFeature(); if (f != null) { b.setAcl(buildAclEntries(f)); } XAttrFeature xAttrFeature = dir.getXAttrFeature(); if (xAttrFeature != null) { b.setXAttrs(buildXAttrs(xAttrFeature)); } return b; }
if (dirCopy == null) { dirCopy = sdiff.snapshotINode; } else if (!dirCopy.metadataEquals(sdiff.snapshotINode)) { dirMetadataChanged = true; } else if (dirCopy != null) { for (int i = laterDiffIndex; i < difflist.size(); i++) { if (!dirCopy.metadataEquals(difflist.get(i).snapshotINode)) { return true; return !dirCopy.metadataEquals(currentINode); } else { return false;
/** * Serialize a {@link INodeDirectory} * @param a The node to write * @param out The {@link DataOutput} where the fields are written */ public static void writeINodeDirectoryAttributes( INodeDirectoryAttributes a, DataOutput out) throws IOException { writeLocalName(a, out); writePermissionStatus(a, out); out.writeLong(a.getModificationTime()); writeQuota(a.getQuotaCounts(), out); }
@Override void destroyDiffAndCollectBlocks( INode.ReclaimContext reclaimContext, INodeDirectory currentINode) { // this diff has been deleted diff.destroyDeletedList(reclaimContext); INodeDirectoryAttributes snapshotINode = getSnapshotINode(); if (snapshotINode != null && snapshotINode.getAclFeature() != null) { AclStorage.removeAclFeature(snapshotINode.getAclFeature()); } } }
INodeDirectoryAttributes copy = diff.snapshotINode; if (!diff.isSnapshotRoot() && copy != null) { db.setName(ByteString.copyFrom(copy.getLocalNameBytes())) .setSnapshotCopy( buildINodeDirectory(copy, parent.getSaverContext()));
/** * Serialize a {@link INodeDirectory} * @param a The node to write * @param out The {@link DataOutput} where the fields are written */ public static void writeINodeDirectoryAttributes( INodeDirectoryAttributes a, DataOutput out) throws IOException { writeLocalName(a, out); writePermissionStatus(a, out); out.writeLong(a.getModificationTime()); writeQuota(a.getQuotaCounts(), out); }
@Override QuotaCounts destroyDiffAndCollectBlocks( BlockStoragePolicySuite bsps, INodeDirectory currentINode, BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes) { // this diff has been deleted QuotaCounts counts = new QuotaCounts.Builder().build(); counts.add(diff.destroyDeletedList(bsps, collectedBlocks, removedINodes)); INodeDirectoryAttributes snapshotINode = getSnapshotINode(); if (snapshotINode != null && snapshotINode.getAclFeature() != null) { AclStorage.removeAclFeature(snapshotINode.getAclFeature()); } return counts; } }
INodeDirectoryAttributes copy = diff.snapshotINode; if (!diff.isSnapshotRoot() && copy != null) { db.setName(ByteString.copyFrom(copy.getLocalNameBytes())) .setSnapshotCopy( buildINodeDirectory(copy, parent.getSaverContext()));
/** * Compare the metadata with another INodeDirectory */ @Override public boolean metadataEquals(INodeDirectoryAttributes other) { return other != null && getQuotaCounts().equals(other.getQuotaCounts()) && getPermissionLong() == other.getPermissionLong() && getAclFeature() == other.getAclFeature() && getXAttrFeature() == other.getXAttrFeature(); }
public static INodeSection.INodeDirectory.Builder buildINodeDirectory( INodeDirectoryAttributes dir, final SaverContext state) { QuotaCounts quota = dir.getQuotaCounts(); INodeSection.INodeDirectory.Builder b = INodeSection.INodeDirectory .newBuilder().setModificationTime(dir.getModificationTime()) .setNsQuota(quota.getNameSpace()) .setDsQuota(quota.getStorageSpace()) .setPermission(buildPermissionStatus(dir, state.getStringMap())); if (quota.getTypeSpaces().anyGreaterOrEqual(0)) { b.setTypeQuotas(buildQuotaByStorageTypeEntries(quota)); } AclFeature f = dir.getAclFeature(); if (f != null) { b.setAcl(buildAclEntries(f, state.getStringMap())); } XAttrFeature xAttrFeature = dir.getXAttrFeature(); if (xAttrFeature != null) { b.setXAttrs(buildXAttrs(xAttrFeature, state.getStringMap())); } return b; }
/** * Serialize a {@link INodeDirectory} * @param a The node to write * @param out The {@link DataOutput} where the fields are written */ public static void writeINodeDirectoryAttributes( INodeDirectoryAttributes a, DataOutput out) throws IOException { writeLocalName(a, out); writePermissionStatus(a, out); out.writeLong(a.getModificationTime()); writeQuota(a.getQuotaCounts(), out); }
@Override QuotaCounts destroyDiffAndCollectBlocks( BlockStoragePolicySuite bsps, INodeDirectory currentINode, BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes) { // this diff has been deleted QuotaCounts counts = new QuotaCounts.Builder().build(); counts.add(diff.destroyDeletedList(bsps, collectedBlocks, removedINodes)); INodeDirectoryAttributes snapshotINode = getSnapshotINode(); if (snapshotINode != null && snapshotINode.getAclFeature() != null) { AclStorage.removeAclFeature(snapshotINode.getAclFeature()); } return counts; } }
if (dirCopy == null) { dirCopy = sdiff.snapshotINode; } else if (!dirCopy.metadataEquals(sdiff.snapshotINode)) { dirMetadataChanged = true; } else if (dirCopy != null) { for (int i = laterDiffIndex; i < difflist.size(); i++) { if (!dirCopy.metadataEquals(difflist.get(i).snapshotINode)) { return true; return !dirCopy.metadataEquals(currentINode); } else { return false;
INodeDirectoryAttributes copy = diff.snapshotINode; if (!diff.isSnapshotRoot() && copy != null) { db.setName(ByteString.copyFrom(copy.getLocalNameBytes())) .setSnapshotCopy( buildINodeDirectory(copy, parent.getSaverContext()));
@Override public boolean metadataEquals(INodeDirectoryAttributes other) { return other != null && getQuotaCounts().equals(other.getQuotaCounts()) && getPermissionLong() == other.getPermissionLong() && getAclFeature() == other.getAclFeature() && getXAttrFeature() == other.getXAttrFeature(); } }
public static INodeSection.INodeDirectory.Builder buildINodeDirectory( INodeDirectoryAttributes dir, final SaverContext state) { QuotaCounts quota = dir.getQuotaCounts(); INodeSection.INodeDirectory.Builder b = INodeSection.INodeDirectory .newBuilder().setModificationTime(dir.getModificationTime()) .setNsQuota(quota.getNameSpace()) .setDsQuota(quota.getStorageSpace()) .setPermission(buildPermissionStatus(dir, state.getStringMap())); if (quota.getTypeSpaces().anyGreaterOrEqual(0)) { b.setTypeQuotas(buildQuotaByStorageTypeEntries(quota)); } AclFeature f = dir.getAclFeature(); if (f != null) { b.setAcl(buildAclEntries(f, state.getStringMap())); } XAttrFeature xAttrFeature = dir.getXAttrFeature(); if (xAttrFeature != null) { b.setXAttrs(buildXAttrs(xAttrFeature, state.getStringMap())); } return b; }
if (dirCopy == null) { dirCopy = sdiff.snapshotINode; } else if (!dirCopy.metadataEquals(sdiff.snapshotINode)) { dirMetadataChanged = true; } else if (dirCopy != null) { for (int i = laterDiffIndex; i < difflist.size(); i++) { if (!dirCopy.metadataEquals(difflist.get(i).snapshotINode)) { return true; return !dirCopy.metadataEquals(currentINode); } else { return false;
@Override public boolean metadataEquals(INodeDirectoryAttributes other) { return other != null && getQuotaCounts().equals(other.getQuotaCounts()) && getPermissionLong() == other.getPermissionLong() && getAclFeature() == other.getAclFeature() && getXAttrFeature() == other.getXAttrFeature(); } }
/** * Compare the metadata with another INodeDirectory */ @Override public boolean metadataEquals(INodeDirectoryAttributes other) { return other != null && getQuotaCounts().equals(other.getQuotaCounts()) && getPermissionLong() == other.getPermissionLong() && getAclFeature() == other.getAclFeature() && getXAttrFeature() == other.getXAttrFeature(); }