Skip to content

Commit

Permalink
fix return types akka#3253
Browse files Browse the repository at this point in the history
  • Loading branch information
sfali committed Aug 29, 2024
1 parent a4e0687 commit dc22e08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ object AzureStorageStream {
.mapMaterializedValue(_ => NotUsed)
}

private[storage] def putPageOrAppendBlock(objectPath: String, headers: Seq[HttpHeader]) = {
private[storage] def putPageOrAppendBlock(objectPath: String,
headers: Seq[HttpHeader]): Source[Option[ObjectMetadata], NotUsed] = {
Source
.fromMaterializer { (mat, attr) =>
implicit val system: ActorSystem = mat.system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,19 @@ object BlobService {
def putPageBlock(objectPath: String,
contentType: ContentType,
maxBlockSize: Long,
blobSequenceNumber: Option[Int],
leaseId: Optional[String]): Source[Optional[ObjectMetadata], NotUsed.type] =
blobSequenceNumber: Optional[Int],
leaseId: Optional[String]): Source[Optional[ObjectMetadata], NotUsed] =
AzureStorageStream
.putPageOrAppendBlock(
objectPath,
StorageHeaders
.create()
.withContentLengthHeader(0L)
.withContentTypeHeader(contentType.asInstanceOf[ScalaContentType])
.withBlobTypeHeader(BlobTypeHeader.PageBlobHeader)
.withPageBlobContentLengthHeader(maxBlockSize)
.withPageBlobSequenceNumberHeader(blobSequenceNumber)
.withPageBlobSequenceNumberHeader(
Option(blobSequenceNumber.map(i => Integer.getInteger(i.toString)).orElse(null))
)
.withLeaseIdHeader(Option(leaseId.orElse(null)))
.headers
)
Expand All @@ -194,13 +195,12 @@ object BlobService {
*/
def putAppendBlock(objectPath: String,
contentType: ContentType,
leaseId: Optional[String]): Source[Optional[ObjectMetadata], NotUsed.type] =
leaseId: Optional[String]): Source[Optional[ObjectMetadata], NotUsed] =
AzureStorageStream
.putPageOrAppendBlock(
objectPath,
StorageHeaders
.create()
.withContentLengthHeader(0L)
.withContentTypeHeader(contentType.asInstanceOf[ScalaContentType])
.withBlobTypeHeader(BlobTypeHeader.AppendBlobHeader)
.withLeaseIdHeader(Option(leaseId.orElse(null)))
Expand Down

0 comments on commit dc22e08

Please sign in to comment.