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


Java ReferenceMap类代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap的典型用法代码示例。如果您正苦于以下问题:Java ReferenceMap类的具体用法?Java ReferenceMap怎么用?Java ReferenceMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ReferenceMap类属于org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat包,在下文中一共展示了ReferenceMap类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
@Override
void write(DataOutput out, ReferenceMap referenceMap) throws IOException {
  writeSnapshot(out);
  out.writeInt(childrenSize);

  // Write snapshotINode
  out.writeBoolean(isSnapshotRoot);
  if (!isSnapshotRoot) {
    if (snapshotINode != null) {
      out.writeBoolean(true);
      FSImageSerialization.writeINodeDirectoryAttributes(snapshotINode, out);
    } else {
      out.writeBoolean(false);
    }
  }
  // Write diff. Node need to write poseriorDiff, since diffs is a list.
  diff.write(out, referenceMap);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:DirectoryWithSnapshotFeature.java

示例2: write

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
@Override
void write(DataOutput out, ReferenceMap referenceMap) throws IOException {
  writeSnapshot(out);
  out.writeInt(childrenSize);

  // write snapshotINode
  if (isSnapshotRoot()) {
    out.writeBoolean(true);
  } else {
    out.writeBoolean(false);
    if (snapshotINode != null) {
      out.writeBoolean(true);
      FSImageSerialization.writeINodeDirectoryAttributes(snapshotINode, out);
    } else {
      out.writeBoolean(false);
    }
  }
  // Write diff. Node need to write poseriorDiff, since diffs is a list.
  diff.write(out, referenceMap);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:21,代码来源:INodeDirectoryWithSnapshot.java

示例3: writeINodeReference

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/** Serialize a {@link INodeReference} node */
private static void writeINodeReference(INodeReference ref, DataOutput out,
    boolean writeUnderConstruction, ReferenceMap referenceMap
    ) throws IOException {
  writeLocalName(ref, out);
  out.writeLong(ref.getId());
  out.writeShort(0);  // replication
  out.writeLong(0);   // modification time
  out.writeLong(0);   // access time
  out.writeLong(0);   // preferred block size
  out.writeInt(-3);   // # of blocks

  final boolean isWithName = ref instanceof INodeReference.WithName;
  out.writeBoolean(isWithName);

  if (!isWithName) {
    Preconditions.checkState(ref instanceof INodeReference.DstReference);
    // dst snapshot id
    out.writeInt(((INodeReference.DstReference) ref).getDstSnapshotId());
  } else {
    out.writeInt(((INodeReference.WithName) ref).getLastSnapshotId());
  }

  final INodeReference.WithCount withCount
      = (INodeReference.WithCount)ref.getReferredINode();
  referenceMap.writeINodeReferenceWithCount(withCount, out,
      writeUnderConstruction);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:FSImageSerialization.java

示例4: saveINode2Image

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/**
 * Save one inode's attributes to the image.
 */
public static void saveINode2Image(INode node, DataOutput out,
    boolean writeUnderConstruction, ReferenceMap referenceMap)
    throws IOException {
  if (node.isReference()) {
    writeINodeReference(node.asReference(), out, writeUnderConstruction,
        referenceMap);
  } else if (node.isDirectory()) {
    writeINodeDirectory(node.asDirectory(), out);
  } else if (node.isSymlink()) {
    writeINodeSymlink(node.asSymlink(), out);
  } else if (node.isFile()) {
    writeINodeFile(node.asFile(), out, writeUnderConstruction);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:FSImageSerialization.java

示例5: write

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
@Override
void write(DataOutput out, ReferenceMap referenceMap) throws IOException {
  writeSnapshot(out);
  out.writeLong(fileSize);

  // write snapshotINode
  if (snapshotINode != null) {
    out.writeBoolean(true);
    FSImageSerialization.writeINodeFileAttributes(snapshotINode, out);
  } else {
    out.writeBoolean(false);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:FileDiff.java

示例6: writeDeleted

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/** Serialize {@link #deleted} */
private void writeDeleted(DataOutput out,
    ReferenceMap referenceMap) throws IOException {
  final List<INode> deleted = getList(ListType.DELETED);
  out.writeInt(deleted.size());
  for (INode node : deleted) {
    FSImageSerialization.saveINode2Image(node, out, true, referenceMap);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:DirectoryWithSnapshotFeature.java

示例7: saveINode2Image

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/**
 * Saves inode and increments progress counter.
 *
 * @param inode INode to save
 * @param out DataOutputStream to receive inode
 * @param writeUnderConstruction boolean true if this is under construction
 * @param referenceMap ReferenceMap containing reference inodes
 * @param counter Counter to increment for namenode startup progress
 * @throws IOException thrown if there is an I/O error
 */
private void saveINode2Image(INode inode, DataOutputStream out,
    boolean writeUnderConstruction, ReferenceMap referenceMap,
    Counter counter) throws IOException {
  FSImageSerialization.saveINode2Image(inode, out, writeUnderConstruction,
    referenceMap);
  // Intentionally do not increment counter for reference inodes, because it
  // is too difficult at this point to assess whether or not this is a
  // reference that counts toward quota.
  if (!(inode instanceof INodeReference)) {
    counter.increment();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:FSImageFormat.java

示例8: writeINodeReference

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/** Serialize a {@link INodeReference} node */
private static void writeINodeReference(INodeReference ref, DataOutput out,
    boolean writeUnderConstruction, ReferenceMap referenceMap
    ) throws IOException {
  writeLocalName(ref, out);
  out.writeLong(ref.getId());
  out.writeShort(0);  // replication
  out.writeLong(0);   // modification time
  out.writeLong(0);   // access time
  out.writeLong(0);   // preferred block size
  out.writeInt(-3);   // # of blocks

  final boolean isWithName = ref instanceof INodeReference.WithName;
  out.writeBoolean(isWithName);

  if (!isWithName) {
    Preconditions.checkState(ref instanceof INodeReference.DstReference);
    // dst snapshot id
    out.writeInt(ref.getDstSnapshotId());
  } else {
    out.writeInt(((INodeReference.WithName) ref).getLastSnapshotId());
  }

  final INodeReference.WithCount withCount
      = (INodeReference.WithCount)ref.getReferredINode();
  referenceMap.writeINodeReferenceWithCount(withCount, out,
      writeUnderConstruction);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:29,代码来源:FSImageSerialization.java

示例9: writeINodeReference

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/** Serialize a {@link INodeReference} node */
private static void writeINodeReference(INodeReference ref, DataOutput out,
    boolean writeUnderConstruction, ReferenceMap referenceMap
    ) throws IOException {
  writeLocalName(ref, out);
  out.writeLong(ref.getId());
  out.writeShort(0);  // replication
  out.writeLong(0);   // modification time
  out.writeLong(0);   // access time
  out.writeLong(0);   // preferred block size
  out.writeInt(-3);   // # of blocks

  final boolean isWithName = ref instanceof INodeReference.WithName;
  out.writeBoolean(isWithName);
  
  if (!isWithName) {
    Preconditions.checkState(ref instanceof INodeReference.DstReference);
    // dst snapshot id
    out.writeInt(((INodeReference.DstReference) ref).getDstSnapshotId());
  } else {
    out.writeInt(((INodeReference.WithName) ref).getLastSnapshotId());
  }
  
  final INodeReference.WithCount withCount
      = (INodeReference.WithCount)ref.getReferredINode();
  referenceMap.writeINodeReferenceWithCount(withCount, out,
      writeUnderConstruction);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:29,代码来源:FSImageSerialization.java

示例10: saveINode2Image

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/**
 * Save one inode's attributes to the image.
 */
public static void saveINode2Image(INode node, DataOutput out,
    boolean writeUnderConstruction, ReferenceMap referenceMap)
    throws IOException {
  if (node.isReference()) {
    writeINodeReference(node.asReference(), out, writeUnderConstruction,
        referenceMap);
  } else if (node.isDirectory()) {
    writeINodeDirectory(node.asDirectory(), out);
  } else if (node.isSymlink()) {
    writeINodeSymlink(node.asSymlink(), out);      
  } else if (node.isFile()) {
    writeINodeFile(node.asFile(), out, writeUnderConstruction);
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:18,代码来源:FSImageSerialization.java

示例11: saveINode2Image

import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat.ReferenceMap; //导入依赖的package包/类
/**
 * Saves inode and increments progress counter.
 * 
 * @param inode INode to save
 * @param out DataOutputStream to receive inode
 * @param writeUnderConstruction boolean true if this is under construction
 * @param referenceMap ReferenceMap containing reference inodes
 * @param counter Counter to increment for namenode startup progress
 * @throws IOException thrown if there is an I/O error
 */
private void saveINode2Image(INode inode, DataOutputStream out,
    boolean writeUnderConstruction, ReferenceMap referenceMap,
    Counter counter) throws IOException {
  FSImageSerialization.saveINode2Image(inode, out, writeUnderConstruction,
    referenceMap);
  // Intentionally do not increment counter for reference inodes, because it
  // is too difficult at this point to assess whether or not this is a
  // reference that counts toward quota.
  if (!(inode instanceof INodeReference)) {
    counter.increment();
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:23,代码来源:FSImageFormat.java


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