public final class DynamoDBProxyManager extends Object
Example of CloudFormation definition of table:
Resources:
RateLimitsTable:
Type: 'AWS::DynamoDB::Table'
Properties:
# Table name can be specified in the next property
# (uncomment it) or be auto-generated (leave as is).
# TableName: rate-limits
AttributeDefinitions:
# Attribute name can not be altered at the moment
# and should be 'key'.
- AttributeName: 'key'
# Only S and N types are supported at the moment.
# Use S if you want to use string keys and N for
# long keys.
AttributeType: 'S'
# Actual state will be stored in 'state' attribute
# (name can not be altered at the moment) but it is
# not a part of primary key so is not defined.
KeySchema:
- AttributeName: 'key'
KeyType: 'HASH'
# On-demand billing more is used to simplify example,
# provisioned capacity can be used as well.
BillingMode: 'PAY_PER_REQUEST'
Table that is on-demand and can be used with stringKey(AmazonDynamoDB, String, ClientSideConfig).| Modifier and Type | Method and Description |
|---|---|
static io.github.bucket4j.dynamodb.v1.BaseDynamoDBProxyManager<Long> |
longKey(com.amazonaws.services.dynamodbv2.AmazonDynamoDB db,
String table,
ClientSideConfig config)
Returns implementation that uses
Long (DynamoDB Number) for keys. |
static io.github.bucket4j.dynamodb.v1.BaseDynamoDBProxyManager<String> |
stringKey(com.amazonaws.services.dynamodbv2.AmazonDynamoDB db,
String table,
ClientSideConfig config)
Returns implementation that uses
String (DynamoDB String) for keys. |
public static io.github.bucket4j.dynamodb.v1.BaseDynamoDBProxyManager<String> stringKey(com.amazonaws.services.dynamodbv2.AmazonDynamoDB db, String table, ClientSideConfig config)
String (DynamoDB String) for keys.
NOTE: DynamoDB supports at most 2048 bytes (in StandardCharsets.UTF_8) for
primary String keys.db - AmazonDynamoDB client to access DynamoDB table.table - name of DynamoDB table.config - ClientSideConfig configuration.public static io.github.bucket4j.dynamodb.v1.BaseDynamoDBProxyManager<Long> longKey(com.amazonaws.services.dynamodbv2.AmazonDynamoDB db, String table, ClientSideConfig config)
Long (DynamoDB Number) for keys.db - AmazonDynamoDB client to access DynamoDB table.table - name of DynamoDB table.config - ClientSideConfig configuration.Copyright © 2022. All rights reserved.