Search in sources :

Example 1 with ReportBadBlocksRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.ReportBadBlocksRequestProto in project hadoop by apache.

the class DatanodeProtocolClientSideTranslatorPB method reportBadBlocks.

@Override
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
    ReportBadBlocksRequestProto.Builder builder = ReportBadBlocksRequestProto.newBuilder();
    for (int i = 0; i < blocks.length; i++) {
        builder.addBlocks(i, PBHelperClient.convertLocatedBlock(blocks[i]));
    }
    ReportBadBlocksRequestProto req = builder.build();
    try {
        rpcProxy.reportBadBlocks(NULL_CONTROLLER, req);
    } catch (ServiceException se) {
        throw ProtobufHelper.getRemoteException(se);
    }
}
Also used : ServiceException(com.google.protobuf.ServiceException) ReportBadBlocksRequestProto(org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.ReportBadBlocksRequestProto)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ReportBadBlocksRequestProto (org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.ReportBadBlocksRequestProto)1