Search in sources :

Example 1 with Builder

use of org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BlockOpResponseProto.Builder in project hadoop by apache.

the class TestDataTransferProtocol method sendResponse.

private void sendResponse(Status status, String firstBadLink, String message, DataOutputStream out) throws IOException {
    Builder builder = BlockOpResponseProto.newBuilder().setStatus(status);
    if (firstBadLink != null) {
        builder.setFirstBadLink(firstBadLink);
    }
    if (message != null) {
        builder.setMessage(message);
    }
    builder.build().writeDelimitedTo(out);
}
Also used : Builder(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BlockOpResponseProto.Builder)

Aggregations

Builder (org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BlockOpResponseProto.Builder)1