Example usage for com.amazonaws.services.redshift.model DeleteClusterRequest setSkipFinalClusterSnapshot

List of usage examples for com.amazonaws.services.redshift.model DeleteClusterRequest setSkipFinalClusterSnapshot

Introduction

In this page you can find the example usage for com.amazonaws.services.redshift.model DeleteClusterRequest setSkipFinalClusterSnapshot.

Prototype


public void setSkipFinalClusterSnapshot(Boolean skipFinalClusterSnapshot) 

Source Link

Document

Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster.

Usage

From source file:com.amazon.services.awsrum.utils.RedshiftUtils.java

License:Open Source License

/**
 * Delete the Redshift cluster if it exists
 * //  w  ww . j  av  a 2 s  .c  o  m
 * @param client
 *            The {@link AmazonRedshiftClient} with read and write permissions
 * @param clusterIdentifier
 *            The Redshift cluster delete
 * @param skipFinalClusterSnapshot
 *            Should Redshift skip the final cluster snapshot?
 */
public static void deleteCluster(AmazonRedshiftClient client, String clusterIdentifier,
        boolean skipFinalClusterSnapshot) {
    if (clusterExists(client, clusterIdentifier)) {
        DeleteClusterRequest deleteClusterRequest = new DeleteClusterRequest();
        deleteClusterRequest.setClusterIdentifier(clusterIdentifier);
        deleteClusterRequest.setSkipFinalClusterSnapshot(skipFinalClusterSnapshot);
        client.deleteCluster(deleteClusterRequest);
    } else {
        LOG.warn("Redshift cluster " + clusterIdentifier + " does not exist");
    }
}

From source file:com.kinesisboard.amazonaws.utils.RedshiftUtils.java

License:Open Source License

/**
 * Delete the Amazon Redshift cluster if it exists
 * // w w  w  .j a v a2 s  .  c om
 * @param client
 *        The {@link AmazonRedshiftClient} with read and write permissions
 * @param clusterIdentifier
 *        The Amazon Redshift cluster delete
 * @param skipFinalClusterSnapshot
 *        Should Amazon Redshift skip the final cluster snapshot?
 */
public static void deleteCluster(AmazonRedshiftClient client, String clusterIdentifier,
        boolean skipFinalClusterSnapshot) {
    if (clusterExists(client, clusterIdentifier)) {
        DeleteClusterRequest deleteClusterRequest = new DeleteClusterRequest();
        deleteClusterRequest.setClusterIdentifier(clusterIdentifier);
        deleteClusterRequest.setSkipFinalClusterSnapshot(skipFinalClusterSnapshot);
        client.deleteCluster(deleteClusterRequest);
    } else {
        LOG.warn("Amazon Redshift cluster " + clusterIdentifier + " does not exist");
    }
}