Java 类org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.SnapshotDiffReportEntryProto 实例源码

项目:hadoop    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  ByteString sourcePath = ByteString
      .copyFrom(entry.getSourcePath() == null ? DFSUtil.EMPTY_BYTES : entry
          .getSourcePath());
  String modification = entry.getType().getLabel();
  SnapshotDiffReportEntryProto.Builder builder = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(sourcePath)
      .setModificationLabel(modification);
  if (entry.getType() == DiffType.RENAME) {
    ByteString targetPath = ByteString
        .copyFrom(entry.getTargetPath() == null ? DFSUtil.EMPTY_BYTES : entry
            .getTargetPath());
    builder.setTargetPath(targetPath);
  }
  return builder.build();
}
项目:hadoop    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:hadoop    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static SnapshotDiffReport convert(
    SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  ByteString sourcePath = getByteString(entry.getSourcePath() == null ?
      DFSUtilClient.EMPTY_BYTES : entry.getSourcePath());
  String modification = entry.getType().getLabel();
  SnapshotDiffReportEntryProto.Builder builder = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(sourcePath)
      .setModificationLabel(modification);
  if (entry.getType() == DiffType.RENAME) {
    ByteString targetPath =
        getByteString(entry.getTargetPath() == null ?
            DFSUtilClient.EMPTY_BYTES : entry.getTargetPath());
    builder.setTargetPath(targetPath);
  }
  return builder.build();
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = new ArrayList<>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  return SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
}
项目:big-c    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  ByteString sourcePath = ByteString
      .copyFrom(entry.getSourcePath() == null ? DFSUtil.EMPTY_BYTES : entry
          .getSourcePath());
  String modification = entry.getType().getLabel();
  SnapshotDiffReportEntryProto.Builder builder = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(sourcePath)
      .setModificationLabel(modification);
  if (entry.getType() == DiffType.RENAME) {
    ByteString targetPath = ByteString
        .copyFrom(entry.getTargetPath() == null ? DFSUtil.EMPTY_BYTES : entry
            .getTargetPath());
    builder.setTargetPath(targetPath);
  }
  return builder.build();
}
项目:big-c    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:big-c    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  ByteString sourcePath = ByteString
      .copyFrom(entry.getSourcePath() == null ? DFSUtil.EMPTY_BYTES : entry
          .getSourcePath());
  String modification = entry.getType().getLabel();
  SnapshotDiffReportEntryProto.Builder builder = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(sourcePath)
      .setModificationLabel(modification);
  if (entry.getType() == DiffType.RENAME) {
    ByteString targetPath = ByteString
        .copyFrom(entry.getTargetPath() == null ? DFSUtil.EMPTY_BYTES : entry
            .getTargetPath());
    builder.setTargetPath(targetPath);
  }
  return builder.build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:hadoop-plus    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:hadoop-plus    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:FlexMap    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  ByteString sourcePath = ByteString
      .copyFrom(entry.getSourcePath() == null ? DFSUtil.EMPTY_BYTES : entry
          .getSourcePath());
  String modification = entry.getType().getLabel();
  SnapshotDiffReportEntryProto.Builder builder = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(sourcePath)
      .setModificationLabel(modification);
  if (entry.getType() == DiffType.RENAME) {
    ByteString targetPath = ByteString
        .copyFrom(entry.getTargetPath() == null ? DFSUtil.EMPTY_BYTES : entry
            .getTargetPath());
    builder.setTargetPath(targetPath);
  }
  return builder.build();
}
项目:FlexMap    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:FlexMap    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:hadoop-TCP    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:hadoop-TCP    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:hardfs    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:hardfs    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static SnapshotDiffReport convert(SnapshotDiffReportProto reportProto) {
  if (reportProto == null) {
    return null;
  }
  String snapshotDir = reportProto.getSnapshotRoot();
  String fromSnapshot = reportProto.getFromSnapshot();
  String toSnapshot = reportProto.getToSnapshot();
  List<SnapshotDiffReportEntryProto> list = reportProto
      .getDiffReportEntriesList();
  List<DiffReportEntry> entries = new ArrayList<DiffReportEntry>();
  for (SnapshotDiffReportEntryProto entryProto : list) {
    DiffReportEntry entry = convert(entryProto);
    if (entry != null)
      entries.add(entry);
  }
  return new SnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot,
      entries);
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static SnapshotDiffReportProto convert(SnapshotDiffReport report) {
  if (report == null) {
    return null;
  }
  List<DiffReportEntry> entries = report.getDiffList();
  List<SnapshotDiffReportEntryProto> entryProtos = 
      new ArrayList<SnapshotDiffReportEntryProto>();
  for (DiffReportEntry entry : entries) {
    SnapshotDiffReportEntryProto entryProto = convert(entry);
    if (entryProto != null)
      entryProtos.add(entryProto);
  }

  SnapshotDiffReportProto reportProto = SnapshotDiffReportProto.newBuilder()
      .setSnapshotRoot(report.getSnapshotRoot())
      .setFromSnapshot(report.getFromSnapshot())
      .setToSnapshot(report.getLaterSnapshotName())
      .addAllDiffReportEntries(entryProtos).build();
  return reportProto;
}
项目:hadoop    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : new DiffReportEntry(type, entry.getFullpath()
      .toByteArray(), entry.hasTargetPath() ? entry.getTargetPath()
      .toByteArray() : null);
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : new DiffReportEntry(type, entry.getFullpath()
      .toByteArray(), entry.hasTargetPath() ? entry.getTargetPath()
      .toByteArray() : null);
}
项目:big-c    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : new DiffReportEntry(type, entry.getFullpath()
      .toByteArray(), entry.hasTargetPath() ? entry.getTargetPath()
      .toByteArray() : null);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : new DiffReportEntry(type, entry.getFullpath()
      .toByteArray(), entry.hasTargetPath() ? entry.getTargetPath()
      .toByteArray() : null);
}
项目:hadoop-plus    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : 
    new DiffReportEntry(type, entry.getFullpath().toByteArray());
}
项目:hadoop-plus    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  byte[] fullPath = entry.getRelativePath();
  ByteString fullPathString = ByteString
      .copyFrom(fullPath == null ? DFSUtil.EMPTY_BYTES : fullPath);

  String modification = entry.getType().getLabel();

  SnapshotDiffReportEntryProto entryProto = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(fullPathString)
      .setModificationLabel(modification).build();
  return entryProto;
}
项目:FlexMap    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : new DiffReportEntry(type, entry.getFullpath()
      .toByteArray(), entry.hasTargetPath() ? entry.getTargetPath()
      .toByteArray() : null);
}
项目:hadoop-TCP    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : 
    new DiffReportEntry(type, entry.getFullpath().toByteArray());
}
项目:hadoop-TCP    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  byte[] fullPath = entry.getRelativePath();
  ByteString fullPathString = ByteString
      .copyFrom(fullPath == null ? DFSUtil.EMPTY_BYTES : fullPath);

  String modification = entry.getType().getLabel();

  SnapshotDiffReportEntryProto entryProto = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(fullPathString)
      .setModificationLabel(modification).build();
  return entryProto;
}
项目:hardfs    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : 
    new DiffReportEntry(type, entry.getFullpath().toByteArray());
}
项目:hardfs    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  byte[] fullPath = entry.getRelativePath();
  ByteString fullPathString = ByteString
      .copyFrom(fullPath == null ? DFSUtil.EMPTY_BYTES : fullPath);

  String modification = entry.getType().getLabel();

  SnapshotDiffReportEntryProto entryProto = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(fullPathString)
      .setModificationLabel(modification).build();
  return entryProto;
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static DiffReportEntry convert(SnapshotDiffReportEntryProto entry) {
  if (entry == null) {
    return null;
  }
  DiffType type = DiffType.getTypeFromLabel(entry
      .getModificationLabel());
  return type == null ? null : 
    new DiffReportEntry(type, entry.getFullpath().toByteArray());
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
  if (entry == null) {
    return null;
  }
  byte[] fullPath = entry.getRelativePath();
  ByteString fullPathString = ByteString
      .copyFrom(fullPath == null ? DFSUtil.EMPTY_BYTES : fullPath);

  String modification = entry.getType().getLabel();

  SnapshotDiffReportEntryProto entryProto = SnapshotDiffReportEntryProto
      .newBuilder().setFullpath(fullPathString)
      .setModificationLabel(modification).build();
  return entryProto;
}