Java 类org.apache.hadoop.hdfs.server.namenode.FsImageProto.FilesUnderConstructionSection.FileUnderConstructionEntry 实例源码

项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBINode.java   
/**
 * Load the under-construction files section, and update the lease map
 */
void loadFilesUnderConstructionSection(InputStream in) throws IOException {
  while (true) {
    FileUnderConstructionEntry entry = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (entry == null) {
      break;
    }
    // update the lease manager
    INodeFile file = dir.getInode(entry.getInodeId()).asFile();
    FileUnderConstructionFeature uc = file.getFileUnderConstructionFeature();
    Preconditions.checkState(uc != null); // file must be under-construction
    fsn.leaseManager.addLease(uc.getClientName(),
            entry.getInodeId());
  }
}
项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBINode.java   
void serializeFilesUCSection(OutputStream out) throws IOException {
  Collection<Long> filesWithUC = fsn.getLeaseManager()
          .getINodeIdWithLeases();
  for (Long id : filesWithUC) {
    INode inode = fsn.getFSDirectory().getInode(id);
    if (inode == null) {
      LOG.warn("Fail to find inode " + id + " when saving the leases.");
      continue;
    }
    INodeFile file = inode.asFile();
    if (!file.isUnderConstruction()) {
      LOG.warn("Fail to save the lease for inode id " + id
                   + " as the file is not under construction");
      continue;
    }
    String path = file.getFullPathName();
    FileUnderConstructionEntry.Builder b = FileUnderConstructionEntry
        .newBuilder().setInodeId(file.getId()).setFullPath(path);
    FileUnderConstructionEntry e = b.build();
    e.writeDelimitedTo(out);
  }
  parent.commitSection(summary,
      FSImageFormatProtobuf.SectionName.FILES_UNDERCONSTRUCTION);
}
项目:hadoop    文件:FSImageFormatPBINode.java   
/**
 * Load the under-construction files section, and update the lease map
 */
void loadFilesUnderConstructionSection(InputStream in) throws IOException {
  while (true) {
    FileUnderConstructionEntry entry = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (entry == null) {
      break;
    }
    // update the lease manager
    INodeFile file = dir.getInode(entry.getInodeId()).asFile();
    FileUnderConstructionFeature uc = file.getFileUnderConstructionFeature();
    Preconditions.checkState(uc != null); // file must be under-construction
    fsn.leaseManager.addLease(uc.getClientName(), entry.getFullPath());
  }
}
项目:hadoop    文件:FSImageFormatPBINode.java   
void serializeFilesUCSection(OutputStream out) throws IOException {
  Map<String, INodeFile> ucMap = fsn.getFilesUnderConstruction();
  for (Map.Entry<String, INodeFile> entry : ucMap.entrySet()) {
    String path = entry.getKey();
    INodeFile file = entry.getValue();
    FileUnderConstructionEntry.Builder b = FileUnderConstructionEntry
        .newBuilder().setInodeId(file.getId()).setFullPath(path);
    FileUnderConstructionEntry e = b.build();
    e.writeDelimitedTo(out);
  }
  parent.commitSection(summary,
      FSImageFormatProtobuf.SectionName.FILES_UNDERCONSTRUCTION);
}
项目:hadoop    文件:PBImageXmlWriter.java   
private void dumpFileUnderConstructionSection(InputStream in)
    throws IOException {
  out.print("<FileUnderConstructionSection>");
  while (true) {
    FileUnderConstructionEntry e = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (e == null) {
      break;
    }
    out.print("<inode>");
    o("id", e.getInodeId()).o("path", e.getFullPath());
    out.print("</inode>\n");
  }
  out.print("</FileUnderConstructionSection>\n");
}
项目:aliyun-oss-hadoop-fs    文件:PBImageXmlWriter.java   
private void dumpFileUnderConstructionSection(InputStream in)
    throws IOException {
  out.print("<FileUnderConstructionSection>");
  while (true) {
    FileUnderConstructionEntry e = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (e == null) {
      break;
    }
    out.print("<inode>");
    o("id", e.getInodeId()).o("path", e.getFullPath());
    out.print("</inode>\n");
  }
  out.print("</FileUnderConstructionSection>\n");
}
项目:big-c    文件:FSImageFormatPBINode.java   
/**
 * Load the under-construction files section, and update the lease map
 */
