@@ -17,21 +17,31 @@ The CLI's usage follows with required parameters marked by asterisks.
1717 Use this flag to use strongly consistent scan. If the flag is not used
1818 it will default to eventually consistent scan
1919 Default: false
20- --createDestination
21- Create destination table if it does not exist
22- Default: false
2320 --copyStreamSpecificationWhenCreating
2421 Use the source table stream specification for the destination table
2522 during its creation.
2623 Default: false
24+ --createAllGsi
25+ Create all GSI in destination table
26+ Default: false
27+ --createAllLsi
28+ Create all LSI in destination table
29+ Default: false
30+ --createDestination
31+ Create destination table if it does not exist
32+ Default: false
2733 --destinationEndpoint
2834 Endpoint of the destination table
29- * --destinationRegion
35+ * --destinationSigningRegion
3036 Signing region for the destination endpoint
3137 * --destinationTable
3238 Name of the destination table
3339 --help
3440 Display usage information
41+ --includeGsi
42+ Include the following GSI in the destination table
43+ --includeLsi
44+ Include the following LSI in the destination table
3545 --maxWriteThreads
3646 Number of max threads to write to destination table
3747 Default: 1024
@@ -44,7 +54,7 @@ The CLI's usage follows with required parameters marked by asterisks.
4454 Default: 0
4555 --sourceEndpoint
4656 Endpoint of the source table
47- * --sourceRegion
57+ * --sourceSigningRegion
4858 Signing region for the source endpoint
4959 * --sourceTable
5060 Name of the source table
@@ -87,8 +97,8 @@ To transfer to a different region, create two AmazonDynamoDBClients
8797with different endpoints to pass into the DynamoDBBootstrapWorker and the DynamoDBConsumer.
8898
8999```java
90- import com.amazonaws.dynamodb.bootstrap. DynamoDBBootstrapWorker;
91- import com.amazonaws.dynamodb.bootstrap.DynamoDBConsumer;
100+ import DynamoDBBootstrapWorker;
101+ import com.amazonaws.dynamodb.bootstrap.consumer. DynamoDBConsumer;
92102import com.amazonaws.dynamodb.bootstrap.exception.NullReadCapacityException;
93103import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
94104import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
@@ -98,28 +108,22 @@ import java.util.concurrent.Executors;
98108
99109class TransferDataFromOneTableToAnother {
100110 public static void main(String[] args) {
101- AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
111+ final AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
102112 .withRegion(com.amazonaws.regions.Regions.US_WEST_1).build();
103- DynamoDBBootstrapWorker worker = null;
104113 try {
105114 // 100.0 read operations per second. 4 threads to scan the table.
106- worker = new DynamoDBBootstrapWorker(client,
115+ final DynamoDBBootstrapWorker worker = new DynamoDBBootstrapWorker(client,
107116 100.0, "mySourceTable", 4);
117+ // 50.0 write operations per second. 8 threads to scan the table.
118+ final DynamoDBConsumer consumer = new DynamoDBConsumer(client, "myDestinationTable",
119+ 50.0, Executors.newFixedThreadPool(8));
120+ worker.pipe(consumer);
108121 } catch (NullReadCapacityException e) {
109122 System.err.println("The DynamoDB source table returned a null read capacity.");
110123 System.exit(1);
111- }
112- // 50.0 write operations per second. 8 threads to scan the table.
113- DynamoDBConsumer consumer = new DynamoDBConsumer(client, "myDestinationTable", 50.0,
114- Executors.newFixedThreadPool(8));
115- try {
116- worker.pipe(consumer);
117- } catch (ExecutionException e) {
124+ } catch (ExecutionException | InterruptedException e) {
118125 System.err.println("Encountered exception when executing transfer: " + e.getMessage());
119126 System.exit(1);
120- } catch (InterruptedException e){
121- System.err.println("Interrupted when executing transfer: " + e.getMessage());
122- System.exit(1);
123127 }
124128 }
125129}
@@ -128,13 +132,15 @@ class TransferDataFromOneTableToAnother {
128132
129133### 2. Transfer Data From one DynamoDB Table to a Blocking Queue.
130134
131- The below example will read from a DynamoDB table and export to an array blocking queue. This is useful for when another application would like to consume
132- the DynamoDB entries but does not have a setup application for it. They can just retrieve the queue (consumer.getQueue()) and then continually pop() from it
135+ The below example will read from a DynamoDB table and export to an array blocking queue.
136+ This is useful for when another application would like to consume
137+ the DynamoDB entries but does not have a setup application for it.
138+ They can just retrieve the queue (consumer.getQueue()) and then continually pop() from it
133139to then process the new entries.
134140
135141```java
136- import com.amazonaws.dynamodb.bootstrap.BlockingQueueConsumer;
137- import com.amazonaws.dynamodb.bootstrap. DynamoDBBootstrapWorker;
142+ import com.amazonaws.dynamodb.bootstrap.consumer. BlockingQueueConsumer;
143+ import DynamoDBBootstrapWorker;
138144import com.amazonaws.dynamodb.bootstrap.exception.NullReadCapacityException;
139145import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
140146import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
@@ -143,29 +149,20 @@ import java.util.concurrent.ExecutionException;
143149
144150class TransferDataFromOneTableToBlockingQueue {
145151 public static void main(String[] args) {
146- AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
152+ final AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
147153 .withRegion(com.amazonaws.regions.Regions.US_WEST_1).build();
148-
149- DynamoDBBootstrapWorker worker = null;
150-
151154 try {
152155 // 100.0 read operations per second. 4 threads to scan the table.
153- worker = new DynamoDBBootstrapWorker(client, 100.0, "mySourceTable", 4);
156+ final DynamoDBBootstrapWorker worker = new DynamoDBBootstrapWorker(client, 100.0,
157+ "mySourceTable", 4);
158+ final BlockingQueueConsumer consumer = new BlockingQueueConsumer(8);
159+ worker.pipe(consumer);
154160 } catch (NullReadCapacityException e) {
155161 System.err.println("The DynamoDB source table returned a null read capacity.");
156162 System.exit(1);
157- }
158-
159- BlockingQueueConsumer consumer = new BlockingQueueConsumer(8);
160-
161- try {
162- worker.pipe(consumer);
163- } catch (ExecutionException e) {
163+ } catch (ExecutionException | InterruptedException e) {
164164 System.err.println("Encountered exception when executing transfer: " + e.getMessage());
165165 System.exit(1);
166- } catch (InterruptedException e){
167- System.err.println("Interrupted when executing transfer: " + e.getMessage());
168- System.exit(1);
169166 }
170167 }
171168}
0 commit comments