use of org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.LocatedBlockProto in project hadoop by apache.
the class PBHelperClient method convertLocatedBlocks.
public static List<LocatedBlock> convertLocatedBlocks(List<LocatedBlockProto> lb) {
if (lb == null)
return null;
final int len = lb.size();
List<LocatedBlock> result = new ArrayList<>(len);
for (LocatedBlockProto aLb : lb) {
result.add(convertLocatedBlockProto(aLb));
}
return result;
}
use of org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.LocatedBlockProto in project hadoop by apache.
the class PBHelperClient method convertLocatedBlocks2.
public static List<LocatedBlockProto> convertLocatedBlocks2(List<LocatedBlock> lb) {
if (lb == null)
return null;
final int len = lb.size();
List<LocatedBlockProto> result = new ArrayList<>(len);
for (LocatedBlock aLb : lb) {
result.add(convertLocatedBlock(aLb));
}
return result;
}
use of org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.LocatedBlockProto in project hadoop by apache.
the class ClientNamenodeProtocolServerSideTranslatorPB method reportBadBlocks.
@Override
public ReportBadBlocksResponseProto reportBadBlocks(RpcController controller, ReportBadBlocksRequestProto req) throws ServiceException {
try {
List<LocatedBlockProto> bl = req.getBlocksList();
server.reportBadBlocks(PBHelperClient.convertLocatedBlocks(bl.toArray(new LocatedBlockProto[bl.size()])));
} catch (IOException e) {
throw new ServiceException(e);
}
return VOID_REP_BAD_BLOCK_RESPONSE;
}
Aggregations