当前位置: 首页>>代码示例>>Java>>正文


Java INodeSection.FileUnderConstructionFeature方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.FileUnderConstructionFeature方法的典型用法代码示例。如果您正苦于以下问题:Java INodeSection.FileUnderConstructionFeature方法的具体用法?Java INodeSection.FileUnderConstructionFeature怎么用?Java INodeSection.FileUnderConstructionFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection的用法示例。


在下文中一共展示了INodeSection.FileUnderConstructionFeature方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection; //导入方法依赖的package包/类
private void save(OutputStream out, INodeFile n) throws IOException {
  INodeSection.INodeFile.Builder b = buildINodeFile(n,
      parent.getSaverContext());

  if (n.getBlocks() != null) {
    for (Block block : n.getBlocks()) {
      b.addBlocks(PBHelper.convert(block));
    }
  }

  FileUnderConstructionFeature uc = n.getFileUnderConstructionFeature();
  if (uc != null) {
    INodeSection.FileUnderConstructionFeature f =
        INodeSection.FileUnderConstructionFeature
        .newBuilder().setClientName(uc.getClientName())
        .setClientMachine(uc.getClientMachine()).build();
    b.setFileUC(f);
  }

  INodeSection.INode r = buildINodeCommon(n)
      .setType(INodeSection.INode.Type.FILE).setFile(b).build();
  r.writeDelimitedTo(out);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:FSImageFormatPBINode.java

示例2: dumpINodeFile

import org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection; //导入方法依赖的package包/类
private void dumpINodeFile(INodeSection.INodeFile f) {
  o("replication", f.getReplication()).o("mtime", f.getModificationTime())
      .o("atime", f.getAccessTime())
      .o("perferredBlockSize", f.getPreferredBlockSize())
      .o("permission", dumpPermission(f.getPermission()));

  if (f.getBlocksCount() > 0) {
    out.print("<blocks>");
    for (BlockProto b : f.getBlocksList()) {
      out.print("<block>");
      o("id", b.getBlockId()).o("genstamp", b.getGenStamp()).o("numBytes",
          b.getNumBytes());
      out.print("</block>\n");
    }
    out.print("</blocks>\n");
  }

  if (f.hasFileUC()) {
    INodeSection.FileUnderConstructionFeature u = f.getFileUC();
    out.print("<file-under-construction>");
    o("clientName", u.getClientName()).o("clientMachine",
        u.getClientMachine());
    out.print("</file-under-construction>\n");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:PBImageXmlWriter.java

示例3: save

import org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection; //导入方法依赖的package包/类
private void save(OutputStream out, INodeFile n) throws IOException {
  INodeSection.INodeFile.Builder b = buildINodeFile(n,
      parent.getSaverContext());
  BlockInfo[] blocks = n.getBlocks();

  if (blocks != null) {
    for (Block block : n.getBlocks()) {
      b.addBlocks(PBHelperClient.convert(block));
    }
  }

  FileUnderConstructionFeature uc = n.getFileUnderConstructionFeature();
  if (uc != null) {
    INodeSection.FileUnderConstructionFeature f =
        INodeSection.FileUnderConstructionFeature
        .newBuilder().setClientName(uc.getClientName())
        .setClientMachine(uc.getClientMachine()).build();
    b.setFileUC(f);
  }

  INodeSection.INode r = buildINodeCommon(n)
      .setType(INodeSection.INode.Type.FILE).setFile(b).build();
  r.writeDelimitedTo(out);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:25,代码来源:FSImageFormatPBINode.java

示例4: dumpINodeFile

import org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection; //导入方法依赖的package包/类
private void dumpINodeFile(INodeSection.INodeFile f) {
  o("replication", f.getReplication()).o("mtime", f.getModificationTime())
      .o("atime", f.getAccessTime())
      .o("preferredBlockSize", f.getPreferredBlockSize())
      .o("permission", dumpPermission(f.getPermission()));
  dumpAcls(f.getAcl());
  if (f.getBlocksCount() > 0) {
    out.print("<blocks>");
    for (BlockProto b : f.getBlocksList()) {
      out.print("<block>");
      o("id", b.getBlockId()).o("genstamp", b.getGenStamp()).o("numBytes",
          b.getNumBytes());
      out.print("</block>\n");
    }
    out.print("</blocks>\n");
  }

  if (f.hasFileUC()) {
    INodeSection.FileUnderConstructionFeature u = f.getFileUC();
    out.print("<file-under-construction>");
    o("clientName", u.getClientName()).o("clientMachine",
        u.getClientMachine());
    out.print("</file-under-construction>\n");
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:26,代码来源:PBImageXmlWriter.java

示例5: save

import org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection; //导入方法依赖的package包/类
private void save(OutputStream out, INodeFile n) throws IOException {
  INodeSection.INodeFile.Builder b = buildINodeFile(n,
      parent.getSaverContext());

  for (Block block : n.getBlocks()) {
    b.addBlocks(PBHelper.convert(block));
  }

  FileUnderConstructionFeature uc = n.getFileUnderConstructionFeature();
  if (uc != null) {
    INodeSection.FileUnderConstructionFeature f =
        INodeSection.FileUnderConstructionFeature
        .newBuilder().setClientName(uc.getClientName())
        .setClientMachine(uc.getClientMachine()).build();
    b.setFileUC(f);
  }

  INodeSection.INode r = buildINodeCommon(n)
      .setType(INodeSection.INode.Type.FILE).setFile(b).build();
  r.writeDelimitedTo(out);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:22,代码来源:FSImageFormatPBINode.java


注:本文中的org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.FileUnderConstructionFeature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。