Java 类org.apache.hadoop.hdfs.server.namenode.FSImageSerialization 实例源码

项目:hadoop    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:hadoop    文件:DirectoryWithSnapshotFeature.java   
@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);
}
项目:aliyun-oss-hadoop-fs    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:aliyun-oss-hadoop-fs    文件:DirectoryWithSnapshotFeature.java   
@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);
}
项目:big-c    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:big-c    文件:DirectoryWithSnapshotFeature.java   
@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);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:DirectoryWithSnapshotFeature.java   
@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);
}
项目:hadoop-plus    文件:INodeDirectoryWithSnapshot.java   
@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);
}
项目:hadoop-plus    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:FlexMap    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:FlexMap    文件:DirectoryWithSnapshotFeature.java   
@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);
}
项目:hadoop-TCP    文件:INodeDirectoryWithSnapshot.java   
@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);
}
项目:hadoop-TCP    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:hardfs    文件:INodeDirectoryWithSnapshot.java   
@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);
}
项目:hardfs    文件:SnapshotFSImageFormat.java   
public void writeINodeReferenceWithCount(
    INodeReference.WithCount withCount, DataOutput out,
    boolean writeUnderConstruction) throws IOException {
  final INode referred = withCount.getReferredINode();
  final long id = withCount.getId();
  final boolean firstReferred = !referenceMap.containsKey(id);
  out.writeBoolean(firstReferred);

  if (firstReferred) {
    FSImageSerialization.saveINode2Image(referred, out,
        writeUnderConstruction, this);
    referenceMap.put(id, withCount);
  } else {
    out.writeLong(id);
  }
}
项目:hadoop    文件:SnapshotFSImageFormat.java   
/**
 * Load the created list from fsimage.
 * @param parent The directory that the created list belongs to.
 * @param in The {@link DataInput} to read.
 * @return The created list.
 */
private static List<INode> loadCreatedList(INodeDirectory parent,
    DataInput in) throws IOException {
  // read the size of the created list
  int createdSize = in.readInt();
  List<INode> createdList = new ArrayList<INode>(createdSize);
  for (int i = 0; i < createdSize; i++) {
    byte[] createdNodeName = FSImageSerialization.readLocalName(in);
    INode created = loadCreated(createdNodeName, parent);
    createdList.add(created);
  }
  return createdList;
}
项目:hadoop    文件:FileDiff.java   
@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);
  }
}
项目:hadoop    文件:DirectoryWithSnapshotFeature.java   
/** 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);
  }
}
项目:hadoop    文件:ImageLoaderCurrent.java   
private String readINodePath(DataInputStream in, String parentName)
    throws IOException {
  String pathName = FSImageSerialization.readString(in);
  if (parentName != null) {  // local name
    pathName = "/" + pathName;
    if (!"/".equals(parentName)) { // children of non-root directory
      pathName = parentName + pathName;
    }
  }
  return pathName;
}
项目:aliyun-oss-hadoop-fs    文件:SnapshotFSImageFormat.java   
/**
 * Load the created list from fsimage.
 * @param parent The directory that the created list belongs to.
 * @param in The {@link DataInput} to read.
 * @return The created list.
 */
private static List<INode> loadCreatedList(INodeDirectory parent,
    DataInput in) throws IOException {
  // read the size of the created list
  int createdSize = in.readInt();
  List<INode> createdList = new ArrayList<INode>(createdSize);
  for (int i = 0; i < createdSize; i++) {
    byte[] createdNodeName = FSImageSerialization.readLocalName(in);
    INode created = loadCreated(createdNodeName, parent);
    createdList.add(created);
  }
  return createdList;
}
项目:aliyun-oss-hadoop-fs    文件:FileDiff.java   
@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);
  }
}
项目:aliyun-oss-hadoop-fs    文件:DirectoryWithSnapshotFeature.java   
/** 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);
  }
}
项目:aliyun-oss-hadoop-fs    文件:ImageLoaderCurrent.java   
private String readINodePath(DataInputStream in, String parentName)
    throws IOException {
  String pathName = FSImageSerialization.readString(in);
  if (parentName != null) {  // local name
    pathName = "/" + pathName;
    if (!"/".equals(parentName)) { // children of non-root directory
      pathName = parentName + pathName;
    }
  }
  return pathName;
}
项目:big-c    文件:SnapshotFSImageFormat.java   
/**
 * Load the created list from fsimage.
 * @param parent The directory that the created list belongs to.
 * @param in The {@link DataInput} to read.
 * @return The created list.
 */
