Examples of BlockWithLocations


Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

        .setBlock(convert(blk.getBlock()))
        .addAllStorageIDs(Arrays.asList(blk.getStorageIDs())).build();
  }

  public static BlockWithLocations convert(BlockWithLocationsProto b) {
    return new BlockWithLocations(convert(b.getBlock()), b.getStorageIDsList()
        .toArray(new String[0]));
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  private long addBlock(Block block, List<BlockWithLocations> results) {
    final List<String> machineSet = getValidLocations(block);
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

        .setBlock(convert(blk.getBlock()))
        .addAllStorageIDs(Arrays.asList(blk.getStorageIDs())).build();
  }

  public static BlockWithLocations convert(BlockWithLocationsProto b) {
    return new BlockWithLocations(convert(b.getBlock()), b.getStorageIDsList()
        .toArray(new String[0]));
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if (machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
        machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  }

  public static BlockWithLocations convert(BlockWithLocationsProto b) {
    final List<String> datanodeUuids = b.getDatanodeUuidsList();
    final List<String> storageUuids = b.getStorageUuidsList();
    return new BlockWithLocations(convert(b.getBlock()),
        datanodeUuids.toArray(new String[datanodeUuids.size()]),
        storageUuids.toArray(new String[storageUuids.size()]));
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      for(int i = 0; i < locations.size(); i++) {
        final DatanodeStorageInfo s = locations.get(i);
        datanodeUuids[i] = s.getDatanodeDescriptor().getDatanodeUuid();
        storageIDs[i] = s.getStorageID();
      }
      results.add(new BlockWithLocations(block, datanodeUuids, storageIDs));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  private long addBlock(Block block, List<BlockWithLocations> results) {
    final List<String> machineSet = getValidLocations(block);
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.