/** * <p> * Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent * reads; otherwise, the operation uses eventually consistent reads. * </p> * <p> * Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index * with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>. * </p> * * @param consistentRead * Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly * consistent reads; otherwise, the operation uses eventually consistent reads.</p> * <p> * Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary * index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a * <code>ValidationException</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryRequest withConsistentRead(Boolean consistentRead) { setConsistentRead(consistentRead); return this; }
public QuerySpec withConsistentRead(boolean consistentRead) { getRequest().setConsistentRead(consistentRead); return this; }
protected <T> QueryRequest createQueryRequestFromExpression(Class<T> clazz, DynamoDBQueryExpression<T> xpress, DynamoDBMapperConfig config) { final DynamoDBMapperTableModel<T> model = getTableModel(clazz, config); QueryRequest req = new QueryRequest(); req.setConsistentRead(xpress.isConsistentRead()); req.setTableName(getTableName(clazz, xpress.getHashKeyValues(), config)); req.setIndexName(xpress.getIndexName()); req.setKeyConditionExpression(xpress.getKeyConditionExpression()); processKeyConditions(req, xpress, model); req.withScanIndexForward(xpress.isScanIndexForward()) .withLimit(xpress.getLimit()) .withExclusiveStartKey(xpress.getExclusiveStartKey()) .withQueryFilter(xpress.getQueryFilter()) .withConditionalOperator(xpress.getConditionalOperator()) .withSelect(xpress.getSelect()) .withProjectionExpression(xpress.getProjectionExpression()) .withFilterExpression(xpress.getFilterExpression()) .withExpressionAttributeNames(xpress.getExpressionAttributeNames()) .withExpressionAttributeValues(xpress.getExpressionAttributeValues()) .withReturnConsumedCapacity(xpress.getReturnConsumedCapacity()) .withRequestMetricCollector(config.getRequestMetricCollector()) ; return applyUserAgent(req); }
/** * <p> * Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent * reads; otherwise, the operation uses eventually consistent reads. * </p> * <p> * Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index * with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>. * </p> * * @param consistentRead * Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly * consistent reads; otherwise, the operation uses eventually consistent reads.</p> * <p> * Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary * index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a * <code>ValidationException</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryRequest withConsistentRead(Boolean consistentRead) { setConsistentRead(consistentRead); return this; }
public QuerySpec withConsistentRead(boolean consistentRead) { getRequest().setConsistentRead(consistentRead); return this; }
private <T> QueryRequest createQueryRequestFromExpression(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config) { final QueryRequest queryRequest = new QueryRequest(); queryRequest.setConsistentRead(queryExpression.isConsistentRead()); queryRequest.setTableName(getTableName(clazz, queryExpression.getHashKeyValues(), config)); queryRequest.setIndexName(queryExpression.getIndexName()); final ItemConverter converter = getConverter(config); // Hash key (primary or index) conditions final Map<String, Condition> hashKeyConditions = getHashKeyEqualsConditions( converter, queryExpression.getHashKeyValues()); // Range key (primary or index) conditions final Map<String, Condition> rangeKeyConditions = queryExpression.getRangeKeyConditions(); processKeyConditions(clazz, queryRequest, hashKeyConditions, rangeKeyConditions); queryRequest.setScanIndexForward(queryExpression.isScanIndexForward()); queryRequest.setLimit(queryExpression.getLimit()); queryRequest.setExclusiveStartKey(queryExpression.getExclusiveStartKey()); queryRequest.setQueryFilter(queryExpression.getQueryFilter()); queryRequest.setConditionalOperator(queryExpression.getConditionalOperator()); queryRequest.setRequestMetricCollector(config.getRequestMetricCollector()); queryRequest.setFilterExpression(queryExpression.getFilterExpression()); queryRequest.setExpressionAttributeNames(queryExpression .getExpressionAttributeNames()); queryRequest.setExpressionAttributeValues(queryExpression .getExpressionAttributeValues()); return applyUserAgent(queryRequest); }
protected <T> QueryRequest createQueryRequestFromExpression(Class<T> clazz, DynamoDBQueryExpression<T> xpress, DynamoDBMapperConfig config) { final DynamoDBMapperTableModel<T> model = getTableModel(clazz, config); QueryRequest req = new QueryRequest(); req.setConsistentRead(xpress.isConsistentRead()); req.setTableName(getTableName(clazz, xpress.getHashKeyValues(), config)); req.setIndexName(xpress.getIndexName()); req.setKeyConditionExpression(xpress.getKeyConditionExpression()); processKeyConditions(req, xpress, model); req.withScanIndexForward(xpress.isScanIndexForward()) .withLimit(xpress.getLimit()) .withExclusiveStartKey(xpress.getExclusiveStartKey()) .withQueryFilter(xpress.getQueryFilter()) .withConditionalOperator(xpress.getConditionalOperator()) .withSelect(xpress.getSelect()) .withProjectionExpression(xpress.getProjectionExpression()) .withFilterExpression(xpress.getFilterExpression()) .withExpressionAttributeNames(xpress.getExpressionAttributeNames()) .withExpressionAttributeValues(xpress.getExpressionAttributeValues()) .withReturnConsumedCapacity(xpress.getReturnConsumedCapacity()) .withRequestMetricCollector(config.getRequestMetricCollector()) ; return applyUserAgent(req); }