Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,47 @@ class GoogleCloudStorageBlobContainer extends AbstractBlobContainer {
@Override
public boolean blobExists(OperationPurpose purpose, String blobName) {
try {
return blobStore.blobExists(buildKey(blobName));
return blobStore.blobExists(purpose, buildKey(blobName));
} catch (Exception e) {
throw new BlobStoreException("Failed to check if blob [" + blobName + "] exists", e);
}
}

@Override
public Map<String, BlobMetadata> listBlobs(OperationPurpose purpose) throws IOException {
return blobStore.listBlobs(path);
return blobStore.listBlobs(purpose, path);
}

@Override
public Map<String, BlobContainer> children(OperationPurpose purpose) throws IOException {
return blobStore.listChildren(path());
return blobStore.listChildren(purpose, path());
}

@Override
public Map<String, BlobMetadata> listBlobsByPrefix(OperationPurpose purpose, String prefix) throws IOException {
return blobStore.listBlobsByPrefix(path, prefix);
return blobStore.listBlobsByPrefix(purpose, path, prefix);
}

@Override
public InputStream readBlob(OperationPurpose purpose, String blobName) throws IOException {
return blobStore.readBlob(buildKey(blobName));
return blobStore.readBlob(purpose, buildKey(blobName));
}

@Override
public InputStream readBlob(OperationPurpose purpose, final String blobName, final long position, final long length)
throws IOException {
return blobStore.readBlob(buildKey(blobName), position, length);
return blobStore.readBlob(purpose, buildKey(blobName), position, length);
}

@Override
public void writeBlob(OperationPurpose purpose, String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists)
throws IOException {
blobStore.writeBlob(buildKey(blobName), inputStream, blobSize, failIfAlreadyExists);
blobStore.writeBlob(purpose, buildKey(blobName), inputStream, blobSize, failIfAlreadyExists);
}

@Override
public void writeBlob(OperationPurpose purpose, String blobName, BytesReference bytes, boolean failIfAlreadyExists) throws IOException {
blobStore.writeBlob(buildKey(blobName), bytes, failIfAlreadyExists);
blobStore.writeBlob(purpose, buildKey(blobName), bytes, failIfAlreadyExists);
}

@Override
Expand All @@ -92,7 +92,7 @@ public void writeMetadataBlob(
boolean atomic,
CheckedConsumer<OutputStream, IOException> writer
) throws IOException {
blobStore.writeBlob(buildKey(blobName), failIfAlreadyExists, writer);
blobStore.writeBlob(purpose, buildKey(blobName), failIfAlreadyExists, writer);
}

@Override
Expand All @@ -114,12 +114,12 @@ public void writeBlobAtomic(OperationPurpose purpose, String blobName, BytesRefe

@Override
public DeleteResult delete(OperationPurpose purpose) throws IOException {
return blobStore.deleteDirectory(path().buildAsString());
return blobStore.deleteDirectory(purpose, path().buildAsString());
}

@Override
public void deleteBlobsIgnoringIfNotExists(OperationPurpose purpose, Iterator<String> blobNames) throws IOException {
blobStore.deleteBlobs(new Iterator<>() {
blobStore.deleteBlobs(purpose, new Iterator<>() {
@Override
public boolean hasNext() {
return blobNames.hasNext();
Expand All @@ -145,11 +145,14 @@ public void compareAndExchangeRegister(
BytesReference updated,
ActionListener<OptionalBytesReference> listener
) {
ActionListener.completeWith(listener, () -> blobStore.compareAndExchangeRegister(buildKey(key), path, key, expected, updated));
ActionListener.completeWith(
listener,
() -> blobStore.compareAndExchangeRegister(purpose, buildKey(key), path, key, expected, updated)
);
}

@Override
public void getRegister(OperationPurpose purpose, String key, ActionListener<OptionalBytesReference> listener) {
ActionListener.completeWith(listener, () -> blobStore.getRegister(buildKey(key), path, key));
ActionListener.completeWith(listener, () -> blobStore.getRegister(purpose, buildKey(key), path, key));
}
}
Loading