private static List<INode> loadCreatedList(INodeDirectory parent,
    DataInput in) throws IOException {
  // read the size of the created list
  int createdSize = in.readInt();
  List<INode> createdList = new ArrayList<INode>(createdSize);
  for (int i = 0; i < createdSize; i++) {
    byte[] createdNodeName = FSImageSerialization.readLocalName(in);
    INode created = loadCreated(createdNodeName, parent);
    createdList.add(created);
  }
  return createdList;
}
项目:big-c    文件:FileDiff.java   
@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);
  }
}
项目:big-c    文件:DirectoryWithSnapshotFeature.java   
/** 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);
  }
}
项目:big-c    文件:ImageLoaderCurrent.java   
private String readINodePath(DataInputStream in, String parentName)
    throws IOException {
  String pathName = FSImageSerialization.readString(in);
  if (parentName != null) {  // local name
    pathName = "/" + pathName;
    if (!"/".equals(parentName)) { // children of non-root directory
      pathName = parentName + pathName;
    }
  }
  return pathName;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:SnapshotFSImageFormat.java   
/**
 * Load the created list from fsimage.
 * @param parent The directory that the created list belongs to.
 * @param in The {@link DataInput} to read.
 * @return The created list.
 */
private static List<INode> loadCreatedList(INodeDirectory parent,
    DataInput in) throws IOException {
  // read the size of the created list
  int createdSize = in.readInt();
  List<INode> createdList = new ArrayList<INode>(createdSize);
  for (int i = 0; i < createdSize; i++) {
    byte[] createdNodeName = FSImageSerialization.readLocalName(in);
    INode created = loadCreated(createdNodeName, parent);
    createdList.add(created);
  }
  return createdList;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FileDiff.java   
@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);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:DirectoryWithSnapshotFeature.java   
/** 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);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ImageLoaderCurrent.java   
private String readINodePath(DataInputStream in, String parentName)
    throws IOException {
  String pathName = FSImageSerialization.readString(in);
  if (parentName != null) {  // local name
    pathName = "/" + pathName;
    if (!"/".equals(parentName)) { // children of non-root directory
      pathName = parentName + pathName;
    }
  }
  return pathName;
}
项目:hadoop-EAR    文件:ImageLoaderCurrent.java   
private int processDirectory(DataInputStream in, ImageVisitor v,
   boolean skipBlocks) throws IOException {
  String parentName = FSImageSerialization.readString(in);
  int numChildren = in.readInt();
  for (int i=0; i<numChildren; i++) {
    processINode(in, v, skipBlocks, parentName);
  }
  return numChildren;
}
项目:hadoop-plus    文件:INodeDirectoryWithSnapshot.java   
/** 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);
  }
}
项目:hadoop-plus    文件:SnapshotFSImageFormat.java   
/**
 * Load the created list from fsimage.
 * @param parent The directory that the created list belongs to.
 * @param in The {@link DataInput} to read.
 * @return The created list.
 */
private static List<INode> loadCreatedList(INodeDirectoryWithSnapshot parent,
    DataInput in) throws IOException {
  // read the size of the created list
  int createdSize = in.readInt();
  List<INode> createdList = new ArrayList<INode>(createdSize);
  for (int i = 0; i < createdSize; i++) {
    byte[] createdNodeName = FSImageSerialization.readLocalName(in);
    INode created = loadCreated(createdNodeName, parent);
    createdList.add(created);
  }
  return createdList;
}
项目:hadoop-plus    文件:FileWithSnapshot.java   
@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);
  }
}
项目:hadoop-plus    文件:ImageLoaderCurrent.java   
private String readINodePath(DataInputStream in, String parentName)
    throws IOException {
  String pathName = FSImageSerialization.readString(in);
  if (parentName != null) {  // local name
    pathName = "/" + pathName;
    if (!"/".equals(parentName)) { // children of non-root directory
      pathName = parentName + pathName;
    }
  }
  return pathName;
}
项目:FlexMap    文件:SnapshotFSImageFormat.java   
/**
 * Load the created list from fsimage.
 * @param parent The directory that the created list belongs to.
 * @param in The {@link DataInput} to read.
 * @return The created list.
 */
private static List<INode> loadCreatedList(INodeDirectory parent,
    DataInput in) throws IOException {
  // read the size of the created list
  int createdSize = in.readInt();
  List<INode> createdList = new ArrayList<INode>(createdSize);
  for (int i = 0; i < createdSize; i++) {
    byte[] createdNodeName = FSImageSerialization.readLocalName(in);
    INode created = loadCreated(createdNodeName, parent);
    createdList.add(created);
  }
  return createdList;
}
项目:FlexMap    文件:FileDiff.java   
@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);
  }
}
项目:FlexMap    文件:DirectoryWithSnapshotFeature.java   
/** 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);
  }
}