List of usage examples for com.amazonaws.services.kinesisfirehose.model UpdateDestinationRequest setRedshiftDestinationUpdate
public void setRedshiftDestinationUpdate(RedshiftDestinationUpdate redshiftDestinationUpdate)
Describes an update for a destination in Amazon Redshift.
From source file:AmazonKinesisFirehoseToRedshiftSample.java
License:Open Source License
/** * Method to update redshift destination with updated copy options. *///from w w w .ja va 2 s. c om private static void updateDeliveryStream() { DeliveryStreamDescription deliveryStreamDescription = describeDeliveryStream(deliveryStreamName); LOG.info("Updating DeliveryStream Destination: " + deliveryStreamName + " with new configuration options"); // get(0) -> DeliveryStream currently supports only one destination per DeliveryStream UpdateDestinationRequest updateDestinationRequest = new UpdateDestinationRequest() .withDeliveryStreamName(deliveryStreamName) .withCurrentDeliveryStreamVersionId(deliveryStreamDescription.getVersionId()) .withDestinationId(deliveryStreamDescription.getDestinations().get(0).getDestinationId()); CopyCommand updatedCopyCommand = new CopyCommand().withDataTableName(dataTableName) .withCopyOptions(updatedCopyOptions); RedshiftDestinationUpdate redshiftDestinationUpdate = new RedshiftDestinationUpdate() .withCopyCommand(updatedCopyCommand); updateDestinationRequest.setRedshiftDestinationUpdate(redshiftDestinationUpdate); // Update DeliveryStream destination with new configuration options such as s3Prefix and Buffering Hints. // Can also update Compression format, KMS key values and IAM Role. firehoseClient.updateDestination(updateDestinationRequest); }