JCLOUDS-1639: Allow filtering Azure getBlockList

This commit is contained in:
Andrew Gaul 2024-11-09 17:37:38 -08:00
parent 5b65094df1
commit 770bcce7e2
2 changed files with 12 additions and 1 deletions

View File

@ -394,6 +394,7 @@ public interface AzureBlobClient extends Closeable {
@PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToMultipartRequest.class) AzureBlob object, @PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToMultipartRequest.class) AzureBlob object,
@BinderParam(BindAzureBlocksToRequest.class) List<String> blockIdList); @BinderParam(BindAzureBlocksToRequest.class) List<String> blockIdList);
@Deprecated
@Named("GetBlockList") @Named("GetBlockList")
@GET @GET
@Path("{container}/{name}") @Path("{container}/{name}")
@ -403,6 +404,16 @@ public interface AzureBlobClient extends Closeable {
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container, @PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name); @PathParam("name") String name);
@Named("GetBlockList")
@GET
@Path("{container}/{name}")
@XMLResponseParser(BlobBlocksResultsHandler.class)
@QueryParams(keys = { "comp" }, values = { "blocklist" })
ListBlobBlocksResponse getBlockList(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name,
// valid values are committed, uncommitted, or all
@QueryParam("blocklisttype") String blockListType);
/** /**
* The Get Blob Properties operation returns all user-defined metadata, standard HTTP properties, * The Get Blob Properties operation returns all user-defined metadata, standard HTTP properties,

View File

@ -458,7 +458,7 @@ public class AzureBlobStore extends BaseBlobStore {
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) { public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
ListBlobBlocksResponse response; ListBlobBlocksResponse response;
try { try {
response = sync.getBlockList(mpu.containerName(), mpu.blobName()); response = sync.getBlockList(mpu.containerName(), mpu.blobName(), "uncommitted");
} catch (KeyNotFoundException knfe) { } catch (KeyNotFoundException knfe) {
return ImmutableList.<MultipartPart>of(); return ImmutableList.<MultipartPart>of();
} }