break up archive task actions, which was missed in #566a3a6112

This commit is contained in:
Xavier Léauté 2015-03-04 13:19:52 -08:00
parent d8e199a3f5
commit 113d204b10
1 changed files with 2 additions and 10 deletions

View File

@ -89,20 +89,12 @@ public class ArchiveTask extends AbstractFixedIntervalTask
log.info("OK to archive segment: %s", unusedSegment.getIdentifier()); log.info("OK to archive segment: %s", unusedSegment.getIdentifier());
} }
List<DataSegment> archivedSegments = Lists.newLinkedList();
// Move segments // Move segments
for (DataSegment segment : unusedSegments) { 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()); return TaskStatus.success(getId());
} }
} }