Java 类org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature.DirectoryDiffList 实例源码

项目:hadoop    文件:INodeDirectory.java   
public DirectoryWithSnapshotFeature addSnapshotFeature(
    DirectoryDiffList diffs) {
  Preconditions.checkState(!isWithSnapshot(), 
      "Directory is already with snapshot");
  DirectoryWithSnapshotFeature sf = new DirectoryWithSnapshotFeature(diffs);
  addFeature(sf);
  return sf;
}
项目:hadoop    文件:INodeDirectory.java   
/**
 * Search for the given INode in the children list and the deleted lists of
 * snapshots.
 * @return {@link Snapshot#CURRENT_STATE_ID} if the inode is in the children
 * list; {@link Snapshot#NO_SNAPSHOT_ID} if the inode is neither in the
 * children list nor in any snapshot; otherwise the snapshot id of the
 * corresponding snapshot diff list.
 */
public int searchChild(INode inode) {
  INode child = getChild(inode.getLocalNameBytes(), Snapshot.CURRENT_STATE_ID);
  if (child != inode) {
    // inode is not in parent's children list, thus inode must be in
    // snapshot. identify the snapshot id and later add it into the path
    DirectoryDiffList diffs = getDiffs();
    if (diffs == null) {
      return Snapshot.NO_SNAPSHOT_ID;
    }
    return diffs.findSnapshotDeleted(inode);
  } else {
    return Snapshot.CURRENT_STATE_ID;
  }
}
项目:aliyun-oss-hadoop-fs    文件:INodeDirectory.java   
public DirectoryWithSnapshotFeature addSnapshotFeature(
    DirectoryDiffList diffs) {
  Preconditions.checkState(!isWithSnapshot(), 
      "Directory is already with snapshot");
  DirectoryWithSnapshotFeature sf = new DirectoryWithSnapshotFeature(diffs);
  addFeature(sf);
  return sf;
}
项目:aliyun-oss-hadoop-fs    文件:INodeDirectory.java   
/**
 * Search for the given INode in the children list and the deleted lists of
 * snapshots.
 * @return {@link Snapshot#CURRENT_STATE_ID} if the inode is in the children
 * list; {@link Snapshot#NO_SNAPSHOT_ID} if the inode is neither in the
 * children list nor in any snapshot; otherwise the snapshot id of the
 * corresponding snapshot diff list.
 */
public int searchChild(INode inode) {
  INode child = getChild(inode.getLocalNameBytes(), Snapshot.CURRENT_STATE_ID);
  if (child != inode) {
    // inode is not in parent's children list, thus inode must be in
    // snapshot. identify the snapshot id and later add it into the path
    DirectoryDiffList diffs = getDiffs();
    if (diffs == null) {
      return Snapshot.NO_SNAPSHOT_ID;
    }
    return diffs.findSnapshotDeleted(inode);
  } else {
    return Snapshot.CURRENT_STATE_ID;
  }
}
项目:big-c    文件:INodeDirectory.java   
public DirectoryWithSnapshotFeature addSnapshotFeature(
    DirectoryDiffList diffs) {
  Preconditions.checkState(!isWithSnapshot(), 
      "Directory is already with snapshot");
  DirectoryWithSnapshotFeature sf = new DirectoryWithSnapshotFeature(diffs);
  addFeature(sf);
  return sf;
}
项目:big-c    文件:INodeDirectory.java   
/**
 * Search for the given INode in the children list and the deleted lists of
 * snapshots.
 * @return {@link Snapshot#CURRENT_STATE_ID} if the inode is in the children
 * list; {@link Snapshot#NO_SNAPSHOT_ID} if the inode is neither in the
 * children list nor in any snapshot; otherwise the snapshot id of the
 * corresponding snapshot diff list.
 */
