Skip to content

Commit 741d55a

Browse files
authored
Add copyBlob to FilterBlobContainer (#131704)
This makes it possible to hook copy in test.
1 parent b244f7a commit 741d55a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

server/src/main/java/org/elasticsearch/common/blobstore/support/FilterBlobContainer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ public void writeBlobAtomic(OperationPurpose purpose, String blobName, BytesRefe
121121
delegate.writeBlobAtomic(purpose, blobName, bytes, failIfAlreadyExists);
122122
}
123123

124+
@Override
125+
public void copyBlob(OperationPurpose purpose, BlobContainer sourceBlobContainer, String sourceBlobName, String blobName, long blobSize)
126+
throws IOException {
127+
// FsBlobContainer accesses internals of the sourceBlobContainer in copyBlob so it needs the delegate
128+
assert sourceBlobContainer instanceof FilterBlobContainer;
129+
delegate.copyBlob(purpose, ((FilterBlobContainer) sourceBlobContainer).delegate, sourceBlobName, blobName, blobSize);
130+
}
131+
124132
@Override
125133
public DeleteResult delete(OperationPurpose purpose) throws IOException {
126134
return delegate.delete(purpose);

0 commit comments

Comments
 (0)