mirror of https://github.com/apache/druid.git
break up archive task actions, which was missed in #566a3a6112
This commit is contained in:
parent
d8e199a3f5
commit
113d204b10
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue