appendToDataStreams method
Append a batch of data measures to corresponding data streams
in studyDeploymentId.
Throws IllegalArgumentException when:
- the
studyDeploymentIdof one or more sequences inbatchdoes not matchstudyDeploymentId - the start of one or more of the sequences contained in
batchprecede the end of a previously appended sequence to the same data stream batchcontains a sequence withDataStreamIdwhich wasn't configured forstudyDeploymentId
Throws IllegalStateException when data streams for studyDeploymentId
have been closed.
Implementation
@override
Future<void> appendToDataStreams(
String studyDeploymentId,
List<DataStreamBatch> batch, {
bool compress = true,
}) async {
final payload = AppendToDataStreams(studyDeploymentId, batch);
if (compress) {
// compress the payload and POST the byte stream to the zip endpoint
_endpointName = DATA_STREAM_ZIP_ENDPOINT_NAME;
await _post(
Uri.encodeFull(rpcEndpointUri),
body: zipJson(payload.toJson()),
);
} else {
await _rpc(payload, DATA_STREAM_ENDPOINT_NAME);
}
}