Skip to content

Commit 609914d

Browse files
author
Tom May
committed
Refactor deleteBlobs loop into two more focused loops.
1 parent 22f3fc9 commit 609914d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugins/cassandra/src/main/java/org/elasticsearch/cassandra/blobstore/CassandraBlobStore.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,23 @@ private boolean deleteBlobs(String blobPath, String... blobNames)
197197
Map<String, Map<String, List<Mutation>>> mutationMap =
198198
Maps.newHashMap();
199199

200-
List<Mutation> blobNamesMutations = Lists.newArrayList();
200+
// Delete the blob data from Blobs.
201201

202202
for (String blobName : blobNames) {
203203
String blobKey = blobKey(blobPath, blobName);
204204

205-
// Delete the blob data from Blobs.
206-
207205
Map<String, List<Mutation>> blobsMutationMap = Maps.newHashMap();
208206
blobsMutationMap.put(
209207
"Blobs",
210208
ImmutableList.of(createDelete(null, timestamp)));
211209

212210
mutationMap.put(blobKey, blobsMutationMap);
211+
}
213212

214-
// Delete the blobName from BlobNames.
213+
// Delete the blobNames from BlobNames.
215214

215+
List<Mutation> blobNamesMutations = Lists.newArrayList();
216+
for (String blobName : blobNames) {
216217
blobNamesMutations.add(createDelete(blobName, timestamp));
217218
}
218219

0 commit comments

Comments
 (0)