Cluster result = client.modifyCluster(request);
System.out.format("Parameter Group %s is used for Cluster %s\n",
clusterParameterGroupName, result.getClusterParamet
erGroups().get(0).getParameterGroupName());
}
private static void printResultClusterParameterGroups(DescribeClusterPara
meterGroupsResult result)
{
if (result == null)
{
System.out.println("\nDescribe cluster parameter groups result is
null.");
return;
}
System.out.println("\nPrinting parameter group results:\n");
for (ClusterParameterGroup group : result.getParameterGroups()) {
System.out.format("\nDescription: %s\n", group.getDescription());
System.out.format("Group Family Name: %s\n", group.getParameterGroup
Family());
System.out.format("Group Name: %s\n", group.getParameterGroupName());
describeClusterParameters(group.getParameterGroupName());
}
}
private static void describeClusterParameters(String parameterGroupName) {
DescribeClusterParametersRequest request = new DescribeClusterParamet
ersRequest()
.withParameterGroupName(parameterGroupName);
DescribeClusterParametersResult result = client.describeClusterParamet
ers(request);
printResultClusterParameters(result, parameterGroupName);
}
private static void printResultClusterParameters(DescribeClusterParamet
ersResult result, String parameterGroupName)
{
if (result == null)
{
System.out.println("\nCluster parameters is null.");
return;
}
System.out.format("\nPrinting cluster parameters for \"%s\"\n", paramet
erGroupName);
for (Parameter parameter : result.getParameters()) {
System.out.println(" Name: " + parameter.getParameterName() + ",
Value: " + parameter.getParameterValue());
System.out.println(" DataType: " + parameter.getDataType() + ",
MinEngineVersion: " + parameter.getMinimumEngineVersion());
System.out.println(" AllowedValues: " + parameter.getAllowedValues()
+ ", Source: " + parameter.getSource());
System.out.println(" IsModifiable: " + parameter.getIsModifiable()
API Version 2012-12-01
50
Amazon Redshift Management Guide
Managing Parameter Groups Using AWS SDK for Java