Skip to content

Commit

Permalink
Headers for page blob update akka#3253
Browse files Browse the repository at this point in the history
1. Rename file write header
2. Added header for page blob for future implementation
  • Loading branch information
sfali committed Aug 29, 2024
1 parent e90a717 commit 70466ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
val blobTypeHeader: Option[HttpHeader] = None,
val leaseIdHeader: Option[HttpHeader] = None,
val fileWriteTypeHeader: Option[HttpHeader] = None,
val fileTypeHeader: Option[HttpHeader] = None,
val rangeWriteTypeHeader: Option[HttpHeader] = None,
val fileMaxContentLengthHeader: Option[HttpHeader] = None,
val pageBlobContentLengthHeader: Option[HttpHeader] = None,
val pageBlobSequenceNumberHeader: Option[HttpHeader] = None) {
Expand All @@ -30,7 +30,7 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
blobTypeHeader ++
leaseIdHeader ++
fileWriteTypeHeader ++
fileTypeHeader ++
rangeWriteTypeHeader ++
fileMaxContentLengthHeader ++
pageBlobContentLengthHeader ++
pageBlobSequenceNumberHeader).toSeq
Expand All @@ -53,8 +53,8 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
private[storage] def withLeaseIdHeader(leaseId: Option[String]): StorageHeaders =
copy(leaseIdHeader = leaseId.map(value => RawHeader(LeaseIdHeaderKey, value)))

private[storage] def withFileWriteTypeHeader(fileWriteTypeHeader: RangeWriteTypeHeader): StorageHeaders =
copy(fileWriteTypeHeader = Some(fileWriteTypeHeader.header))
private[storage] def withRangeWriteTypeHeader(fileWriteTypeHeader: RangeWriteTypeHeader): StorageHeaders =
copy(rangeWriteTypeHeader = Some(fileWriteTypeHeader.header))

private[storage] def withFileTypeHeader(): StorageHeaders =
copy(fileTypeHeader = Some(RawHeader(FileTypeHeaderKey, "file")))
Expand All @@ -76,8 +76,8 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
rangeHeader: Option[HttpHeader] = rangeHeader,
blobTypeHeader: Option[HttpHeader] = blobTypeHeader,
leaseIdHeader: Option[HttpHeader] = leaseIdHeader,
fileWriteTypeHeader: Option[HttpHeader] = fileWriteTypeHeader,
fileTypeHeader: Option[HttpHeader] = fileTypeHeader,
rangeWriteTypeHeader: Option[HttpHeader] = fileWriteTypeHeader,
fileTypeHeader: Option[HttpHeader] = rangeWriteTypeHeader,
fileMaxContentLengthHeader: Option[HttpHeader] = fileMaxContentLengthHeader,
pageBlobContentLengthHeader: Option[HttpHeader] = pageBlobContentLengthHeader,
pageBlobSequenceNumberHeader: Option[HttpHeader] = pageBlobSequenceNumberHeader) =
Expand All @@ -87,8 +87,8 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
rangeHeader = rangeHeader,
blobTypeHeader = blobTypeHeader,
leaseIdHeader = leaseIdHeader,
fileWriteTypeHeader = fileWriteTypeHeader,
fileTypeHeader = fileTypeHeader,
fileWriteTypeHeader = rangeWriteTypeHeader,
rangeWriteTypeHeader = fileTypeHeader,
fileMaxContentLengthHeader = fileMaxContentLengthHeader,
pageBlobContentLengthHeader = pageBlobContentLengthHeader,
pageBlobSequenceNumberHeader = pageBlobSequenceNumberHeader
Expand All @@ -102,7 +102,7 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
| blobTypeHeader=${blobTypeHeader.map(_.value()).getOrElse("None")},
| leaseIdHeader=${leaseIdHeader.map(_.value()).getOrElse("None")},
| fileWriteTypeHeader=${fileWriteTypeHeader.map(_.value()).getOrElse("None")},
| fileTypeHeader=${fileTypeHeader.map(_.value()).getOrElse("None")},
| fileTypeHeader=${rangeWriteTypeHeader.map(_.value()).getOrElse("None")},
| fileMaxContentLengthHeader=${fileMaxContentLengthHeader.map(_.value()).getOrElse("None")},
| pageBlobContentLengthHeader=${pageBlobContentLengthHeader.map(_.value()).getOrElse("None")},
| pageBlobSequenceNumberHeader=${pageBlobSequenceNumberHeader.map(_.value()).getOrElse("None")}
Expand Down Expand Up @@ -131,7 +131,7 @@ private[storage] class StorageHeaders private (val contentLengthHeader: Option[H
blobTypeHeader,
leaseIdHeader,
fileWriteTypeHeader,
fileTypeHeader,
rangeWriteTypeHeader,
fileMaxContentLengthHeader,
pageBlobContentLengthHeader,
pageBlobSequenceNumberHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ private[storage] case class RangeWriteTypeHeader(headerName: String, writeType:
object RangeWriteTypeHeader {
private[storage] val UpdateFileHeader = new RangeWriteTypeHeader(FileWriteTypeHeaderKey, "update")
private[storage] val ClearFileHeader = new RangeWriteTypeHeader(FileWriteTypeHeaderKey, "clear")
private[storage] val UpdatePageHeader = new RangeWriteTypeHeader(PageWriteTypeHeaderKey, "update")
private[storage] val ClearPageHeader = new RangeWriteTypeHeader(PageWriteTypeHeaderKey, "clear")
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package object storage {
private[storage] val BlobTypeHeaderKey = "x-ms-blob-type"
private[storage] val LeaseIdHeaderKey = "x-ms-lease-id"
private[storage] val FileWriteTypeHeaderKey = "x-ms-write"
private[storage] val PageWriteTypeHeaderKey = "x-ms-page-write"
private[storage] val XMsContentLengthHeaderKey = "x-ms-content-length"
private[storage] val FileTypeHeaderKey = "x-ms-type"
private[storage] val PageBlobContentLengthHeaderKey = "x-ms-blob-content-length"
Expand Down

0 comments on commit 70466ce

Please sign in to comment.