
com.amazonaws.services.dynamodbv2.streams.connectors.DynamoDBBuffer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamodb-cross-region-replication Show documentation
Show all versions of dynamodb-cross-region-replication Show documentation
The DynamoDB Cross-Region Replication library allows you to replicate DynamoDB tables in real-time with Streams.
/*
* Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "LICENSE.txt" file accompanying this file.
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
package com.amazonaws.services.dynamodbv2.streams.connectors;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.annotation.NotThreadSafe;
import org.apache.log4j.Logger;
import com.amazonaws.services.cloudwatch.AmazonCloudWatch;
import com.amazonaws.services.cloudwatch.model.MetricDatum;
import com.amazonaws.services.cloudwatch.model.PutMetricDataRequest;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.Record;
import com.amazonaws.services.kinesis.connectors.interfaces.IBuffer;
/**
* A buffer that stores DynamoDB Streams records. Deduplicates based on the latest record with a given DynamoDB key.
* First and last sequence numbers are based on the entire range of records considered, even if a record has been
* overwritten by a newer record with the same key. The buffer is designed to flush on every processRecords call.
*/
@NotThreadSafe
public class DynamoDBBuffer implements IBuffer {
/**
* Logger for the DynamoDBBuffer.
*/
private static final Logger LOGGER = Logger.getLogger(DynamoDBBuffer.class);
/**
* The map of DynamoDB key to DynamoDB Stream record used to buffer writes.
*/
private final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy