EasyManuals Logo

Amazon Redshift User Manual

Amazon Redshift
131 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #65 background imageLoading...
Page #65 background image
DescribeClusterSnapshotsRequest request = new DescribeClusterSnapshots
Request()
.withEndTime(creationDate)
.withClusterIdentifier(clusterIdentifier)
.withSnapshotType("manual");
DescribeClusterSnapshotsResult result = client.describeClusterSnap
shots(request);
for (Snapshot s : result.getSnapshots()) {
DeleteClusterSnapshotRequest deleteRequest = new DeleteClusterSnap
shotRequest()
.withSnapshotIdentifier(s.getSnapshotIdentifier());
Snapshot deleteResult = client.deleteClusterSnapshot(deleteRequest);
System.out.format("Deleted snapshot %s\n", deleteResult.getSnap
shotIdentifier());
}
}
private static void printResultSnapshots(DescribeClusterSnapshotsResult
result) {
System.out.println("\nSnapshot listing:");
for (Snapshot snapshot : result.getSnapshots()) {
System.out.format("Identifier: %s\n", snapshot.getSnapshotIdentifi
er());
System.out.format("Snapshot type: %s\n", snapshot.getSnapshotType());
System.out.format("Snapshot create time: %s\n", snapshot.getSnap
shotCreateTime());
System.out.format("Snapshot status: %s\n\n", snapshot.getStatus());
}
}
private static Boolean waitForSnapshotAvailable(String snapshotId) throws
InterruptedException {
Boolean snapshotAvailable = false;
System.out.println("Wating for snapshot to become available.");
while (!snapshotAvailable) {
DescribeClusterSnapshotsResult result = client.describeClusterSnap
shots(new DescribeClusterSnapshotsRequest()
.withSnapshotIdentifier(snapshotId));
String status = (result.getSnapshots()).get(0).getStatus();
if (status.equalsIgnoreCase("available")) {
snapshotAvailable = true;
}
else {
System.out.print(".");
Thread.sleep(sleepTime*1000);
}
}
return snapshotAvailable;
}
}
API Version 2012-12-01
61
Amazon Redshift Management Guide
Managing Snapshots Using AWS SDK for Java

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Amazon Redshift and is the answer not in the manual?

Amazon Redshift Specifications

General IconGeneral
ProviderAmazon Web Services (AWS)
Query LanguageSQL
Data StorageColumnar storage
SecurityEncryption at rest and in transit, VPC, IAM
BackupAutomated and manual snapshots
DeploymentCloud-based
TypeCloud-based data warehouse service
Primary UseData warehousing, analytics
IntegrationIntegrates with AWS services, BI tools, and ETL tools
Pricing ModelOn-demand and reserved instance pricing
Data CompressionColumnar storage with data compression
Performance OptimizationQuery optimization

Related product manuals