List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDBAsyncClient AmazonDynamoDBAsyncClient
@Deprecated
public AmazonDynamoDBAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
ExecutorService executorService)
From source file:io.fineo.drill.exec.store.dynamo.physical.DynamoRecordReader.java
License:Apache License
@Override public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException { this.operatorContext = context; this.outputMutator = output; this.client = new AmazonDynamoDBAsyncClient(credentials, this.clientConf); endpoint.configure(this.client); // setup the vectors that we know we will need - the primary key(s) if (this.keyMapper != null) { for (DynamoTableDefinition.PrimaryKey pk : tableDef.getKeys()) { if (pk.getIsHashKey()) { this.hash = pk; } else { this.range = pk; }/* w w w . j a va 2 s. c o m*/ } DynamoKeyMapperSpec spec = tableDef.getKeyMapper(); for (int i = 0; i < spec.getKeyNames().size(); i++) { addDynamoKeyVector(spec.getKeyNames().get(i), spec.getKeyValues().get(i)); } } else { for (DynamoTableDefinition.PrimaryKey pk : tableDef.getKeys()) { addDynamoKeyVector(pk.getName(), pk.getType()); } } DynamoQueryBuilder builder = new DynamoQueryBuilder().withSlice(scanSlice) .withConsistentRead(consistentRead).withTable(tableDef); // TODO skip queries, which just want the primary key values if (!isStarQuery()) { List<String> columns = new ArrayList<>(); for (SchemaPath column : getColumns()) { columns.add(buildPathName(column, AMAZON_MAX_DEPTH, listIndexes, true)); } builder.withColumns(columns); } this.resultIter = buildQuery(builder, client); }