@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getClusters() == null) ? 0 : getClusters().hashCode()); return hashCode; }
/** * 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 (getMarker() != null) sb.append("Marker: ").append(getMarker()).append(","); if (getClusters() != null) sb.append("Clusters: ").append(getClusters()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeClustersResult == false) return false; DescribeClustersResult other = (DescribeClustersResult) obj; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; if (other.getClusters() == null ^ this.getClusters() == null) return false; if (other.getClusters() != null && other.getClusters().equals(this.getClusters()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getClusters() == null) ? 0 : getClusters().hashCode()); return hashCode; }
final AmazonRedshiftClient client = new AmazonRedshiftClient(credentials).withRegion(com.amazonaws.regions.Regions.US_WEST_2); final DescribeClustersResult describeResult = client.describeClusters(); describeResult.getClusters() .stream() .forEach(cluster -> System.out.println(String.format("Cluster: %s \nNumber of nodes: %d", cluster.getClusterIdentifier(), cluster.getNumberOfNodes())));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeClustersResult == false) return false; DescribeClustersResult other = (DescribeClustersResult) obj; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; if (other.getClusters() == null ^ this.getClusters() == null) return false; if (other.getClusters() != null && other.getClusters().equals(this.getClusters()) == false) return false; return true; }
/** * 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 (getMarker() != null) sb.append("Marker: ").append(getMarker()).append(","); if (getClusters() != null) sb.append("Clusters: ").append(getClusters()); sb.append("}"); return sb.toString(); }
do{ result= redshiftClient.describeClusters(new DescribeClustersRequest().withMarker(nextMarker)); redshiftList.addAll(result.getClusters()); nextMarker = result.getMarker(); }while(nextMarker!=null);
private void describe(String dbInstanceIdentifier) throws Exception { while (true) { DescribeDBInstancesRequest request = new DescribeDBInstancesRequest() .withDBInstanceIdentifier(dbInstanceIdentifier); DescribeClustersResult response = client.describeClusters(new DescribeClustersRequest() .withClusterIdentifier(INSTANCE_ID) ); Cluster dbInstance = response.getClusters().get(0); if (!dbInstance.getClusterStatus().equalsIgnoreCase("creating")) { System.out.println("Done! " + response); System.out.println(dbInstance.getEndpoint().getAddress()); System.out.println(dbInstance.getEndpoint().getPort()); break; } System.out.println("Not done - will wait 10s: " + response); Thread.sleep(10000L); } }