if (getShards() != null) sb.append("Shards: ").append(getShards()).append(","); if (getLastEvaluatedShardId() != null) sb.append("LastEvaluatedShardId: ").append(getLastEvaluatedShardId()); sb.append("}"); return sb.toString();
@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.getShards() != null && other.getShards().equals(this.getShards()) == false) return false; if (other.getLastEvaluatedShardId() == null ^ this.getLastEvaluatedShardId() == null) return false; if (other.getLastEvaluatedShardId() != null && other.getLastEvaluatedShardId().equals(this.getLastEvaluatedShardId()) == false) return false; return true;
/** * 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 If true there are more shards in the stream * available to describe. */ @Override public Boolean getHasMoreShards() { return internalDescription.getLastEvaluatedShardId() != null; }
/** * @return If true there are more shards in the stream * available to describe. */ @Override public Boolean isHasMoreShards() { return internalDescription.getLastEvaluatedShardId() != null; }
/** * @return If true there are more shards in the stream * available to describe. */ @Override public Boolean getHasMoreShards() { return internalDescription.getLastEvaluatedShardId() != null; }
/** * @return If true there are more shards in the stream * available to describe. */ @Override public Boolean isHasMoreShards() { return internalDescription.getLastEvaluatedShardId() != null; }
if (getShards() != null) sb.append("Shards: ").append(getShards()).append(","); if (getLastEvaluatedShardId() != null) sb.append("LastEvaluatedShardId: ").append(getLastEvaluatedShardId()); sb.append("}"); return sb.toString();
@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; }
private List<Shard> getAllShardsForDisabledStream(com.amazonaws.services.dynamodbv2.model.DescribeStreamResult initialResult) { List<Shard> shards = new ArrayList<Shard>(); shards.addAll(initialResult.getStreamDescription().getShards()); com.amazonaws.services.dynamodbv2.model.DescribeStreamRequest request; com.amazonaws.services.dynamodbv2.model.DescribeStreamResult result = initialResult; // Allowing KCL to paginate calls will not allow us to correctly determine the // leaf nodes. In order to avoid pagination issues when feigning shard activity, we collect all // shards in the adapter and return them at once. while (result.getStreamDescription().getLastEvaluatedShardId() != null) { request = new com.amazonaws.services.dynamodbv2.model.DescribeStreamRequest().withStreamArn(result.getStreamDescription().getStreamArn()) .withExclusiveStartShardId(result.getStreamDescription().getLastEvaluatedShardId()); try { result = internalClient.describeStream(request); } catch (AmazonServiceException e) { throw AmazonServiceExceptionTransformer.transformDynamoDBStreamsToKinesisDescribeStream(e); } shards.addAll(result.getStreamDescription().getShards()); } return shards; }
private List<Shard> getAllShardsForDisabledStream(com.amazonaws.services.dynamodbv2.model.DescribeStreamResult initialResult) { List<Shard> shards = new ArrayList<Shard>(); shards.addAll(initialResult.getStreamDescription().getShards()); com.amazonaws.services.dynamodbv2.model.DescribeStreamRequest request; com.amazonaws.services.dynamodbv2.model.DescribeStreamResult result = initialResult; // Allowing KCL to paginate calls will not allow us to correctly determine the // leaf nodes. In order to avoid pagination issues when feigning shard activity, we collect all // shards in the adapter and return them at once. while (result.getStreamDescription().getLastEvaluatedShardId() != null) { request = new com.amazonaws.services.dynamodbv2.model.DescribeStreamRequest().withStreamArn(result.getStreamDescription().getStreamArn()) .withExclusiveStartShardId(result.getStreamDescription().getLastEvaluatedShardId()); try { result = internalClient.describeStream(request); } catch (AmazonServiceException e) { throw AmazonServiceExceptionTransformer.transformDynamoDBStreamsToKinesisDescribeStream(e); } shards.addAll(result.getStreamDescription().getShards()); } return shards; }
if (other.getShards() != null && other.getShards().equals(this.getShards()) == false) return false; if (other.getLastEvaluatedShardId() == null ^ this.getLastEvaluatedShardId() == null) return false; if (other.getLastEvaluatedShardId() != null && other.getLastEvaluatedShardId().equals(this.getLastEvaluatedShardId()) == false) return false; return true;
/** * 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); } }