X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a4d0d55ac333e8060d13a600d8aa8f5443760b29..c980683a243903babe9cc09cabc71e1c6229fef1:/services/keepstore/azure_blob_volume.go diff --git a/services/keepstore/azure_blob_volume.go b/services/keepstore/azure_blob_volume.go index f135835074..f08cebff63 100644 --- a/services/keepstore/azure_blob_volume.go +++ b/services/keepstore/azure_blob_volume.go @@ -43,8 +43,7 @@ type azureVolumeAdder struct { } func (s *azureVolumeAdder) Set(containerName string) error { - if trashLifetime <= 0 { - log.Print("Missing required configuration parameter: trash-lifetime") + if trashLifetime != 0 { return ErrNotImplemented } @@ -258,7 +257,7 @@ func (v *AzureBlobVolume) Put(loc string, block []byte) error { if v.readonly { return MethodDisabledError } - return v.bsClient.CreateBlockBlobFromReader(v.containerName, loc, uint64(len(block)), bytes.NewReader(block)) + return v.bsClient.CreateBlockBlobFromReader(v.containerName, loc, uint64(len(block)), bytes.NewReader(block), nil) } // Touch updates the last-modified property of a block blob. @@ -321,6 +320,11 @@ func (v *AzureBlobVolume) Trash(loc string) error { if v.readonly { return MethodDisabledError } + + if trashLifetime != 0 { + return ErrNotImplemented + } + // Ideally we would use If-Unmodified-Since, but that // particular condition seems to be ignored by Azure. Instead, // we get the Etag before checking Mtime, and use If-Match to @@ -343,7 +347,7 @@ func (v *AzureBlobVolume) Trash(loc string) error { // Untrash a Keep block. // TBD func (v *AzureBlobVolume) Untrash(loc string) error { - return nil + return ErrNotImplemented } // Status returns a VolumeStatus struct with placeholder data. @@ -391,3 +395,9 @@ var keepBlockRegexp = regexp.MustCompile(`^[0-9a-f]{32}$`) func (v *AzureBlobVolume) isKeepBlock(s string) bool { return keepBlockRegexp.MatchString(s) } + +// EmptyTrash looks for trashed blocks that exceeded trashLifetime +// and deletes them from the volume. +// TBD +func (v *AzureBlobVolume) EmptyTrash() { +}