<commit_before>package com.github.awstoolkit.dynamodbbatchwriteitemmanagedretry;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.PropertiesFileCredentialsProvider;
import com.amazonaws.regions.Region;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.document.BatchWriteItemOutcome;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.Item;
import com.amazonaws.services.dynamodbv2.document.KeyAttribute;
import com.amazonaws.services.dynamodbv2.document.PrimaryKey;
import com.amazonaws.services.dynamodbv2.document.Table;
import com.amazonaws.services.dynamodbv2.document.TableWriteItems;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.DescribeTableResult;
import com.amazonaws.services.dynamodbv2.model.KeySchemaElement;
import com.amazonaws.services.dynamodbv2.model.KeyType;
import com.amazonaws.services.dynamodbv2.model.ScanRequest;
import com.amazonaws.services.dynamodbv2.model.ScanResult;
import com.amazonaws.services.dynamodbv2.model.WriteRequest;
import com.google.common.collect.Lists;

/**
 * 
 * @author <NAME>
 * @since 1.0.0
 */
public class DocumentTable {
	private static Logger LOG = LoggerFactory.getLogger(DocumentTable.class);

	protected DynamoDB dynamoDb;
	private AmazonDynamoDBClient client;
	private Table table;

	private String tableName;

	private Region operatingRegion;

	public static final int DYNAMODB_LIMITS_BATCH_WRITE_MAX = 25;

	/**
	 * The default AWS Crendentials Properties File.
	 * 
	 * @author <NAME>
	 * @since 1.0.0
	 */
	public static final String DEFAULT_AWS_CREDENTIALS_PROPERTIES_FILE = "/usr/portalbackendengine/awsCredentials.properties";

	/**
	 * Calling this constructor will initialize DocumentTable using an Aws
	 * Credentials Properties file located at
	 * {@link DocumentTable#DEFAULT_AWS_CREDENTIALS_PROPERTIES_FILE}.
	 * 
	 * @author <NAME>
	 * @since 1.0.0
	 */
	public DocumentTable() {
		this.initializeDynamoDb(DEFAULT_AWS_CREDENTIALS_PROPERTIES_FILE);
	}

	/**
	 * Calling this constructor will initialize DocumentTable using
	 * 
	 * @param secretKey
	 * @param accessKey
	 */
	public DocumentTable(final String accessKey, final String secretKey) {
		this.initializeDynamoDb(accessKey, secretKey);
	}

	/**
	 * Calling this constructor will initialize the DynamoDb client and Table.<commit_msg>update aws credentials file path<commit_after>package com.github.awstoolkit.dynamodbbatchwriteitemmanagedretry;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.PropertiesFileCredentialsProvider;
import com.amazonaws.regions.Region;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.document.BatchWriteItemOutcome;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.Item;
import com.amazonaws.services.dynamodbv2.document.KeyAttribute;
import com.amazonaws.services.dynamodbv2.document.PrimaryKey;
import com.amazonaws.services.dynamodbv2.document.Table;
import com.amazonaws.services.dynamodbv2.document.TableWriteItems;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.DescribeTableResult;
import com.amazonaws.services.dynamodbv2.model.KeySchemaElement;
import com.amazonaws.services.dynamodbv2.model.KeyType;
import com.amazonaws.services.dynamodbv2.model.ScanRequest;
import com.amazonaws.services.dynamodbv2.model.ScanResult;
import com.amazonaws.services.dynamodbv2.model.WriteRequest;
import com.google.common.collect.Lists;

/**
 * 
 * @author <NAME>
 * @since 1.0.0
 */
public class DocumentTable {
	private static Logger LOG = LoggerFactory.getLogger(DocumentTable.class);

	protected DynamoDB dynamoDb;
	private AmazonDynamoDBClient client;
	private Table table;

	private String tableName;

	private Region operatingRegion;

	public static final int DYNAMODB_LIMITS_BATCH_WRITE_MAX = 25;

	/**
	 * The default AWS Crendentials Properties File.
	 * 
	 * @author <NAME>
	 * @since 1.0.0
	 */
	public static final String DEFAULT_AWS_CREDENTIALS_PROPERTIES_FILE = "/usr/dynamodbbatchwriteitemmanagedretry/awsCredentials.properties";

	/**
	 * Calling this constructor will initialize DocumentTable using an Aws
	 * Credentials Properties file located at
	 * {@link DocumentTable#DEFAULT_AWS_CREDENTIALS_PROPERTIES_FILE}.
	 * 
	 * @author <NAME>
	 * @since 1.0.0
	 */
	public DocumentTable() {
		this.initializeDynamoDb(DEFAULT_AWS_CREDENTIALS_PROPERTIES_FILE);
	}

	/**
	 * Calling this constructor will initialize DocumentTable using
	 * 
	 * @param secretKey
	 * @param accessKey
	 */
	public DocumentTable(final String accessKey, final String secretKey) {
		this.initializeDynamoDb(accessKey, secretKey);
	}

	/**
	 * Calling this constructor will initialize the DynamoDb client and Table.
{'fraction_non_alphanumeric': 0.09169989126495107, 'fraction_numerical': 0.010148604566872055, 'mean_word_length': 5.6896969696969695, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3961283', 'n_tokens_mistral': 1798, 'n_tokens_neox': 1732, 'n_words': 327}