Created
September 19, 2013 19:01
-
-
Save lmeadors/6628268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void deleteTitlesFromCloudSearch(List<AmazonSearchDataFormat> amazonSearchRecords) { | |
logger.debug("Deleting {} titles from CloudSearch", amazonSearchRecords.size()); | |
if (amazonSearchRecords.isEmpty()) return; | |
try { | |
postBatchToCloudSearch(cloudSearchTitlesEndpoint, amazonSearchRecords); | |
for (AmazonSearchDataFormat amazonSearchDataFormat : amazonSearchRecords) { | |
searchableContentMapper.removeDeleted(Integer.valueOf(amazonSearchDataFormat.getId())); | |
} | |
amazonCloudWatchAsyncClient.putMetricDataAsync( | |
new PutMetricDataRequest() | |
.withNamespace("Hoopla/Integration") | |
.withMetricData(new MetricDatum() | |
.withMetricName("CloudSearchTitles-DELETE-" + environment) | |
.withValue((double) amazonSearchRecords.size()) | |
) | |
); | |
} catch (IOException e) { | |
logger.error("Exception while trying to post a DELETE batch to CloudSearch", e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment