Java Code Examples for org.apache.hadoop.hdfs.protocol.proto.HdfsProtos#DatanodeInfoProto

The following examples show how to use org.apache.hadoop.hdfs.protocol.proto.HdfsProtos#DatanodeInfoProto . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PBHelper.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Copy from {@code dnInfos} to a target of list of same size starting at
 * {@code startIdx}.
 */
public static List<? extends HdfsProtos.DatanodeInfoProto> convert(
    DatanodeInfo[] dnInfos, int startIdx) {
  if (dnInfos == null)
    return null;
  ArrayList<HdfsProtos.DatanodeInfoProto> protos = Lists
      .newArrayListWithCapacity(dnInfos.length);
  for (int i = startIdx; i < dnInfos.length; i++) {
    protos.add(convert(dnInfos[i]));
  }
  return protos;
}
 
Example 2
Source File: PBHelper.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Copy from {@code dnInfos} to a target of list of same size starting at
 * {@code startIdx}.
 */
public static List<? extends HdfsProtos.DatanodeInfoProto> convert(
    DatanodeInfo[] dnInfos, int startIdx) {
  if (dnInfos == null)
    return null;
  ArrayList<HdfsProtos.DatanodeInfoProto> protos = Lists
      .newArrayListWithCapacity(dnInfos.length);
  for (int i = startIdx; i < dnInfos.length; i++) {
    protos.add(convert(dnInfos[i]));
  }
  return protos;
}
 
Example 3
Source File: PBHelper.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public static List<? extends HdfsProtos.DatanodeInfoProto> convert(
    DatanodeInfo[] dnInfos) {
  return convert(dnInfos, 0);
}
 
Example 4
Source File: PBHelper.java    From big-c with Apache License 2.0 4 votes vote down vote up
public static List<? extends HdfsProtos.DatanodeInfoProto> convert(
    DatanodeInfo[] dnInfos) {
  return convert(dnInfos, 0);
}