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 ) ; }
Method to update redshift destination with updated copy options .