/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTableName() != null) sb.append("TableName: ").append(getTableName()).append(","); if (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getAttributesToGet() != null) sb.append("AttributesToGet: ").append(getAttributesToGet()).append(","); if (getConsistentRead() != null) sb.append("ConsistentRead: ").append(getConsistentRead()).append(","); if (getReturnConsumedCapacity() != null) sb.append("ReturnConsumedCapacity: ").append(getReturnConsumedCapacity()).append(","); if (getProjectionExpression() != null) sb.append("ProjectionExpression: ").append(getProjectionExpression()).append(","); if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); hashCode = prime * hashCode + ((getAttributesToGet() == null) ? 0 : getAttributesToGet().hashCode()); hashCode = prime * hashCode + ((getConsistentRead() == null) ? 0 : getConsistentRead().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity().hashCode()); hashCode = prime * hashCode + ((getProjectionExpression() == null) ? 0 : getProjectionExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames().hashCode()); return hashCode; }
if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getKey() == null ^ this.getKey() == null) return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getAttributesToGet() == null ^ this.getAttributesToGet() == null)
/** * Marshall the given parameter object. */ public void marshall(GetItemRequest getItemRequest, ProtocolMarshaller protocolMarshaller) { if (getItemRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getItemRequest.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(getItemRequest.getKey(), KEY_BINDING); protocolMarshaller.marshall(getItemRequest.getAttributesToGet(), ATTRIBUTESTOGET_BINDING); protocolMarshaller.marshall(getItemRequest.getConsistentRead(), CONSISTENTREAD_BINDING); protocolMarshaller.marshall(getItemRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING); protocolMarshaller.marshall(getItemRequest.getProjectionExpression(), PROJECTIONEXPRESSION_BINDING); protocolMarshaller.marshall(getItemRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); hashCode = prime * hashCode + ((getAttributesToGet() == null) ? 0 : getAttributesToGet().hashCode()); hashCode = prime * hashCode + ((getConsistentRead() == null) ? 0 : getConsistentRead().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity() .hashCode()); hashCode = prime * hashCode + ((getProjectionExpression() == null) ? 0 : getProjectionExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames() .hashCode()); return hashCode; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTableName() != null) sb.append("TableName: " + getTableName() + ","); if (getKey() != null) sb.append("Key: " + getKey() + ","); if (getAttributesToGet() != null) sb.append("AttributesToGet: " + getAttributesToGet() + ","); if (getConsistentRead() != null) sb.append("ConsistentRead: " + getConsistentRead() + ","); if (getReturnConsumedCapacity() != null) sb.append("ReturnConsumedCapacity: " + getReturnConsumedCapacity() + ","); if (getProjectionExpression() != null) sb.append("ProjectionExpression: " + getProjectionExpression() + ","); if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: " + getExpressionAttributeNames()); sb.append("}"); return sb.toString(); }
&& other.getTableName().equals(this.getTableName()) == false) return false; if (other.getKey() == null ^ this.getKey() == null) return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getAttributesToGet() == null ^ this.getAttributesToGet() == null)
@Override protected Map<String, AttributeValue> getKey(TransactionManager txManager) { return request.getKey(); }
@Override protected void doValidate(String txId, TransactionManager txManager) { validateAttributes(this, request.getKey(), txId, txManager); validateAttributes(this, request.getAttributesToGet(), txId, txManager); } }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTableName() != null) sb.append("TableName: ").append(getTableName()).append(","); if (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getAttributesToGet() != null) sb.append("AttributesToGet: ").append(getAttributesToGet()).append(","); if (getConsistentRead() != null) sb.append("ConsistentRead: ").append(getConsistentRead()).append(","); if (getReturnConsumedCapacity() != null) sb.append("ReturnConsumedCapacity: ").append(getReturnConsumedCapacity()).append(","); if (getProjectionExpression() != null) sb.append("ProjectionExpression: ").append(getProjectionExpression()).append(","); if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); hashCode = prime * hashCode + ((getAttributesToGet() == null) ? 0 : getAttributesToGet().hashCode()); hashCode = prime * hashCode + ((getConsistentRead() == null) ? 0 : getConsistentRead().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity().hashCode()); hashCode = prime * hashCode + ((getProjectionExpression() == null) ? 0 : getProjectionExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames().hashCode()); return hashCode; }
public GetPointResult getPoint(GetPointRequest getPointRequest) { long geohash = S2Manager.generateGeohash(getPointRequest.getGeoPoint()); long hashKey = S2Manager.generateHashKey(geohash, config.getHashKeyLength()); GetItemRequest getItemRequest = getPointRequest.getGetItemRequest(); getItemRequest.setTableName(config.getTableName()); AttributeValue hashKeyValue = new AttributeValue().withN(String.valueOf(hashKey)); getItemRequest.getKey().put(config.getHashKeyAttributeName(), hashKeyValue); getItemRequest.getKey().put(config.getRangeKeyAttributeName(), getPointRequest.getRangeKeyValue()); GetItemResult getItemResult = config.getDynamoDBClient().getItem(getItemRequest); GetPointResult getPointResult = new GetPointResult(getItemResult); return getPointResult; }
if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getKey() == null ^ this.getKey() == null) return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getAttributesToGet() == null ^ this.getAttributesToGet() == null)
/** * Marshall the given parameter object. */ public void marshall(GetItemRequest getItemRequest, ProtocolMarshaller protocolMarshaller) { if (getItemRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getItemRequest.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(getItemRequest.getKey(), KEY_BINDING); protocolMarshaller.marshall(getItemRequest.getAttributesToGet(), ATTRIBUTESTOGET_BINDING); protocolMarshaller.marshall(getItemRequest.getConsistentRead(), CONSISTENTREAD_BINDING); protocolMarshaller.marshall(getItemRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING); protocolMarshaller.marshall(getItemRequest.getProjectionExpression(), PROJECTIONEXPRESSION_BINDING); protocolMarshaller.marshall(getItemRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
request = createGetItemRequest(tableName, item); return getOldCommittedItem(lockingTx, tableName, request.getKey()); } catch (UnknownCompletedTransactionException e2) { LOG.debug("Could not find item image. Transaction must have already completed.", e2);