Search in sources :

Example 1 with StreamWriteRequestProto

use of org.apache.ratis.proto.ExamplesProtos.StreamWriteRequestProto in project incubator-ratis by apache.

the class FileStoreClient method getStreamOutput.

public DataStreamOutput getStreamOutput(String path, long dataSize, RoutingTable routingTable) {
    final StreamWriteRequestProto header = StreamWriteRequestProto.newBuilder().setPath(ProtoUtils.toByteString(path)).setLength(dataSize).build();
    final FileStoreRequestProto request = FileStoreRequestProto.newBuilder().setStream(header).build();
    return client.getDataStreamApi().stream(request.toByteString().asReadOnlyByteBuffer(), routingTable);
}
Also used : FileStoreRequestProto(org.apache.ratis.proto.ExamplesProtos.FileStoreRequestProto) StreamWriteRequestProto(org.apache.ratis.proto.ExamplesProtos.StreamWriteRequestProto)

Aggregations

FileStoreRequestProto (org.apache.ratis.proto.ExamplesProtos.FileStoreRequestProto)1 StreamWriteRequestProto (org.apache.ratis.proto.ExamplesProtos.StreamWriteRequestProto)1