@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getCacheClusters() == null) ? 0 : getCacheClusters().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeCacheClustersResult == false) return false; DescribeCacheClustersResult other = (DescribeCacheClustersResult) obj; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; if (other.getCacheClusters() == null ^ this.getCacheClusters() == null) return false; if (other.getCacheClusters() != null && other.getCacheClusters().equals(this.getCacheClusters()) == 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 (getCacheClusters() != null) sb.append("CacheClusters: ").append(getCacheClusters()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getCacheClusters() == null) ? 0 : getCacheClusters().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeCacheClustersResult == false) return false; DescribeCacheClustersResult other = (DescribeCacheClustersResult) obj; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; if (other.getCacheClusters() == null ^ this.getCacheClusters() == null) return false; if (other.getCacheClusters() != null && other.getCacheClusters().equals(this.getCacheClusters()) == 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 (getCacheClusters() != null) sb.append("CacheClusters: ").append(getCacheClusters()); sb.append("}"); return sb.toString(); }
@Override protected Cache createInstance() throws Exception { DescribeCacheClustersRequest describeCacheClustersRequest = new DescribeCacheClustersRequest().withCacheClusterId(getCacheClusterName()); describeCacheClustersRequest.setShowCacheNodeInfo(true); DescribeCacheClustersResult describeCacheClustersResult = this.amazonElastiCache.describeCacheClusters(describeCacheClustersRequest); CacheCluster cacheCluster = describeCacheClustersResult.getCacheClusters().get(0); if (!"available".equals(cacheCluster.getCacheClusterStatus())) { LOGGER.warn("Cache cluster is not available now. Connection may fail during cache access. Current status is {}", cacheCluster.getCacheClusterStatus()); } Endpoint configurationEndpoint = getEndpointForCache(cacheCluster); for (CacheFactory cacheFactory : this.cacheFactories) { if (cacheFactory.isSupportingCacheArchitecture(cacheCluster.getEngine())) { return cacheFactory.createCache(this.cacheClusterId, configurationEndpoint.getAddress(), configurationEndpoint.getPort()); } } throw new IllegalArgumentException("No CacheFactory configured for engine: " + cacheCluster.getEngine()); }
@Override protected Cache createInstance() throws Exception { DescribeCacheClustersRequest describeCacheClustersRequest = new DescribeCacheClustersRequest().withCacheClusterId(getCacheClusterName()); describeCacheClustersRequest.setShowCacheNodeInfo(true); DescribeCacheClustersResult describeCacheClustersResult = this.amazonElastiCache.describeCacheClusters(describeCacheClustersRequest); CacheCluster cacheCluster = describeCacheClustersResult.getCacheClusters().get(0); if (!"available".equals(cacheCluster.getCacheClusterStatus())) { LOGGER.warn("Cache cluster is not available now. Connection may fail during cache access. Current status is {}", cacheCluster.getCacheClusterStatus()); } Endpoint configurationEndpoint = getEndpointForCache(cacheCluster); for (CacheFactory cacheFactory : this.cacheFactories) { if (cacheFactory.isSupportingCacheArchitecture(cacheCluster.getEngine())) { return cacheFactory.createCache(this.cacheClusterId, configurationEndpoint.getAddress(), configurationEndpoint.getPort()); } } throw new IllegalArgumentException("No CacheFactory configured for engine: " + cacheCluster.getEngine()); }
rqst.setShowCacheNodeInfo(true); describeResult = amazonElastiCache.describeCacheClusters(rqst); cacheClusterList.addAll(describeResult.getCacheClusters()); marker = describeResult.getMarker();
int cntClusters = 0; for (CacheCluster cluster : describeCacheClustersResult.getCacheClusters()) { elasticacheClusterBuilder.putAll(regionName, new ElasticacheCluster(cluster, clusterIdToNodeGroupMember.get(cluster.getCacheClusterId()))); cntClusters++;