in src/main/java/com/uber/rss/clients/DataBlockSocketReadClient.java [307:336]
private DataBlock readDataBlockNoCheckTaskAttemptId() {
if (!downloadStarted) {
if (this.commitTaskAttemptIds == null) {
waitDataAvailable();
}
startDownload();
downloadStarted = true;
}
if (commitTaskAttemptIds == null) {
throw new RssInvalidStateException(String.format("commitTaskAttemptIds is null, %s", connectionInfo));
}
if (commitTaskAttemptIds.isEmpty()) {
throw new RssInvalidStateException(String.format("commitTaskAttemptIds is empty, %s", connectionInfo));
}
DataBlockHeader header = readDataBlockHeader(inputStream);
if (header == null) {
return null;
}
byte[] bytes = StreamUtils.readBytes(inputStream, header.getLength());
if (bytes == null) {
throw new RssEndOfStreamException("Failed to read data block: " + this.toString());
}
return new DataBlock(header, bytes);
}