-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
AmazonDynamoDBAsync.java
4618 lines (4456 loc) · 231 KB
/
AmazonDynamoDBAsync.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (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/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.dynamodbv2;
import javax.annotation.Generated;
import com.amazonaws.services.dynamodbv2.model.*;
/**
* Interface for accessing DynamoDB asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
* <p>
* <b>Note:</b> Do not directly implement this interface, new methods are added to it regularly. Extend from
* {@link com.amazonaws.services.dynamodbv2.AbstractAmazonDynamoDBAsync} instead.
* </p>
* <p>
* <fullname>Amazon DynamoDB</fullname>
* <p>
* Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with
* seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed
* database, so that you don't have to worry about hardware provisioning, setup and configuration, replication, software
* patching, or cluster scaling.
* </p>
* <p>
* With DynamoDB, you can create database tables that can store and retrieve any amount of data, and serve any level of
* request traffic. You can scale up or scale down your tables' throughput capacity without downtime or performance
* degradation, and use the Amazon Web Services Management Console to monitor resource utilization and performance
* metrics.
* </p>
* <p>
* DynamoDB automatically spreads the data and traffic for your tables over a sufficient number of servers to handle
* your throughput and storage requirements, while maintaining consistent and fast performance. All of your data is
* stored on solid state disks (SSDs) and automatically replicated across multiple Availability Zones in an Amazon Web
* Services Region, providing built-in high availability and data durability.
* </p>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public interface AmazonDynamoDBAsync extends AmazonDynamoDB {
/**
* <p>
* This operation allows you to perform batch reads or writes on data stored in DynamoDB, using PartiQL. Each read
* statement in a <code>BatchExecuteStatement</code> must specify an equality condition on all key attributes. This
* enforces that each <code>SELECT</code> statement in a batch returns at most a single item.
* </p>
* <note>
* <p>
* The entire batch must consist of either read statements or write statements, you cannot mix both in one batch.
* </p>
* </note> <important>
* <p>
* A HTTP 200 response does not mean that all statements in the BatchExecuteStatement succeeded. Error details for
* individual statements can be found under the <a href=
* "https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchStatementResponse.html#DDB-Type-BatchStatementResponse-Error"
* >Error</a> field of the <code>BatchStatementResponse</code> for each statement.
* </p>
* </important>
*
* @param batchExecuteStatementRequest
* @return A Java Future containing the result of the BatchExecuteStatement operation returned by the service.
* @sample AmazonDynamoDBAsync.BatchExecuteStatement
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchExecuteStatement" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<BatchExecuteStatementResult> batchExecuteStatementAsync(BatchExecuteStatementRequest batchExecuteStatementRequest);
/**
* <p>
* This operation allows you to perform batch reads or writes on data stored in DynamoDB, using PartiQL. Each read
* statement in a <code>BatchExecuteStatement</code> must specify an equality condition on all key attributes. This
* enforces that each <code>SELECT</code> statement in a batch returns at most a single item.
* </p>
* <note>
* <p>
* The entire batch must consist of either read statements or write statements, you cannot mix both in one batch.
* </p>
* </note> <important>
* <p>
* A HTTP 200 response does not mean that all statements in the BatchExecuteStatement succeeded. Error details for
* individual statements can be found under the <a href=
* "https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchStatementResponse.html#DDB-Type-BatchStatementResponse-Error"
* >Error</a> field of the <code>BatchStatementResponse</code> for each statement.
* </p>
* </important>
*
* @param batchExecuteStatementRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the BatchExecuteStatement operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.BatchExecuteStatement
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchExecuteStatement" target="_top">AWS
* API Documentation</a>
*/
java.util.concurrent.Future<BatchExecuteStatementResult> batchExecuteStatementAsync(BatchExecuteStatementRequest batchExecuteStatementRequest,
com.amazonaws.handlers.AsyncHandler<BatchExecuteStatementRequest, BatchExecuteStatementResult> asyncHandler);
/**
* <p>
* The <code>BatchGetItem</code> operation returns the attributes of one or more items from one or more tables. You
* identify requested items by primary key.
* </p>
* <p>
* A single operation can retrieve up to 16 MB of data, which can contain as many as 100 items.
* <code>BatchGetItem</code> returns a partial result if the response size limit is exceeded, the table's
* provisioned throughput is exceeded, more than 1MB per partition is requested, or an internal processing failure
* occurs. If a partial result is returned, the operation returns a value for <code>UnprocessedKeys</code>. You can
* use this value to retry the operation starting with the next item to get.
* </p>
* <important>
* <p>
* If you request more than 100 items, <code>BatchGetItem</code> returns a <code>ValidationException</code> with the
* message "Too many items requested for the BatchGetItem call."
* </p>
* </important>
* <p>
* For example, if you ask to retrieve 100 items, but each individual item is 300 KB in size, the system returns 52
* items (so as not to exceed the 16 MB limit). It also returns an appropriate <code>UnprocessedKeys</code> value so
* you can get the next page of results. If desired, your application can include its own logic to assemble the
* pages of results into one dataset.
* </p>
* <p>
* If <i>none</i> of the items can be processed due to insufficient provisioned throughput on all of the tables in
* the request, then <code>BatchGetItem</code> returns a <code>ProvisionedThroughputExceededException</code>. If
* <i>at least one</i> of the items is successfully processed, then <code>BatchGetItem</code> completes
* successfully, while returning the keys of the unread items in <code>UnprocessedKeys</code>.
* </p>
* <important>
* <p>
* If DynamoDB returns any unprocessed items, you should retry the batch operation on those items. However, <i>we
* strongly recommend that you use an exponential backoff algorithm</i>. If you retry the batch operation
* immediately, the underlying read or write requests can still fail due to throttling on the individual tables. If
* you delay the batch operation using exponential backoff, the individual requests in the batch are much more
* likely to succeed.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations">Batch
* Operations and Error Handling</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
* </important>
* <p>
* By default, <code>BatchGetItem</code> performs eventually consistent reads on every table in the request. If you
* want strongly consistent reads instead, you can set <code>ConsistentRead</code> to <code>true</code> for any or
* all tables.
* </p>
* <p>
* In order to minimize response latency, <code>BatchGetItem</code> may retrieve items in parallel.
* </p>
* <p>
* When designing your application, keep in mind that DynamoDB does not return items in any particular order. To
* help parse the response by item, include the primary key values for the items in your request in the
* <code>ProjectionExpression</code> parameter.
* </p>
* <p>
* If a requested item does not exist, it is not returned in the result. Requests for nonexistent items consume the
* minimum read capacity units according to the type of read. For more information, see <a href=
* "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations"
* >Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
*
* @param batchGetItemRequest
* Represents the input of a <code>BatchGetItem</code> operation.
* @return A Java Future containing the result of the BatchGetItem operation returned by the service.
* @sample AmazonDynamoDBAsync.BatchGetItem
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(BatchGetItemRequest batchGetItemRequest);
/**
* <p>
* The <code>BatchGetItem</code> operation returns the attributes of one or more items from one or more tables. You
* identify requested items by primary key.
* </p>
* <p>
* A single operation can retrieve up to 16 MB of data, which can contain as many as 100 items.
* <code>BatchGetItem</code> returns a partial result if the response size limit is exceeded, the table's
* provisioned throughput is exceeded, more than 1MB per partition is requested, or an internal processing failure
* occurs. If a partial result is returned, the operation returns a value for <code>UnprocessedKeys</code>. You can
* use this value to retry the operation starting with the next item to get.
* </p>
* <important>
* <p>
* If you request more than 100 items, <code>BatchGetItem</code> returns a <code>ValidationException</code> with the
* message "Too many items requested for the BatchGetItem call."
* </p>
* </important>
* <p>
* For example, if you ask to retrieve 100 items, but each individual item is 300 KB in size, the system returns 52
* items (so as not to exceed the 16 MB limit). It also returns an appropriate <code>UnprocessedKeys</code> value so
* you can get the next page of results. If desired, your application can include its own logic to assemble the
* pages of results into one dataset.
* </p>
* <p>
* If <i>none</i> of the items can be processed due to insufficient provisioned throughput on all of the tables in
* the request, then <code>BatchGetItem</code> returns a <code>ProvisionedThroughputExceededException</code>. If
* <i>at least one</i> of the items is successfully processed, then <code>BatchGetItem</code> completes
* successfully, while returning the keys of the unread items in <code>UnprocessedKeys</code>.
* </p>
* <important>
* <p>
* If DynamoDB returns any unprocessed items, you should retry the batch operation on those items. However, <i>we
* strongly recommend that you use an exponential backoff algorithm</i>. If you retry the batch operation
* immediately, the underlying read or write requests can still fail due to throttling on the individual tables. If
* you delay the batch operation using exponential backoff, the individual requests in the batch are much more
* likely to succeed.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations">Batch
* Operations and Error Handling</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
* </important>
* <p>
* By default, <code>BatchGetItem</code> performs eventually consistent reads on every table in the request. If you
* want strongly consistent reads instead, you can set <code>ConsistentRead</code> to <code>true</code> for any or
* all tables.
* </p>
* <p>
* In order to minimize response latency, <code>BatchGetItem</code> may retrieve items in parallel.
* </p>
* <p>
* When designing your application, keep in mind that DynamoDB does not return items in any particular order. To
* help parse the response by item, include the primary key values for the items in your request in the
* <code>ProjectionExpression</code> parameter.
* </p>
* <p>
* If a requested item does not exist, it is not returned in the result. Requests for nonexistent items consume the
* minimum read capacity units according to the type of read. For more information, see <a href=
* "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations"
* >Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
*
* @param batchGetItemRequest
* Represents the input of a <code>BatchGetItem</code> operation.
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the BatchGetItem operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.BatchGetItem
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(BatchGetItemRequest batchGetItemRequest,
com.amazonaws.handlers.AsyncHandler<BatchGetItemRequest, BatchGetItemResult> asyncHandler);
/**
* Simplified method form for invoking the BatchGetItem operation.
*
* @see #batchGetItemAsync(BatchGetItemRequest)
*/
java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(java.util.Map<String, KeysAndAttributes> requestItems, String returnConsumedCapacity);
/**
* Simplified method form for invoking the BatchGetItem operation with an AsyncHandler.
*
* @see #batchGetItemAsync(BatchGetItemRequest, com.amazonaws.handlers.AsyncHandler)
*/
java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(java.util.Map<String, KeysAndAttributes> requestItems, String returnConsumedCapacity,
com.amazonaws.handlers.AsyncHandler<BatchGetItemRequest, BatchGetItemResult> asyncHandler);
/**
* Simplified method form for invoking the BatchGetItem operation.
*
* @see #batchGetItemAsync(BatchGetItemRequest)
*/
java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(java.util.Map<String, KeysAndAttributes> requestItems);
/**
* Simplified method form for invoking the BatchGetItem operation with an AsyncHandler.
*
* @see #batchGetItemAsync(BatchGetItemRequest, com.amazonaws.handlers.AsyncHandler)
*/
java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(java.util.Map<String, KeysAndAttributes> requestItems,
com.amazonaws.handlers.AsyncHandler<BatchGetItemRequest, BatchGetItemResult> asyncHandler);
/**
* <p>
* The <code>BatchWriteItem</code> operation puts or deletes multiple items in one or more tables. A single call to
* <code>BatchWriteItem</code> can transmit up to 16MB of data over the network, consisting of up to 25 item put or
* delete operations. While individual items can be up to 400 KB once stored, it's important to note that an item's
* representation might be greater than 400KB while being sent in DynamoDB's JSON format for the API call. For more
* details on this distinction, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html"
* >Naming Rules and Data Types</a>.
* </p>
* <note>
* <p>
* <code>BatchWriteItem</code> cannot update items. If you perform a <code>BatchWriteItem</code> operation on an
* existing item, that item's values will be overwritten by the operation and it will appear like it was updated. To
* update items, we recommend you use the <code>UpdateItem</code> action.
* </p>
* </note>
* <p>
* The individual <code>PutItem</code> and <code>DeleteItem</code> operations specified in
* <code>BatchWriteItem</code> are atomic; however <code>BatchWriteItem</code> as a whole is not. If any requested
* operations fail because the table's provisioned throughput is exceeded or an internal processing failure occurs,
* the failed operations are returned in the <code>UnprocessedItems</code> response parameter. You can investigate
* and optionally resend the requests. Typically, you would call <code>BatchWriteItem</code> in a loop. Each
* iteration would check for unprocessed items and submit a new <code>BatchWriteItem</code> request with those
* unprocessed items until all items have been processed.
* </p>
* <p>
* If <i>none</i> of the items can be processed due to insufficient provisioned throughput on all of the tables in
* the request, then <code>BatchWriteItem</code> returns a <code>ProvisionedThroughputExceededException</code>.
* </p>
* <important>
* <p>
* If DynamoDB returns any unprocessed items, you should retry the batch operation on those items. However, <i>we
* strongly recommend that you use an exponential backoff algorithm</i>. If you retry the batch operation
* immediately, the underlying read or write requests can still fail due to throttling on the individual tables. If
* you delay the batch operation using exponential backoff, the individual requests in the batch are much more
* likely to succeed.
* </p>
* <p>
* For more information, see <a href=
* "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#Programming.Errors.BatchOperations"
* >Batch Operations and Error Handling</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
* </important>
* <p>
* With <code>BatchWriteItem</code>, you can efficiently write or delete large amounts of data, such as from Amazon
* EMR, or copy data from another database into DynamoDB. In order to improve performance with these large-scale
* operations, <code>BatchWriteItem</code> does not behave in the same way as individual <code>PutItem</code> and
* <code>DeleteItem</code> calls would. For example, you cannot specify conditions on individual put and delete
* requests, and <code>BatchWriteItem</code> does not return deleted items in the response.
* </p>
* <p>
* If you use a programming language that supports concurrency, you can use threads to write items in parallel. Your
* application must include the necessary logic to manage the threads. With languages that don't support threading,
* you must update or delete the specified items one at a time. In both situations, <code>BatchWriteItem</code>
* performs the specified put and delete operations in parallel, giving you the power of the thread pool approach
* without having to introduce complexity into your application.
* </p>
* <p>
* Parallel processing reduces latency, but each specified put and delete request consumes the same number of write
* capacity units whether it is processed in parallel or not. Delete operations on nonexistent items consume one
* write capacity unit.
* </p>
* <p>
* If one or more of the following is true, DynamoDB rejects the entire batch write operation:
* </p>
* <ul>
* <li>
* <p>
* One or more tables specified in the <code>BatchWriteItem</code> request does not exist.
* </p>
* </li>
* <li>
* <p>
* Primary key attributes specified on an item in the request do not match those in the corresponding table's
* primary key schema.
* </p>
* </li>
* <li>
* <p>
* You try to perform multiple operations on the same item in the same <code>BatchWriteItem</code> request. For
* example, you cannot put and delete the same item in the same <code>BatchWriteItem</code> request.
* </p>
* </li>
* <li>
* <p>
* Your request contains at least two items with identical hash and range keys (which essentially is two put
* operations).
* </p>
* </li>
* <li>
* <p>
* There are more than 25 requests in the batch.
* </p>
* </li>
* <li>
* <p>
* Any individual item in a batch exceeds 400 KB.
* </p>
* </li>
* <li>
* <p>
* The total request size exceeds 16 MB.
* </p>
* </li>
* <li>
* <p>
* Any individual items with keys exceeding the key length limits. For a partition key, the limit is 2048 bytes and
* for a sort key, the limit is 1024 bytes.
* </p>
* </li>
* </ul>
*
* @param batchWriteItemRequest
* Represents the input of a <code>BatchWriteItem</code> operation.
* @return A Java Future containing the result of the BatchWriteItem operation returned by the service.
* @sample AmazonDynamoDBAsync.BatchWriteItem
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<BatchWriteItemResult> batchWriteItemAsync(BatchWriteItemRequest batchWriteItemRequest);
/**
* <p>
* The <code>BatchWriteItem</code> operation puts or deletes multiple items in one or more tables. A single call to
* <code>BatchWriteItem</code> can transmit up to 16MB of data over the network, consisting of up to 25 item put or
* delete operations. While individual items can be up to 400 KB once stored, it's important to note that an item's
* representation might be greater than 400KB while being sent in DynamoDB's JSON format for the API call. For more
* details on this distinction, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html"
* >Naming Rules and Data Types</a>.
* </p>
* <note>
* <p>
* <code>BatchWriteItem</code> cannot update items. If you perform a <code>BatchWriteItem</code> operation on an
* existing item, that item's values will be overwritten by the operation and it will appear like it was updated. To
* update items, we recommend you use the <code>UpdateItem</code> action.
* </p>
* </note>
* <p>
* The individual <code>PutItem</code> and <code>DeleteItem</code> operations specified in
* <code>BatchWriteItem</code> are atomic; however <code>BatchWriteItem</code> as a whole is not. If any requested
* operations fail because the table's provisioned throughput is exceeded or an internal processing failure occurs,
* the failed operations are returned in the <code>UnprocessedItems</code> response parameter. You can investigate
* and optionally resend the requests. Typically, you would call <code>BatchWriteItem</code> in a loop. Each
* iteration would check for unprocessed items and submit a new <code>BatchWriteItem</code> request with those
* unprocessed items until all items have been processed.
* </p>
* <p>
* If <i>none</i> of the items can be processed due to insufficient provisioned throughput on all of the tables in
* the request, then <code>BatchWriteItem</code> returns a <code>ProvisionedThroughputExceededException</code>.
* </p>
* <important>
* <p>
* If DynamoDB returns any unprocessed items, you should retry the batch operation on those items. However, <i>we
* strongly recommend that you use an exponential backoff algorithm</i>. If you retry the batch operation
* immediately, the underlying read or write requests can still fail due to throttling on the individual tables. If
* you delay the batch operation using exponential backoff, the individual requests in the batch are much more
* likely to succeed.
* </p>
* <p>
* For more information, see <a href=
* "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#Programming.Errors.BatchOperations"
* >Batch Operations and Error Handling</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
* </important>
* <p>
* With <code>BatchWriteItem</code>, you can efficiently write or delete large amounts of data, such as from Amazon
* EMR, or copy data from another database into DynamoDB. In order to improve performance with these large-scale
* operations, <code>BatchWriteItem</code> does not behave in the same way as individual <code>PutItem</code> and
* <code>DeleteItem</code> calls would. For example, you cannot specify conditions on individual put and delete
* requests, and <code>BatchWriteItem</code> does not return deleted items in the response.
* </p>
* <p>
* If you use a programming language that supports concurrency, you can use threads to write items in parallel. Your
* application must include the necessary logic to manage the threads. With languages that don't support threading,
* you must update or delete the specified items one at a time. In both situations, <code>BatchWriteItem</code>
* performs the specified put and delete operations in parallel, giving you the power of the thread pool approach
* without having to introduce complexity into your application.
* </p>
* <p>
* Parallel processing reduces latency, but each specified put and delete request consumes the same number of write
* capacity units whether it is processed in parallel or not. Delete operations on nonexistent items consume one
* write capacity unit.
* </p>
* <p>
* If one or more of the following is true, DynamoDB rejects the entire batch write operation:
* </p>
* <ul>
* <li>
* <p>
* One or more tables specified in the <code>BatchWriteItem</code> request does not exist.
* </p>
* </li>
* <li>
* <p>
* Primary key attributes specified on an item in the request do not match those in the corresponding table's
* primary key schema.
* </p>
* </li>
* <li>
* <p>
* You try to perform multiple operations on the same item in the same <code>BatchWriteItem</code> request. For
* example, you cannot put and delete the same item in the same <code>BatchWriteItem</code> request.
* </p>
* </li>
* <li>
* <p>
* Your request contains at least two items with identical hash and range keys (which essentially is two put
* operations).
* </p>
* </li>
* <li>
* <p>
* There are more than 25 requests in the batch.
* </p>
* </li>
* <li>
* <p>
* Any individual item in a batch exceeds 400 KB.
* </p>
* </li>
* <li>
* <p>
* The total request size exceeds 16 MB.
* </p>
* </li>
* <li>
* <p>
* Any individual items with keys exceeding the key length limits. For a partition key, the limit is 2048 bytes and
* for a sort key, the limit is 1024 bytes.
* </p>
* </li>
* </ul>
*
* @param batchWriteItemRequest
* Represents the input of a <code>BatchWriteItem</code> operation.
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the BatchWriteItem operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.BatchWriteItem
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<BatchWriteItemResult> batchWriteItemAsync(BatchWriteItemRequest batchWriteItemRequest,
com.amazonaws.handlers.AsyncHandler<BatchWriteItemRequest, BatchWriteItemResult> asyncHandler);
/**
* Simplified method form for invoking the BatchWriteItem operation.
*
* @see #batchWriteItemAsync(BatchWriteItemRequest)
*/
java.util.concurrent.Future<BatchWriteItemResult> batchWriteItemAsync(java.util.Map<String, java.util.List<WriteRequest>> requestItems);
/**
* Simplified method form for invoking the BatchWriteItem operation with an AsyncHandler.
*
* @see #batchWriteItemAsync(BatchWriteItemRequest, com.amazonaws.handlers.AsyncHandler)
*/
java.util.concurrent.Future<BatchWriteItemResult> batchWriteItemAsync(java.util.Map<String, java.util.List<WriteRequest>> requestItems,
com.amazonaws.handlers.AsyncHandler<BatchWriteItemRequest, BatchWriteItemResult> asyncHandler);
/**
* <p>
* Creates a backup for an existing table.
* </p>
* <p>
* Each time you create an on-demand backup, the entire table data is backed up. There is no limit to the number of
* on-demand backups that can be taken.
* </p>
* <p>
* When you create an on-demand backup, a time marker of the request is cataloged, and the backup is created
* asynchronously, by applying all changes until the time of the request to the last full table snapshot. Backup
* requests are processed instantaneously and become available for restore within minutes.
* </p>
* <p>
* You can call <code>CreateBackup</code> at a maximum rate of 50 times per second.
* </p>
* <p>
* All backups in DynamoDB work without consuming any provisioned throughput on the table.
* </p>
* <p>
* If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed to contain all data committed
* to the table up to 14:24:00, and data committed after 14:26:00 will not be. The backup might contain data
* modifications made between 14:24:00 and 14:26:00. On-demand backup does not support causal consistency.
* </p>
* <p>
* Along with data, the following are also included on the backups:
* </p>
* <ul>
* <li>
* <p>
* Global secondary indexes (GSIs)
* </p>
* </li>
* <li>
* <p>
* Local secondary indexes (LSIs)
* </p>
* </li>
* <li>
* <p>
* Streams
* </p>
* </li>
* <li>
* <p>
* Provisioned read and write capacity
* </p>
* </li>
* </ul>
*
* @param createBackupRequest
* @return A Java Future containing the result of the CreateBackup operation returned by the service.
* @sample AmazonDynamoDBAsync.CreateBackup
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateBackup" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateBackupResult> createBackupAsync(CreateBackupRequest createBackupRequest);
/**
* <p>
* Creates a backup for an existing table.
* </p>
* <p>
* Each time you create an on-demand backup, the entire table data is backed up. There is no limit to the number of
* on-demand backups that can be taken.
* </p>
* <p>
* When you create an on-demand backup, a time marker of the request is cataloged, and the backup is created
* asynchronously, by applying all changes until the time of the request to the last full table snapshot. Backup
* requests are processed instantaneously and become available for restore within minutes.
* </p>
* <p>
* You can call <code>CreateBackup</code> at a maximum rate of 50 times per second.
* </p>
* <p>
* All backups in DynamoDB work without consuming any provisioned throughput on the table.
* </p>
* <p>
* If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed to contain all data committed
* to the table up to 14:24:00, and data committed after 14:26:00 will not be. The backup might contain data
* modifications made between 14:24:00 and 14:26:00. On-demand backup does not support causal consistency.
* </p>
* <p>
* Along with data, the following are also included on the backups:
* </p>
* <ul>
* <li>
* <p>
* Global secondary indexes (GSIs)
* </p>
* </li>
* <li>
* <p>
* Local secondary indexes (LSIs)
* </p>
* </li>
* <li>
* <p>
* Streams
* </p>
* </li>
* <li>
* <p>
* Provisioned read and write capacity
* </p>
* </li>
* </ul>
*
* @param createBackupRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the CreateBackup operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.CreateBackup
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateBackup" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateBackupResult> createBackupAsync(CreateBackupRequest createBackupRequest,
com.amazonaws.handlers.AsyncHandler<CreateBackupRequest, CreateBackupResult> asyncHandler);
/**
* <p>
* Creates a global table from an existing table. A global table creates a replication relationship between two or
* more DynamoDB tables with the same table name in the provided Regions.
* </p>
* <important>
* <p>
* This documentation is for version 2017.11.29 (Legacy) of global tables, which should be avoided for new global
* tables. Customers should use <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html">Global Tables version
* 2019.11.21 (Current)</a> when possible, because it provides greater flexibility, higher efficiency, and consumes
* less write capacity than 2017.11.29 (Legacy).
* </p>
* <p>
* To determine which version you're using, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.DetermineVersion.html"
* >Determining the global table version you are using</a>. To update existing global tables from version 2017.11.29
* (Legacy) to version 2019.11.21 (Current), see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_upgrade.html">Upgrading
* global tables</a>.
* </p>
* </important>
* <p>
* If you want to add a new replica table to a global table, each of the following conditions must be true:
* </p>
* <ul>
* <li>
* <p>
* The table must have the same primary key as all of the other replicas.
* </p>
* </li>
* <li>
* <p>
* The table must have the same name as all of the other replicas.
* </p>
* </li>
* <li>
* <p>
* The table must have DynamoDB Streams enabled, with the stream containing both the new and the old images of the
* item.
* </p>
* </li>
* <li>
* <p>
* None of the replica tables in the global table can contain any data.
* </p>
* </li>
* </ul>
* <p>
* If global secondary indexes are specified, then the following conditions must also be met:
* </p>
* <ul>
* <li>
* <p>
* The global secondary indexes must have the same name.
* </p>
* </li>
* <li>
* <p>
* The global secondary indexes must have the same hash key and sort key (if present).
* </p>
* </li>
* </ul>
* <p>
* If local secondary indexes are specified, then the following conditions must also be met:
* </p>
* <ul>
* <li>
* <p>
* The local secondary indexes must have the same name.
* </p>
* </li>
* <li>
* <p>
* The local secondary indexes must have the same hash key and sort key (if present).
* </p>
* </li>
* </ul>
* <important>
* <p>
* Write capacity settings should be set consistently across your replica tables and secondary indexes. DynamoDB
* strongly recommends enabling auto scaling to manage the write capacity settings for all of your global tables
* replicas and indexes.
* </p>
* <p>
* If you prefer to manage write capacity settings manually, you should provision equal replicated write capacity
* units to your replica tables. You should also provision equal replicated write capacity units to matching
* secondary indexes across your global table.
* </p>
* </important>
*
* @param createGlobalTableRequest
* @return A Java Future containing the result of the CreateGlobalTable operation returned by the service.
* @sample AmazonDynamoDBAsync.CreateGlobalTable
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateGlobalTable" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateGlobalTableResult> createGlobalTableAsync(CreateGlobalTableRequest createGlobalTableRequest);
/**
* <p>
* Creates a global table from an existing table. A global table creates a replication relationship between two or
* more DynamoDB tables with the same table name in the provided Regions.
* </p>
* <important>
* <p>
* This documentation is for version 2017.11.29 (Legacy) of global tables, which should be avoided for new global
* tables. Customers should use <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html">Global Tables version
* 2019.11.21 (Current)</a> when possible, because it provides greater flexibility, higher efficiency, and consumes
* less write capacity than 2017.11.29 (Legacy).
* </p>
* <p>
* To determine which version you're using, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.DetermineVersion.html"
* >Determining the global table version you are using</a>. To update existing global tables from version 2017.11.29
* (Legacy) to version 2019.11.21 (Current), see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_upgrade.html">Upgrading
* global tables</a>.
* </p>
* </important>
* <p>
* If you want to add a new replica table to a global table, each of the following conditions must be true:
* </p>
* <ul>
* <li>
* <p>
* The table must have the same primary key as all of the other replicas.
* </p>
* </li>
* <li>
* <p>
* The table must have the same name as all of the other replicas.
* </p>
* </li>
* <li>
* <p>
* The table must have DynamoDB Streams enabled, with the stream containing both the new and the old images of the
* item.
* </p>
* </li>
* <li>
* <p>
* None of the replica tables in the global table can contain any data.
* </p>
* </li>
* </ul>
* <p>
* If global secondary indexes are specified, then the following conditions must also be met:
* </p>
* <ul>
* <li>
* <p>
* The global secondary indexes must have the same name.
* </p>
* </li>
* <li>
* <p>
* The global secondary indexes must have the same hash key and sort key (if present).
* </p>
* </li>
* </ul>
* <p>
* If local secondary indexes are specified, then the following conditions must also be met:
* </p>
* <ul>
* <li>
* <p>
* The local secondary indexes must have the same name.
* </p>
* </li>
* <li>
* <p>
* The local secondary indexes must have the same hash key and sort key (if present).
* </p>
* </li>
* </ul>
* <important>
* <p>
* Write capacity settings should be set consistently across your replica tables and secondary indexes. DynamoDB
* strongly recommends enabling auto scaling to manage the write capacity settings for all of your global tables
* replicas and indexes.
* </p>
* <p>
* If you prefer to manage write capacity settings manually, you should provision equal replicated write capacity
* units to your replica tables. You should also provision equal replicated write capacity units to matching
* secondary indexes across your global table.
* </p>
* </important>
*
* @param createGlobalTableRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the CreateGlobalTable operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.CreateGlobalTable
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateGlobalTable" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateGlobalTableResult> createGlobalTableAsync(CreateGlobalTableRequest createGlobalTableRequest,
com.amazonaws.handlers.AsyncHandler<CreateGlobalTableRequest, CreateGlobalTableResult> asyncHandler);
/**
* <p>
* The <code>CreateTable</code> operation adds a new table to your account. In an Amazon Web Services account, table
* names must be unique within each Region. That is, you can have two tables with same name if you create the tables
* in different Regions.
* </p>
* <p>
* <code>CreateTable</code> is an asynchronous operation. Upon receiving a <code>CreateTable</code> request,
* DynamoDB immediately returns a response with a <code>TableStatus</code> of <code>CREATING</code>. After the table
* is created, DynamoDB sets the <code>TableStatus</code> to <code>ACTIVE</code>. You can perform read and write
* operations only on an <code>ACTIVE</code> table.
* </p>
* <p>
* You can optionally define secondary indexes on the new table, as part of the <code>CreateTable</code> operation.
* If you want to create multiple tables with secondary indexes on them, you must create the tables sequentially.
* Only one table with secondary indexes can be in the <code>CREATING</code> state at any given time.
* </p>
* <p>
* You can use the <code>DescribeTable</code> action to check the table status.
* </p>
*
* @param createTableRequest
* Represents the input of a <code>CreateTable</code> operation.
* @return A Java Future containing the result of the CreateTable operation returned by the service.
* @sample AmazonDynamoDBAsync.CreateTable
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateTableResult> createTableAsync(CreateTableRequest createTableRequest);
/**
* <p>
* The <code>CreateTable</code> operation adds a new table to your account. In an Amazon Web Services account, table
* names must be unique within each Region. That is, you can have two tables with same name if you create the tables
* in different Regions.
* </p>
* <p>
* <code>CreateTable</code> is an asynchronous operation. Upon receiving a <code>CreateTable</code> request,
* DynamoDB immediately returns a response with a <code>TableStatus</code> of <code>CREATING</code>. After the table
* is created, DynamoDB sets the <code>TableStatus</code> to <code>ACTIVE</code>. You can perform read and write
* operations only on an <code>ACTIVE</code> table.
* </p>
* <p>
* You can optionally define secondary indexes on the new table, as part of the <code>CreateTable</code> operation.
* If you want to create multiple tables with secondary indexes on them, you must create the tables sequentially.
* Only one table with secondary indexes can be in the <code>CREATING</code> state at any given time.
* </p>
* <p>
* You can use the <code>DescribeTable</code> action to check the table status.
* </p>
*
* @param createTableRequest
* Represents the input of a <code>CreateTable</code> operation.
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the CreateTable operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.CreateTable
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<CreateTableResult> createTableAsync(CreateTableRequest createTableRequest,
com.amazonaws.handlers.AsyncHandler<CreateTableRequest, CreateTableResult> asyncHandler);
/**
* Simplified method form for invoking the CreateTable operation.
*
* @see #createTableAsync(CreateTableRequest)
*/
java.util.concurrent.Future<CreateTableResult> createTableAsync(java.util.List<AttributeDefinition> attributeDefinitions, String tableName,
java.util.List<KeySchemaElement> keySchema, ProvisionedThroughput provisionedThroughput);
/**
* Simplified method form for invoking the CreateTable operation with an AsyncHandler.
*
* @see #createTableAsync(CreateTableRequest, com.amazonaws.handlers.AsyncHandler)
*/
java.util.concurrent.Future<CreateTableResult> createTableAsync(java.util.List<AttributeDefinition> attributeDefinitions, String tableName,
java.util.List<KeySchemaElement> keySchema, ProvisionedThroughput provisionedThroughput,
com.amazonaws.handlers.AsyncHandler<CreateTableRequest, CreateTableResult> asyncHandler);
/**
* <p>
* Deletes an existing backup of a table.
* </p>
* <p>
* You can call <code>DeleteBackup</code> at a maximum rate of 10 times per second.
* </p>
*
* @param deleteBackupRequest
* @return A Java Future containing the result of the DeleteBackup operation returned by the service.
* @sample AmazonDynamoDBAsync.DeleteBackup
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteBackup" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<DeleteBackupResult> deleteBackupAsync(DeleteBackupRequest deleteBackupRequest);
/**
* <p>
* Deletes an existing backup of a table.
* </p>
* <p>
* You can call <code>DeleteBackup</code> at a maximum rate of 10 times per second.
* </p>
*
* @param deleteBackupRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the DeleteBackup operation returned by the service.
* @sample AmazonDynamoDBAsyncHandler.DeleteBackup
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteBackup" target="_top">AWS API
* Documentation</a>
*/
java.util.concurrent.Future<DeleteBackupResult> deleteBackupAsync(DeleteBackupRequest deleteBackupRequest,
com.amazonaws.handlers.AsyncHandler<DeleteBackupRequest, DeleteBackupResult> asyncHandler);
/**
* <p>
* Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the