private void ensureDataLoaded() { if (!isDataLoaded()) { this.data = streamingPropertyValueTableData(this.dataRowKey, this.timestamp); } }
private void ensureDataLoaded() { if (!isDataLoaded()) { this.data = streamingPropertyValueTableData(this.dataRowKey, this.timestamp); } }
@Override public List<InputStream> getInputStreams(List<StreamingPropertyValue> streamingPropertyValues) { List<StreamingPropertyValueTable> notLoadedTableSpvs = streamingPropertyValues.stream() .filter((spv) -> spv instanceof StreamingPropertyValueTable) .map((spv) -> (StreamingPropertyValueTable) spv) .filter((spv) -> !spv.isDataLoaded()) .collect(Collectors.toList()); List<String> dataRowKeys = notLoadedTableSpvs.stream() .map(StreamingPropertyValueTable::getDataRowKey) .collect(Collectors.toList()); Map<String, byte[]> tableInputStreams = streamingPropertyValueTableDatas(dataRowKeys); notLoadedTableSpvs .forEach((spv) -> { String dataRowKey = spv.getDataRowKey(); byte[] bytes = tableInputStreams.get(dataRowKey); if (bytes == null) { throw new VertexiumException("Could not find StreamingPropertyValue data: " + dataRowKey); } spv.setData(bytes); }); return streamingPropertyValues.stream() .map(StreamingPropertyValue::getInputStream) .collect(Collectors.toList()); }
@Override public List<InputStream> getInputStreams(List<StreamingPropertyValue> streamingPropertyValues) { List<StreamingPropertyValueTable> notLoadedTableSpvs = streamingPropertyValues.stream() .filter((spv) -> spv instanceof StreamingPropertyValueTable) .map((spv) -> (StreamingPropertyValueTable) spv) .filter((spv) -> !spv.isDataLoaded()) .collect(Collectors.toList()); List<String> dataRowKeys = notLoadedTableSpvs.stream() .map(StreamingPropertyValueTable::getDataRowKey) .collect(Collectors.toList()); Map<String, byte[]> tableInputStreams = streamingPropertyValueTableDatas(dataRowKeys); notLoadedTableSpvs .forEach((spv) -> { String dataRowKey = spv.getDataRowKey(); byte[] bytes = tableInputStreams.get(dataRowKey); if (bytes == null) { throw new VertexiumException("Could not find StreamingPropertyValue data: " + dataRowKey); } spv.setData(bytes); }); return streamingPropertyValues.stream() .map(StreamingPropertyValue::getInputStream) .collect(Collectors.toList()); }