From 113d204b104a242cc9cd6ed6b6771875c0c18c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Wed, 4 Mar 2015 13:19:52 -0800 Subject: [PATCH] break up archive task actions, which was missed in #566a3a6112 --- .../io/druid/indexing/common/task/ArchiveTask.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/ArchiveTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/ArchiveTask.java index c2cbf9f4103..d7c1960e4a6 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/ArchiveTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/ArchiveTask.java @@ -89,20 +89,12 @@ public class ArchiveTask extends AbstractFixedIntervalTask log.info("OK to archive segment: %s", unusedSegment.getIdentifier()); } - List archivedSegments = Lists.newLinkedList(); - // Move segments for (DataSegment segment : unusedSegments) { - archivedSegments.add(toolbox.getDataSegmentArchiver().archive(segment)); + final DataSegment archivedSegment = toolbox.getDataSegmentArchiver().archive(segment); + toolbox.getTaskActionClient().submit(new SegmentMetadataUpdateAction(ImmutableSet.of(archivedSegment))); } - // Update metadata for moved segments - toolbox.getTaskActionClient().submit( - new SegmentMetadataUpdateAction( - ImmutableSet.copyOf(archivedSegments) - ) - ); - return TaskStatus.success(getId()); } }