Package com.amazonaws.services.redshift.model

Examples of com.amazonaws.services.redshift.model.DescribeClustersRequest


     * @param clusterIdentifier
     *        The unique Amazon Redshift cluster identifier
     * @return JDBC URL for the Amazon Redshift cluster
     */
    public static String getClusterURL(AmazonRedshiftClient client, String clusterIdentifier) {
        DescribeClustersRequest describeClustersRequest = new DescribeClustersRequest();
        describeClustersRequest.setClusterIdentifier(clusterIdentifier);
        DescribeClustersResult describeClustersResult = client.describeClusters(describeClustersRequest);
        List<Cluster> clusters = describeClustersResult.getClusters();
        if (!clusters.isEmpty()) {
            return toJDBC(clusters.get(0).getEndpoint(), clusters.get(0).getDBName());
        }
View Full Code Here


     * @param clusterIdentifier
     *        The Amazon Redshift cluster to check
     * @return true if the Amazon Redshift cluster exists, otherwise return false
     */
    private static boolean clusterExists(AmazonRedshiftClient client, String clusterIdentifier) {
        DescribeClustersRequest describeClustersRequest = new DescribeClustersRequest();
        describeClustersRequest.setClusterIdentifier(clusterIdentifier);
        try {
            client.describeClusters(describeClustersRequest);
            return true;
        } catch (ClusterNotFoundException e) {
            return false;
View Full Code Here

     * @param clusterIdentifier
     *        The Amazon Redshift cluster to get the state of
     * @return The String representation of the Amazon Redshift cluster state
     */
    public static String clusterState(AmazonRedshiftClient client, String clusterIdentifier) {
        DescribeClustersRequest describeClustersRequest = new DescribeClustersRequest();
        describeClustersRequest.setClusterIdentifier(clusterIdentifier);
        List<Cluster> clusters = client.describeClusters(describeClustersRequest).getClusters();
        if (clusters.size() == 1) {
            return clusters.get(0).getClusterStatus();
        }
        throw new ClusterNotFoundException(clusterIdentifier);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.redshift.model.DescribeClustersRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.