Package com.github.ambry.router
Class GetBlobOptionsBuilder
- java.lang.Object
-
- com.github.ambry.router.GetBlobOptionsBuilder
-
public class GetBlobOptionsBuilder extends java.lang.Object
A builder forGetBlobOptions
objects. The following options will be assigned by default:GetBlobOptions.OperationType.All
,GetOption.None
and noByteRange
.
-
-
Constructor Summary
Constructors Constructor Description GetBlobOptionsBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetBlobOptionsBuilder
blobSegment(int blobSegmentIdx)
GetBlobOptions
build()
GetBlobOptionsBuilder
getOption(GetOption getOption)
GetBlobOptionsBuilder
operationType(GetBlobOptions.OperationType operationType)
GetBlobOptionsBuilder
range(ByteRange range)
GetBlobOptionsBuilder
rawMode(boolean rawMode)
GetBlobOptionsBuilder
resolveRangeOnEmptyBlob(boolean resolveRangeOnEmptyBlob)
-
-
-
Method Detail
-
operationType
public GetBlobOptionsBuilder operationType(GetBlobOptions.OperationType operationType)
- Parameters:
operationType
- theGetBlobOptions.OperationType
for this request.- Returns:
- this builder
-
getOption
public GetBlobOptionsBuilder getOption(GetOption getOption)
- Parameters:
getOption
- theGetOption
associated with the request.- Returns:
- this builder
-
range
public GetBlobOptionsBuilder range(ByteRange range)
- Parameters:
range
- aByteRange
for this get request. This can be null, if the entire blob is desired.- Returns:
- this builder
-
resolveRangeOnEmptyBlob
public GetBlobOptionsBuilder resolveRangeOnEmptyBlob(boolean resolveRangeOnEmptyBlob)
- Parameters:
resolveRangeOnEmptyBlob
-true
to indicate that the router should a successful response for a range request against an empty (0 byte) blob instead of returning aRouterErrorCode.RangeNotSatisfiable
error.- Returns:
- this builder
-
rawMode
public GetBlobOptionsBuilder rawMode(boolean rawMode)
- Parameters:
rawMode
- the raw mode flag for this get request. If rawMode is true, the returnedGetBlobResult
will contain the raw (unserialized) blob payload in the data channel and null blobInfo. This option cannot be used in conjunction with a byte range.- Returns:
- this builder
-
blobSegment
public GetBlobOptionsBuilder blobSegment(int blobSegmentIdx)
- Parameters:
blobSegmentIdx
- blob segment index of a metadata blob that one wants to get.- Returns:
- this builder
-
build
public GetBlobOptions build()
- Returns:
- the
GetBlobOptions
built.
-
-