void loadFilesUnderConstructionSection(InputStream in) throws IOException {
  while (true) {
    FileUnderConstructionEntry entry = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (entry == null) {
      break;
    }
    // update the lease manager
    INodeFile file = dir.getInode(entry.getInodeId()).asFile();
    FileUnderConstructionFeature uc = file.getFileUnderConstructionFeature();
    Preconditions.checkState(uc != null); // file must be under-construction
    fsn.leaseManager.addLease(uc.getClientName(), entry.getFullPath());
  }
}
项目:big-c    文件:FSImageFormatPBINode.java   
void serializeFilesUCSection(OutputStream out) throws IOException {
  Map<String, INodeFile> ucMap = fsn.getFilesUnderConstruction();
  for (Map.Entry<String, INodeFile> entry : ucMap.entrySet()) {
    String path = entry.getKey();
    INodeFile file = entry.getValue();
    FileUnderConstructionEntry.Builder b = FileUnderConstructionEntry
        .newBuilder().setInodeId(file.getId()).setFullPath(path);
    FileUnderConstructionEntry e = b.build();
    e.writeDelimitedTo(out);
  }
  parent.commitSection(summary,
      FSImageFormatProtobuf.SectionName.FILES_UNDERCONSTRUCTION);
}
项目:big-c    文件:PBImageXmlWriter.java   
private void dumpFileUnderConstructionSection(InputStream in)
    throws IOException {
  out.print("<FileUnderConstructionSection>");
  while (true) {
    FileUnderConstructionEntry e = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (e == null) {
      break;
    }
    out.print("<inode>");
    o("id", e.getInodeId()).o("path", e.getFullPath());
    out.print("</inode>\n");
  }
  out.print("</FileUnderConstructionSection>\n");
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSImageFormatPBINode.java   
/**
 * Load the under-construction files section, and update the lease map
 */
void loadFilesUnderConstructionSection(InputStream in) throws IOException {
  while (true) {
    FileUnderConstructionEntry entry = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (entry == null) {
      break;
    }
    // update the lease manager
    INodeFile file = dir.getInode(entry.getInodeId()).asFile();
    FileUnderConstructionFeature uc = file.getFileUnderConstructionFeature();
    Preconditions.checkState(uc != null); // file must be under-construction
    fsn.leaseManager.addLease(uc.getClientName(), entry.getFullPath());
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSImageFormatPBINode.java   
void serializeFilesUCSection(OutputStream out) throws IOException {
  Map<String, INodeFile> ucMap = fsn.getFilesUnderConstruction();
  for (Map.Entry<String, INodeFile> entry : ucMap.entrySet()) {
    String path = entry.getKey();
    INodeFile file = entry.getValue();
    FileUnderConstructionEntry.Builder b = FileUnderConstructionEntry
        .newBuilder().setInodeId(file.getId()).setFullPath(path);
    FileUnderConstructionEntry e = b.build();
    e.writeDelimitedTo(out);
  }
  parent.commitSection(summary,
      FSImageFormatProtobuf.SectionName.FILES_UNDERCONSTRUCTION);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBImageXmlWriter.java   
private void dumpFileUnderConstructionSection(InputStream in)
    throws IOException {
  out.print("<FileUnderConstructionSection>");
  while (true) {
    FileUnderConstructionEntry e = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (e == null) {
      break;
    }
    out.print("<inode>");
    o("id", e.getInodeId()).o("path", e.getFullPath());
    out.print("</inode>\n");
  }
  out.print("</FileUnderConstructionSection>\n");
}
项目:FlexMap    文件:FSImageFormatPBINode.java   
/**
 * Load the under-construction files section, and update the lease map
 */
void loadFilesUnderConstructionSection(InputStream in) throws IOException {
  while (true) {
    FileUnderConstructionEntry entry = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (entry == null) {
      break;
    }
    // update the lease manager
    INodeFile file = dir.getInode(entry.getInodeId()).asFile();
    FileUnderConstructionFeature uc = file.getFileUnderConstructionFeature();
    Preconditions.checkState(uc != null); // file must be under-construction
    fsn.leaseManager.addLease(uc.getClientName(), entry.getFullPath());
  }
}
项目:FlexMap    文件:FSImageFormatPBINode.java   
void serializeFilesUCSection(OutputStream out) throws IOException {
  Map<String, INodeFile> ucMap = fsn.getFilesUnderConstruction();
  for (Map.Entry<String, INodeFile> entry : ucMap.entrySet()) {
    String path = entry.getKey();
    INodeFile file = entry.getValue();
    FileUnderConstructionEntry.Builder b = FileUnderConstructionEntry
        .newBuilder().setInodeId(file.getId()).setFullPath(path);
    FileUnderConstructionEntry e = b.build();
    e.writeDelimitedTo(out);
  }
  parent.commitSection(summary,
      FSImageFormatProtobuf.SectionName.FILES_UNDERCONSTRUCTION);
}
项目:FlexMap    文件:PBImageXmlWriter.java   
private void dumpFileUnderConstructionSection(InputStream in)
    throws IOException {
  out.print("<FileUnderConstructionSection>");
  while (true) {
    FileUnderConstructionEntry e = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (e == null) {
      break;
    }
    out.print("<inode>");
    o("id", e.getInodeId()).o("path", e.getFullPath());
    out.print("</inode>\n");
  }
  out.print("</FileUnderConstructionSection>\n");
}
项目:hadoop-on-lustre2    文件:FSImageFormatPBINode.java   
/**
 * Load the under-construction files section, and update the lease map
 */
void loadFilesUnderConstructionSection(InputStream in) throws IOException {
  while (true) {
    FileUnderConstructionEntry entry = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (entry == null) {
      break;
    }
    // update the lease manager
    INodeFile file = dir.getInode(entry.getInodeId()).asFile();
    FileUnderConstructionFeature uc = file.getFileUnderConstructionFeature();
    Preconditions.checkState(uc != null); // file must be under-construction
    fsn.leaseManager.addLease(uc.getClientName(), entry.getFullPath());
  }
}
项目:hadoop-on-lustre2    文件:FSImageFormatPBINode.java   
void serializeFilesUCSection(OutputStream out) throws IOException {
  Map<String, INodeFile> ucMap = fsn.getFilesUnderConstruction();
  for (Map.Entry<String, INodeFile> entry : ucMap.entrySet()) {
    String path = entry.getKey();
    INodeFile file = entry.getValue();
    FileUnderConstructionEntry.Builder b = FileUnderConstructionEntry
        .newBuilder().setInodeId(file.getId()).setFullPath(path);
    FileUnderConstructionEntry e = b.build();
    e.writeDelimitedTo(out);
  }
  parent.commitSection(summary,
      FSImageFormatProtobuf.SectionName.FILES_UNDERCONSTRUCTION);
}
项目:hadoop-on-lustre2    文件:PBImageXmlWriter.java   
private void dumpFileUnderConstructionSection(InputStream in)
    throws IOException {
  out.print("<FileUnderConstructionSection>");
  while (true) {
    FileUnderConstructionEntry e = FileUnderConstructionEntry
        .parseDelimitedFrom(in);
    if (e == null) {
      break;
    }
    out.print("<inode>");
    o("id", e.getInodeId()).o("path", e.getFullPath());
    out.print("</inode>\n");
  }
  out.print("</FileUnderConstructionSection>\n");
}