Class Size
Represents the amount of digital storage.
Inheritance
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Size : DeputyBase
Syntax (vb)
Public Class Size
Inherits DeputyBase
Remarks
The amount can be specified either as a literal value (e.g: 10
) which
cannot be negative, or as an unresolved number token.
When the amount is passed as a token, unit conversion is not possible.
ExampleMetadata: infused
Examples
Bucket bucket;
// Provide a Lambda function that will transform records before delivery, with custom
// buffering and retry configuration
var lambdaFunction = new Function(this, "Processor", new FunctionProps {
Runtime = Runtime.NODEJS_LATEST,
Handler = "index.handler",
Code = Code.FromAsset(Join(__dirname, "process-records"))
});
var lambdaProcessor = new LambdaFunctionProcessor(lambdaFunction, new DataProcessorProps {
BufferInterval = Duration.Minutes(5),
BufferSize = Size.Mebibytes(5),
Retries = 5
});
var s3Destination = new S3Bucket(bucket, new S3BucketProps {
Processor = lambdaProcessor
});
new DeliveryStream(this, "Delivery Stream", new DeliveryStreamProps {
Destination = s3Destination
});
Synopsis
Constructors
Size(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Size(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bytes(Double) | Create a Storage representing an amount bytes. |
Gibibytes(Double) | Create a Storage representing an amount gibibytes. |
IsUnresolved() | Checks if size is a token or a resolvable object. |
Kibibytes(Double) | Create a Storage representing an amount kibibytes. |
Mebibytes(Double) | Create a Storage representing an amount mebibytes. |
Pebibytes(Double) | Create a Storage representing an amount pebibytes. |
Tebibytes(Double) | Create a Storage representing an amount tebibytes. |
ToBytes(ISizeConversionOptions) | Return this storage as a total number of bytes. |
ToGibibytes(ISizeConversionOptions) | Return this storage as a total number of gibibytes. |
ToKibibytes(ISizeConversionOptions) | Return this storage as a total number of kibibytes. |
ToMebibytes(ISizeConversionOptions) | Return this storage as a total number of mebibytes. |
ToPebibytes(ISizeConversionOptions) | Return this storage as a total number of pebibytes. |
ToTebibytes(ISizeConversionOptions) | Return this storage as a total number of tebibytes. |
Constructors
Size(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Size(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Size(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Size(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bytes(Double)
Create a Storage representing an amount bytes.
public static Size Bytes(double amount)
Parameters
- amount System.Double
the amount of bytes to be represented.
Returns
a new Size
instance
Gibibytes(Double)
Create a Storage representing an amount gibibytes.
public static Size Gibibytes(double amount)
Parameters
- amount System.Double
the amount of gibibytes to be represented.
Returns
a new Size
instance
Remarks
1 GiB = 1024 MiB
IsUnresolved()
Checks if size is a token or a resolvable object.
public virtual bool IsUnresolved()
Returns
System.Boolean
Kibibytes(Double)
Create a Storage representing an amount kibibytes.
public static Size Kibibytes(double amount)
Parameters
- amount System.Double
the amount of kibibytes to be represented.
Returns
a new Size
instance
Remarks
1 KiB = 1024 bytes
Mebibytes(Double)
Create a Storage representing an amount mebibytes.
public static Size Mebibytes(double amount)
Parameters
- amount System.Double
the amount of mebibytes to be represented.
Returns
a new Size
instance
Remarks
1 MiB = 1024 KiB
Pebibytes(Double)
Create a Storage representing an amount pebibytes.
public static Size Pebibytes(double amount)
Parameters
- amount System.Double
the amount of pebibytes to be represented.
Returns
a new Size
instance
Remarks
1 PiB = 1024 TiB
Tebibytes(Double)
Create a Storage representing an amount tebibytes.
public static Size Tebibytes(double amount)
Parameters
- amount System.Double
the amount of tebibytes to be represented.
Returns
a new Size
instance
Remarks
1 TiB = 1024 GiB
ToBytes(ISizeConversionOptions)
Return this storage as a total number of bytes.
public virtual double ToBytes(ISizeConversionOptions opts = null)
Parameters
- opts ISizeConversionOptions
the conversion options.
Returns
System.Double
the quantity expressed in bytes
ToGibibytes(ISizeConversionOptions)
Return this storage as a total number of gibibytes.
public virtual double ToGibibytes(ISizeConversionOptions opts = null)
Parameters
- opts ISizeConversionOptions
the conversion options.
Returns
System.Double
the quantity of bytes expressed in gibibytes
ToKibibytes(ISizeConversionOptions)
Return this storage as a total number of kibibytes.
public virtual double ToKibibytes(ISizeConversionOptions opts = null)
Parameters
- opts ISizeConversionOptions
the conversion options.
Returns
System.Double
the quantity of bytes expressed in kibibytes
ToMebibytes(ISizeConversionOptions)
Return this storage as a total number of mebibytes.
public virtual double ToMebibytes(ISizeConversionOptions opts = null)
Parameters
- opts ISizeConversionOptions
the conversion options.
Returns
System.Double
the quantity of bytes expressed in mebibytes
ToPebibytes(ISizeConversionOptions)
Return this storage as a total number of pebibytes.
public virtual double ToPebibytes(ISizeConversionOptions opts = null)
Parameters
- opts ISizeConversionOptions
the conversion options.
Returns
System.Double
the quantity of bytes expressed in pebibytes
ToTebibytes(ISizeConversionOptions)
Return this storage as a total number of tebibytes.
public virtual double ToTebibytes(ISizeConversionOptions opts = null)
Parameters
- opts ISizeConversionOptions
the conversion options.
Returns
System.Double
the quantity of bytes expressed in tebibytes