/** Remove the given snapshottable directory from {@link #snapshottables}. */ private void removeSnapshottable(INodeDirectory s) { snapshottables.remove(s.getId()); }
/** Add the given snapshottable directory to {@link #snapshottables}. */ public void addSnapshottable(INodeDirectory dir) { Preconditions.checkArgument(dir.isSnapshottable()); snapshottables.put(dir.getId(), dir); }
/** * Serialize a {@link INodeDirectory} * @param node The node to write * @param out The {@link DataOutput} where the fields are written */ public static void writeINodeDirectory(INodeDirectory node, DataOutput out) throws IOException { writeLocalName(node, out); out.writeLong(node.getId()); out.writeShort(0); // replication out.writeLong(node.getModificationTime()); out.writeLong(0); // access time out.writeLong(0); // preferred block size out.writeInt(-1); // # of blocks writeQuota(node.getQuotaCounts(), out); if (node.isSnapshottable()) { out.writeBoolean(true); } else { out.writeBoolean(false); out.writeBoolean(node.isWithSnapshot()); } writePermissionStatus(node, out); }
dir.getFsPermission(), EnumSet.noneOf(HdfsFileStatus.Flags.class), dir.getUserName(), dir.getGroupName(), dir.getLocalNameBytes(), dir.getId(), dir.getChildrenNum(Snapshot.CURRENT_STATE_ID), dir.getDirectorySnapshottableFeature().getNumSnapshots(),
private void loadSnapshots(InputStream in, int size) throws IOException { for (int i = 0; i < size; i++) { SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot .parseDelimitedFrom(in); INodeDirectory root = loadINodeDirectory(pbs.getRoot(), parent.getLoaderContext()); int sid = pbs.getSnapshotId(); INodeDirectory parent = fsDir.getInode(root.getId()).asDirectory(); Snapshot snapshot = new Snapshot(sid, root, parent); // add the snapshot to parent, since we follow the sequence of // snapshotsByNames when saving, we do not need to sort when loading parent.getDirectorySnapshottableFeature().addSnapshot(snapshot); snapshotMap.put(sid, snapshot); } }
boolean toLoadSubtree = referenceMap.toProcessSubtree(parent.getId()); if (!toLoadSubtree) { return;
sf.computeDiffBetweenSnapshots(earlier, later, diff, dir); if (change) { if (!diffReport.addDirDiff(dir.getId(), relativePath, diff)) { return false;
DiffList<DirectoryDiff> diffList = sf.getDiffs().asList(); SnapshotDiffSection.DiffEntry entry = SnapshotDiffSection.DiffEntry .newBuilder().setInodeId(dir.getId()).setType(Type.DIRECTORYDIFF) .setNumOfDiff(diffList.size()).build(); entry.writeDelimitedTo(out); "Name '" + d.getLocalName() + "' is repeated in the " + "'deleted' difflist of directory " + dir.getFullPathName() + ", INodeId=" + dir.getId()); ++numImageErrors; } else if (result > 0 && !misordered) { FSImage.LOG.error( "Misordered entries in the 'deleted' difflist of directory " + dir.getFullPathName() + ", INodeId=" + dir.getId() + ". The full list is " + Arrays.toString(deleted.toArray()));
/** Remove the given snapshottable directory from {@link #snapshottables}. */ private void removeSnapshottable(INodeDirectory s) { snapshottables.remove(s.getId()); }
/** Remove the given snapshottable directory from {@link #snapshottables}. */ private void removeSnapshottable(INodeDirectory s) { snapshottables.remove(s.getId()); }
/** Add the given snapshottable directory to {@link #snapshottables}. */ public void addSnapshottable(INodeDirectory dir) { Preconditions.checkArgument(dir.isSnapshottable()); snapshottables.put(dir.getId(), dir); }
b.addSnapshottableDir(sdir.getId());
/** Add the given snapshottable directory to {@link #snapshottables}. */ public void addSnapshottable(INodeDirectory dir) { Preconditions.checkArgument(dir.isSnapshottable()); snapshottables.put(dir.getId(), dir); }
/** * Serialize a {@link INodeDirectory} * @param node The node to write * @param out The {@link DataOutput} where the fields are written */ public static void writeINodeDirectory(INodeDirectory node, DataOutput out) throws IOException { writeLocalName(node, out); out.writeLong(node.getId()); out.writeShort(0); // replication out.writeLong(node.getModificationTime()); out.writeLong(0); // access time out.writeLong(0); // preferred block size out.writeInt(-1); // # of blocks writeQuota(node.getQuotaCounts(), out); if (node.isSnapshottable()) { out.writeBoolean(true); } else { out.writeBoolean(false); out.writeBoolean(node.isWithSnapshot()); } writePermissionStatus(node, out); }
/** * Serialize a {@link INodeDirectory} * @param node The node to write * @param out The {@link DataOutput} where the fields are written */ public static void writeINodeDirectory(INodeDirectory node, DataOutput out) throws IOException { writeLocalName(node, out); out.writeLong(node.getId()); out.writeShort(0); // replication out.writeLong(node.getModificationTime()); out.writeLong(0); // access time out.writeLong(0); // preferred block size out.writeInt(-1); // # of blocks writeQuota(node.getQuotaCounts(), out); if (node.isSnapshottable()) { out.writeBoolean(true); } else { out.writeBoolean(false); out.writeBoolean(node.isWithSnapshot()); } writePermissionStatus(node, out); }
dir.getModificationTime(), dir.getAccessTime(), dir.getFsPermission(), dir.getUserName(), dir.getGroupName(), dir.getLocalNameBytes(), dir.getId(), dir.getChildrenNum(Snapshot.CURRENT_STATE_ID), dir.getDirectorySnapshottableFeature().getNumSnapshots(),
private void loadSnapshots(InputStream in, int size) throws IOException { for (int i = 0; i < size; i++) { SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot .parseDelimitedFrom(in); INodeDirectory root = loadINodeDirectory(pbs.getRoot(), parent.getLoaderContext()); int sid = pbs.getSnapshotId(); INodeDirectory parent = fsDir.getInode(root.getId()).asDirectory(); Snapshot snapshot = new Snapshot(sid, root, parent); // add the snapshot to parent, since we follow the sequence of // snapshotsByNames when saving, we do not need to sort when loading parent.getDirectorySnapshottableFeature().addSnapshot(snapshot); snapshotMap.put(sid, snapshot); } }
private void loadSnapshots(InputStream in, int size) throws IOException { for (int i = 0; i < size; i++) { SnapshotSection.Snapshot pbs = SnapshotSection.Snapshot .parseDelimitedFrom(in); INodeDirectory root = loadINodeDirectory(pbs.getRoot(), parent.getLoaderContext()); int sid = pbs.getSnapshotId(); INodeDirectory parent = fsDir.getInode(root.getId()).asDirectory(); Snapshot snapshot = new Snapshot(sid, root, parent); // add the snapshot to parent, since we follow the sequence of // snapshotsByNames when saving, we do not need to sort when loading parent.getDirectorySnapshottableFeature().addSnapshot(snapshot); snapshotMap.put(sid, snapshot); } }
b.addSnapshottableDir(sdir.getId());