/** * Load the filenames of the directories from the INode section. */ private void loadDirectoriesInINodeSection(InputStream in) throws IOException { INodeSection s = INodeSection.parseDelimitedFrom(in); LOG.info("Loading directories in INode section."); int numDirs = 0; for (int i = 0; i < s.getNumInodes(); ++i) { INode p = INode.parseDelimitedFrom(in); if (LOG.isDebugEnabled() && i % 10000 == 0) { LOG.debug("Scanned {} inodes.", i); } if (p.hasDirectory()) { metadataMap.putDir(p); numDirs++; } } LOG.info("Found {} directories in INode section.", numDirs); }
@Override public void putDir(INode dir) throws IOException { Preconditions.checkArgument(dir.hasDirectory(), "INode %s (%s) is not a directory.", dir.getId(), dir.getName()); dirMap.put(toBytes(dir.getId()), toBytes(dir.getName().toStringUtf8())); }
private void dumpINodeFields(INodeSection.INode p) { o(SECTION_ID, p.getId()).o(INODE_SECTION_TYPE, p.getType()) .o(SECTION_NAME, p.getName().toStringUtf8()); if (p.hasFile()) { dumpINodeFile(p.getFile()); } else if (p.hasDirectory()) { dumpINodeDirectory(p.getDirectory()); } else if (p.hasSymlink()) { dumpINodeSymlink(p.getSymlink()); } }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasType()) { memoizedIsInitialized = 0; return false; } if (!hasId()) { memoizedIsInitialized = 0; return false; } if (hasFile()) { if (!getFile().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasDirectory()) { if (!getDirectory().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasType()) { memoizedIsInitialized = 0; return false; } if (!hasId()) { memoizedIsInitialized = 0; return false; } if (hasFile()) { if (!getFile().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasDirectory()) { if (!getDirectory().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public Builder mergeFrom(org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.INode other) { if (other == org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.INode.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasId()) { setId(other.getId()); } if (other.hasName()) { setName(other.getName()); } if (other.hasFile()) { mergeFile(other.getFile()); } if (other.hasDirectory()) { mergeDirectory(other.getDirectory()); } if (other.hasSymlink()) { mergeSymlink(other.getSymlink()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.INode other) { if (other == org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.INode.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasId()) { setId(other.getId()); } if (other.hasName()) { setName(other.getName()); } if (other.hasFile()) { mergeFile(other.getFile()); } if (other.hasDirectory()) { mergeDirectory(other.getDirectory()); } if (other.hasSymlink()) { mergeSymlink(other.getSymlink()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
private void dumpINodeSection(InputStream in) throws IOException { INodeSection s = INodeSection.parseDelimitedFrom(in); out.print("<INodeSection>"); o("lastInodeId", s.getLastInodeId()); for (int i = 0; i < s.getNumInodes(); ++i) { INodeSection.INode p = INodeSection.INode.parseDelimitedFrom(in); out.print("<inode>"); o("id", p.getId()).o("type", p.getType()).o("name", p.getName().toStringUtf8()); if (p.hasFile()) { dumpINodeFile(p.getFile()); } else if (p.hasDirectory()) { dumpINodeDirectory(p.getDirectory()); } else if (p.hasSymlink()) { dumpINodeSymlink(p.getSymlink()); } out.print("</inode>\n"); } out.print("</INodeSection>\n"); }
/** * Load the filenames of the directories from the INode section. */ private void loadDirectoriesInINodeSection(InputStream in) throws IOException { INodeSection s = INodeSection.parseDelimitedFrom(in); LOG.info("Loading directories in INode section."); int numDirs = 0; for (int i = 0; i < s.getNumInodes(); ++i) { INode p = INode.parseDelimitedFrom(in); if (LOG.isDebugEnabled() && i % 10000 == 0) { LOG.debug("Scanned {} inodes.", i); } if (p.hasDirectory()) { metadataMap.putDir(p); numDirs++; } } LOG.info("Found {} directories in INode section.", numDirs); }
private void dumpINodeSection(InputStream in) throws IOException { INodeSection s = INodeSection.parseDelimitedFrom(in); out.print("<INodeSection>"); o("lastInodeId", s.getLastInodeId()); for (int i = 0; i < s.getNumInodes(); ++i) { INodeSection.INode p = INodeSection.INode.parseDelimitedFrom(in); out.print("<inode>"); o("id", p.getId()).o("type", p.getType()).o("name", p.getName().toStringUtf8()); if (p.hasFile()) { dumpINodeFile(p.getFile()); } else if (p.hasDirectory()) { dumpINodeDirectory(p.getDirectory()); } else if (p.hasSymlink()) { dumpINodeSymlink(p.getSymlink()); } out.print("</inode>\n"); } out.print("</INodeSection>\n"); }
/** * Load the filenames of the directories from the INode section. */ private void loadDirectoriesInINodeSection(InputStream in) throws IOException { INodeSection s = INodeSection.parseDelimitedFrom(in); LOG.info("Loading directories in INode section."); int numDirs = 0; for (int i = 0; i < s.getNumInodes(); ++i) { INode p = INode.parseDelimitedFrom(in); if (LOG.isDebugEnabled() && i % 10000 == 0) { LOG.debug("Scanned {} inodes.", i); } if (p.hasDirectory()) { metadataMap.putDir(p); numDirs++; } } LOG.info("Found {} directories in INode section.", numDirs); }
@Override public void putDir(INode dir) throws IOException { Preconditions.checkArgument(dir.hasDirectory(), "INode %s (%s) is not a directory.", dir.getId(), dir.getName()); dirMap.put(toBytes(dir.getId()), toBytes(dir.getName().toStringUtf8())); }
@Override public void putDir(INode dir) throws IOException { Preconditions.checkArgument(dir.hasDirectory(), "INode %s (%s) is not a directory.", dir.getId(), dir.getName()); dirMap.put(toBytes(dir.getId()), toBytes(dir.getName().toStringUtf8())); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasType()) { memoizedIsInitialized = 0; return false; } if (!hasId()) { memoizedIsInitialized = 0; return false; } if (hasFile()) { if (!getFile().isInitialized()) { memoizedIsInitialized = 0; return false; } } if (hasDirectory()) { if (!getDirectory().isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public Builder mergeFrom(org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.INode other) { if (other == org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.INode.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasId()) { setId(other.getId()); } if (other.hasName()) { setName(other.getName()); } if (other.hasFile()) { mergeFile(other.getFile()); } if (other.hasDirectory()) { mergeDirectory(other.getDirectory()); } if (other.hasSymlink()) { mergeSymlink(other.getSymlink()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }