HesandaLiyanage commented on code in PR #3193:
URL: https://github.com/apache/james-project/pull/3193#discussion_r4070307448
##########
server/blob/blob-api/src/main/java/org/apache/james/blob/api/BlobStoreDAO.java:
##########
@@ -303,4 +304,52 @@ default Publisher<BlobId> listBlobs(BucketName bucketName,
String prefix) {
return Flux.from(listBlobs(bucketName))
.filter(blobId -> blobId.asString().startsWith(prefix));
}
+
+ record RangeByteSlice(byte[] data, long totalObjectSize) {
+ public static RangeByteSlice of(byte[] data, long totalObjectSize) {
+ return new RangeByteSlice(data, totalObjectSize);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ RangeByteSlice that = (RangeByteSlice) o;
+ return totalObjectSize == that.totalObjectSize &&
Arrays.equals(data, that.data);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = Objects.hash(totalObjectSize);
+ result = 31 * result + Arrays.hashCode(data);
+ return result;
+ }
+ }
+
+ default Mono<RangeByteSlice> readRange(BucketName bucketName, BlobId
blobId, long start, long end) {
Review Comment:
Done. `readRange` now returns `Publisher<Blob>` preserving metadata and
payload, allowing `ChunkedBlobStoreDAO` to propagate blob metadata through the
blob store hierarchy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]