public int searchChild(INode inode) {
  INode child = getChild(inode.getLocalNameBytes(), Snapshot.CURRENT_STATE_ID);
  if (child != inode) {
    // inode is not in parent's children list, thus inode must be in
    // snapshot. identify the snapshot id and later add it into the path
    DirectoryDiffList diffs = getDiffs();
    if (diffs == null) {
      return Snapshot.NO_SNAPSHOT_ID;
    }
    return diffs.findSnapshotDeleted(inode);
  } else {
    return Snapshot.CURRENT_STATE_ID;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:INodeDirectory.java   
public DirectoryWithSnapshotFeature addSnapshotFeature(
    DirectoryDiffList diffs) {
  Preconditions.checkState(!isWithSnapshot(), 
      "Directory is already with snapshot");
  DirectoryWithSnapshotFeature sf = new DirectoryWithSnapshotFeature(diffs);
  addFeature(sf);
  return sf;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:INodeDirectory.java   
/**
 * Search for the given INode in the children list and the deleted lists of
 * snapshots.
 * @return {@link Snapshot#CURRENT_STATE_ID} if the inode is in the children
 * list; {@link Snapshot#NO_SNAPSHOT_ID} if the inode is neither in the
 * children list nor in any snapshot; otherwise the snapshot id of the
 * corresponding snapshot diff list.
 */
public int searchChild(INode inode) {
  INode child = getChild(inode.getLocalNameBytes(), Snapshot.CURRENT_STATE_ID);
  if (child != inode) {
    // inode is not in parent's children list, thus inode must be in
    // snapshot. identify the snapshot id and later add it into the path
    DirectoryDiffList diffs = getDiffs();
    if (diffs == null) {
      return Snapshot.NO_SNAPSHOT_ID;
    }
    return diffs.findSnapshotDeleted(inode);
  } else {
    return Snapshot.CURRENT_STATE_ID;
  }
}
项目:FlexMap    文件:INodeDirectory.java   
public DirectoryWithSnapshotFeature addSnapshotFeature(
    DirectoryDiffList diffs) {
  Preconditions.checkState(!isWithSnapshot(), 
      "Directory is already with snapshot");
  DirectoryWithSnapshotFeature sf = new DirectoryWithSnapshotFeature(diffs);
  addFeature(sf);
  return sf;
}
项目:FlexMap    文件:INodeDirectory.java   
/**
 * Search for the given INode in the children list and the deleted lists of
 * snapshots.
 * @return {@link Snapshot#CURRENT_STATE_ID} if the inode is in the children
 * list; {@link Snapshot#NO_SNAPSHOT_ID} if the inode is neither in the
 * children list nor in any snapshot; otherwise the snapshot id of the
 * corresponding snapshot diff list.
 */
public int searchChild(INode inode) {
  INode child = getChild(inode.getLocalNameBytes(), Snapshot.CURRENT_STATE_ID);
  if (child != inode) {
    // inode is not in parent's children list, thus inode must be in
    // snapshot. identify the snapshot id and later add it into the path
    DirectoryDiffList diffs = getDiffs();
    if (diffs == null) {
      return Snapshot.NO_SNAPSHOT_ID;
    }
    return diffs.findSnapshotDeleted(inode);
  } else {
    return Snapshot.CURRENT_STATE_ID;
  }
}
项目:hadoop-on-lustre2    文件:INodeDirectory.java   
public DirectoryWithSnapshotFeature addSnapshotFeature(
    DirectoryDiffList diffs) {
  Preconditions.checkState(!isWithSnapshot(), 
      "Directory is already with snapshot");
  DirectoryWithSnapshotFeature sf = new DirectoryWithSnapshotFeature(diffs);
  addFeature(sf);
  return sf;
}
项目:hadoop    文件:INodeDirectory.java   
public DirectoryDiffList getDiffs() {
  DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
  return sf != null ? sf.getDiffs() : null;
}
项目:aliyun-oss-hadoop-fs    文件:INodeDirectory.java   
public DirectoryDiffList getDiffs() {
  DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
  return sf != null ? sf.getDiffs() : null;
}
项目:big-c    文件:INodeDirectory.java   
public DirectoryDiffList getDiffs() {
  DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
  return sf != null ? sf.getDiffs() : null;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:INodeDirectory.java   
public DirectoryDiffList getDiffs() {
  DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
  return sf != null ? sf.getDiffs() : null;
}
项目:FlexMap    文件:INodeDirectory.java   
public DirectoryDiffList getDiffs() {
  DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
  return sf != null ? sf.getDiffs() : null;
}
项目:hadoop-on-lustre2    文件:INodeDirectory.java   
public DirectoryDiffList getDiffs() {
  DirectoryWithSnapshotFeature sf = getDirectoryWithSnapshotFeature();
  return sf != null ? sf.getDiffs() : null;
}
项目:hadoop    文件:SnapshotFSImageFormat.java   
/**
 * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot
 * directory.
 *
 * @param dir
 *          The snapshottable directory for loading.
 * @param in
 *          The {@link DataInput} instance to read.
 * @param loader
 *          The loader
 */
public static void loadDirectoryDiffList(INodeDirectory dir,
    DataInput in, FSImageFormat.Loader loader) throws IOException {
  final int size = in.readInt();
  if (dir.isWithSnapshot()) {
    DirectoryDiffList diffs = dir.getDiffs();
    for (int i = 0; i < size; i++) {
      diffs.addFirst(loadDirectoryDiff(dir, in, loader));
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:SnapshotFSImageFormat.java   
/**
 * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot
 * directory.
 *
 * @param dir
 *          The snapshottable directory for loading.
 * @param in
 *          The {@link DataInput} instance to read.
 * @param loader
 *          The loader
 */
public static void loadDirectoryDiffList(INodeDirectory dir,
    DataInput in, FSImageFormat.Loader loader) throws IOException {
  final int size = in.readInt();
  if (dir.isWithSnapshot()) {
    DirectoryDiffList diffs = dir.getDiffs();
    for (int i = 0; i < size; i++) {
      diffs.addFirst(loadDirectoryDiff(dir, in, loader));
    }
  }
}
项目:big-c    文件:SnapshotFSImageFormat.java   
/**
 * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot
 * directory.
 *
 * @param dir
 *          The snapshottable directory for loading.
 * @param in
 *          The {@link DataInput} instance to read.
 * @param loader
 *          The loader
 */
public static void loadDirectoryDiffList(INodeDirectory dir,
    DataInput in, FSImageFormat.Loader loader) throws IOException {
  final int size = in.readInt();
  if (dir.isWithSnapshot()) {
    DirectoryDiffList diffs = dir.getDiffs();
    for (int i = 0; i < size; i++) {
      diffs.addFirst(loadDirectoryDiff(dir, in, loader));
    }
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:SnapshotFSImageFormat.java   
/**
 * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot
 * directory.
 *
 * @param dir
 *          The snapshottable directory for loading.
 * @param in
 *          The {@link DataInput} instance to read.
 * @param loader
 *          The loader
 */
public static void loadDirectoryDiffList(INodeDirectory dir,
    DataInput in, FSImageFormat.Loader loader) throws IOException {
  final int size = in.readInt();
  if (dir.isWithSnapshot()) {
    DirectoryDiffList diffs = dir.getDiffs();
    for (int i = 0; i < size; i++) {
      diffs.addFirst(loadDirectoryDiff(dir, in, loader));
    }
  }
}
项目:FlexMap    文件:SnapshotFSImageFormat.java   
/**
 * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot
 * directory.
 *
 * @param dir
 *          The snapshottable directory for loading.
 * @param in
 *          The {@link DataInput} instance to read.
 * @param loader
 *          The loader
 */
public static void loadDirectoryDiffList(INodeDirectory dir,
    DataInput in, FSImageFormat.Loader loader) throws IOException {
  final int size = in.readInt();
  if (dir.isWithSnapshot()) {
    DirectoryDiffList diffs = dir.getDiffs();
    for (int i = 0; i < size; i++) {
      diffs.addFirst(loadDirectoryDiff(dir, in, loader));
    }
  }
}
项目:hadoop-on-lustre2    文件:SnapshotFSImageFormat.java   
/**
 * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot
 * directory.
 *
 * @param dir
 *          The snapshottable directory for loading.
 * @param in
 *          The {@link DataInput} instance to read.
 * @param loader
 *          The loader
 */
public static void loadDirectoryDiffList(INodeDirectory dir,
    DataInput in, FSImageFormat.Loader loader) throws IOException {
  final int size = in.readInt();
  if (dir.isWithSnapshot()) {
    DirectoryDiffList diffs = dir.getDiffs();
    for (int i = 0; i < size; i++) {
      diffs.addFirst(loadDirectoryDiff(dir, in, loader));
    }
  }
}