if (getStreamLabel() != null) sb.append("StreamLabel: ").append(getStreamLabel()).append(","); if (getStreamStatus() != null) sb.append("StreamStatus: ").append(getStreamStatus()).append(","); if (getStreamViewType() != null) sb.append("StreamViewType: ").append(getStreamViewType()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamArn() == null) ? 0 : getStreamArn().hashCode()); hashCode = prime * hashCode + ((getStreamLabel() == null) ? 0 : getStreamLabel().hashCode()); hashCode = prime * hashCode + ((getStreamStatus() == null) ? 0 : getStreamStatus().hashCode()); hashCode = prime * hashCode + ((getStreamViewType() == null) ? 0 : getStreamViewType().hashCode()); hashCode = prime * hashCode + ((getCreationRequestDateTime() == null) ? 0 : getCreationRequestDateTime().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKeySchema() == null) ? 0 : getKeySchema().hashCode()); hashCode = prime * hashCode + ((getShards() == null) ? 0 : getShards().hashCode()); hashCode = prime * hashCode + ((getLastEvaluatedShardId() == null) ? 0 : getLastEvaluatedShardId().hashCode()); return hashCode; }
if (other.getStreamLabel() != null && other.getStreamLabel().equals(this.getStreamLabel()) == false) return false; if (other.getStreamStatus() == null ^ this.getStreamStatus() == null) return false; if (other.getStreamStatus() != null && other.getStreamStatus().equals(this.getStreamStatus()) == false) return false; if (other.getStreamViewType() == null ^ this.getStreamViewType() == null)
/** * Marshall the given parameter object. */ public void marshall(StreamDescription streamDescription, ProtocolMarshaller protocolMarshaller) { if (streamDescription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(streamDescription.getStreamArn(), STREAMARN_BINDING); protocolMarshaller.marshall(streamDescription.getStreamLabel(), STREAMLABEL_BINDING); protocolMarshaller.marshall(streamDescription.getStreamStatus(), STREAMSTATUS_BINDING); protocolMarshaller.marshall(streamDescription.getStreamViewType(), STREAMVIEWTYPE_BINDING); protocolMarshaller.marshall(streamDescription.getCreationRequestDateTime(), CREATIONREQUESTDATETIME_BINDING); protocolMarshaller.marshall(streamDescription.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(streamDescription.getKeySchema(), KEYSCHEMA_BINDING); protocolMarshaller.marshall(streamDescription.getShards(), SHARDS_BINDING); protocolMarshaller.marshall(streamDescription.getLastEvaluatedShardId(), LASTEVALUATEDSHARDID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * @return The current status of the stream being described. */ @Override public String getStreamStatus() { String status = internalDescription.getStreamStatus(); if (STREAM_STATUS_DYNAMODB_ENABLED.equals(status)) { status = STREAM_STATUS_KINESIS_ACTIVE; } else if (STREAM_STATUS_DYNAMODB_ENABLING.equals(status)) { status = STREAM_STATUS_KINESIS_CREATING; } else if (STREAM_STATUS_DYNAMODB_DISABLED.equals(status)) { // streams are valid for 24hrs after disabling and // will continue to support read operations status = STREAM_STATUS_KINESIS_ACTIVE; } else if (STREAM_STATUS_DYNAMODB_DISABLING.equals(status)) { status = STREAM_STATUS_KINESIS_ACTIVE; } else { throw new UnsupportedOperationException("Unsupported StreamStatus: " + status); } return status; }
/** * @return The current status of the stream being described. */ @Override public String getStreamStatus() { String status = internalDescription.getStreamStatus(); if (STREAM_STATUS_DYNAMODB_ENABLED.equals(status)) { status = STREAM_STATUS_KINESIS_ACTIVE; } else if (STREAM_STATUS_DYNAMODB_ENABLING.equals(status)) { status = STREAM_STATUS_KINESIS_CREATING; } else if (STREAM_STATUS_DYNAMODB_DISABLED.equals(status)) { // streams are valid for 24hrs after disabling and // will continue to support read operations status = STREAM_STATUS_KINESIS_ACTIVE; } else if (STREAM_STATUS_DYNAMODB_DISABLING.equals(status)) { status = STREAM_STATUS_KINESIS_ACTIVE; } else { throw new UnsupportedOperationException("Unsupported StreamStatus: " + status); } return status; }
if (getStreamLabel() != null) sb.append("StreamLabel: ").append(getStreamLabel()).append(","); if (getStreamStatus() != null) sb.append("StreamStatus: ").append(getStreamStatus()).append(","); if (getStreamViewType() != null) sb.append("StreamViewType: ").append(getStreamViewType()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamArn() == null) ? 0 : getStreamArn().hashCode()); hashCode = prime * hashCode + ((getStreamLabel() == null) ? 0 : getStreamLabel().hashCode()); hashCode = prime * hashCode + ((getStreamStatus() == null) ? 0 : getStreamStatus().hashCode()); hashCode = prime * hashCode + ((getStreamViewType() == null) ? 0 : getStreamViewType().hashCode()); hashCode = prime * hashCode + ((getCreationRequestDateTime() == null) ? 0 : getCreationRequestDateTime().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKeySchema() == null) ? 0 : getKeySchema().hashCode()); hashCode = prime * hashCode + ((getShards() == null) ? 0 : getShards().hashCode()); hashCode = prime * hashCode + ((getLastEvaluatedShardId() == null) ? 0 : getLastEvaluatedShardId().hashCode()); return hashCode; }
/** * Check whether Streams is enabled on the given argument with the given stream view type * * @param streamsClient * streams client used to access the given stream * @param streamArn * the stream ARN to check against * @param viewType * the stream view type to check against * @return a boolean indicating whether the given stream is enabled and matches the given stream view type */ public static boolean isStreamsEnabled(AmazonDynamoDBStreams streamsClient, String streamArn, StreamViewType viewType) { // Get and check stream description StreamDescription result = streamsClient.describeStream(new DescribeStreamRequest().withStreamArn(streamArn)) .getStreamDescription(); if (result.getStreamStatus().equalsIgnoreCase(DynamoDBConnectorConstants.ENABLED_STRING) && result.getStreamViewType().equalsIgnoreCase(viewType.toString())) { return true; } log.error(DynamoDBConnectorConstants.STREAM_NOT_READY + " StreamARN: " + streamArn); return false; } }
if (other.getStreamLabel() != null && other.getStreamLabel().equals(this.getStreamLabel()) == false) return false; if (other.getStreamStatus() == null ^ this.getStreamStatus() == null) return false; if (other.getStreamStatus() != null && other.getStreamStatus().equals(this.getStreamStatus()) == false) return false; if (other.getStreamViewType() == null ^ this.getStreamViewType() == null)
/** * Marshall the given parameter object. */ public void marshall(StreamDescription streamDescription, ProtocolMarshaller protocolMarshaller) { if (streamDescription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(streamDescription.getStreamArn(), STREAMARN_BINDING); protocolMarshaller.marshall(streamDescription.getStreamLabel(), STREAMLABEL_BINDING); protocolMarshaller.marshall(streamDescription.getStreamStatus(), STREAMSTATUS_BINDING); protocolMarshaller.marshall(streamDescription.getStreamViewType(), STREAMVIEWTYPE_BINDING); protocolMarshaller.marshall(streamDescription.getCreationRequestDateTime(), CREATIONREQUESTDATETIME_BINDING); protocolMarshaller.marshall(streamDescription.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(streamDescription.getKeySchema(), KEYSCHEMA_BINDING); protocolMarshaller.marshall(streamDescription.getShards(), SHARDS_BINDING); protocolMarshaller.marshall(streamDescription.getLastEvaluatedShardId(), LASTEVALUATEDSHARDID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
throw AmazonServiceExceptionTransformer.transformDynamoDBStreamsToKinesisDescribeStream(e); if (result.getStreamDescription().getStreamStatus().equals("DISABLED")) { new StreamDescription().withShards(allShards).withLastEvaluatedShardId(null).withCreationRequestDateTime(result.getStreamDescription().getCreationRequestDateTime()) .withKeySchema(result.getStreamDescription().getKeySchema()).withStreamArn(result.getStreamDescription().getStreamArn()) .withStreamLabel(result.getStreamDescription().getStreamLabel()).withStreamStatus(result.getStreamDescription().getStreamStatus()) .withTableName(result.getStreamDescription().getTableName()).withStreamViewType(result.getStreamDescription().getStreamViewType()); result = new com.amazonaws.services.dynamodbv2.model.DescribeStreamResult().withStreamDescription(newStreamDescription);
throw AmazonServiceExceptionTransformer.transformDynamoDBStreamsToKinesisDescribeStream(e); if (result.getStreamDescription().getStreamStatus().equals("DISABLED")) { new StreamDescription().withShards(allShards).withLastEvaluatedShardId(null).withCreationRequestDateTime(result.getStreamDescription().getCreationRequestDateTime()) .withKeySchema(result.getStreamDescription().getKeySchema()).withStreamArn(result.getStreamDescription().getStreamArn()) .withStreamLabel(result.getStreamDescription().getStreamLabel()).withStreamStatus(result.getStreamDescription().getStreamStatus()) .withTableName(result.getStreamDescription().getTableName()).withStreamViewType(result.getStreamDescription().getStreamViewType()); result = new com.amazonaws.services.dynamodbv2.model.DescribeStreamResult().withStreamDescription(newStreamDescription);