use of org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetBlockLocationsResponseProto.Builder in project hadoop by apache.
the class ClientNamenodeProtocolServerSideTranslatorPB method getBlockLocations.
@Override
public GetBlockLocationsResponseProto getBlockLocations(RpcController controller, GetBlockLocationsRequestProto req) throws ServiceException {
try {
LocatedBlocks b = server.getBlockLocations(req.getSrc(), req.getOffset(), req.getLength());
Builder builder = GetBlockLocationsResponseProto.newBuilder();
if (b != null) {
builder.setLocations(PBHelperClient.convert(b)).build();
}
return builder.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
Aggregations