private static void readGraphData(Holder holder, Channel channel, User user,
GraphPinRequest[] requestedPins, int msgId) {
holder.blockingIOProcessor.executeHistory(() -> {
try {
byte[][] data = holder.reportingDiskDao.getReportingData(user, requestedPins);
byte[] compressed = compress(requestedPins[0].dashId, data);
if (channel.isWritable()) {
channel.writeAndFlush(
makeBinaryMessage(GET_ENHANCED_GRAPH_DATA, msgId, compressed),
channel.voidPromise()
);
}
} catch (NoDataException noDataException) {
channel.writeAndFlush(noData(msgId), channel.voidPromise());
} catch (Exception e) {
log.error("Error reading reporting data. For user {}. Error: {}", user.email, e.getMessage());
channel.writeAndFlush(serverError(msgId), channel.voidPromise());
}
});
}