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 #91 background imageLoading...
Page #91 background image
public static String nodeTypeToPurchase = "dw.hs1.xlarge";
public static Double fixedPriceLimit = 10000.00;
public static ArrayList<ReservedNodeOffering> matchingNodes = new ArrayL
ist<ReservedNodeOffering>();
public static void main(String[] args) throws IOException {
AWSCredentials credentials = new PropertiesCredentials(
ListAndPurchaseReservedNodeOffering.class
.getResourceAsStream("AwsCredentials.properties"));
client = new AmazonRedshiftClient(credentials);
try {
listReservedNodes();
findReservedNodeOffer();
purchaseReservedNodeOffer();
} catch (Exception e) {
System.err.println("Operation failed: " + e.getMessage());
}
}
private static void listReservedNodes() {
DescribeReservedNodesResult result = client.describeReservedNodes();
System.out.println("Listing nodes already purchased.");
for (ReservedNode node : result.getReservedNodes()) {
printReservedNodeDetails(node);
}
}
private static void findReservedNodeOffer()
{
DescribeReservedNodeOfferingsRequest request = new DescribeReserved
NodeOfferingsRequest();
DescribeReservedNodeOfferingsResult result = client.describeReserved
NodeOfferings(request);
Integer count = 0;
System.out.println("\nFinding nodes to purchase.");
for (ReservedNodeOffering offering : result.getReservedNodeOfferings())
{
if (offering.getNodeType().equals(nodeTypeToPurchase)){
if (offering.getFixedPrice() < fixedPriceLimit) {
matchingNodes.add(offering);
printOfferingDetails(offering);
count +=1;
}
}
}
if (count == 0) {
System.out.println("\nNo reserved node offering matches found.");
} else {
System.out.println("\nFound " + count + " matches.");
}
API Version 2012-12-01
87
Amazon Redshift Management Guide
Purchasing a Reserved Node Offering Using 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