// Query calls work against upgraded MemTaskStore, which does not support deprecated fields.
LOG.info("Backfilling task config job keys.");
storeProvider.getUnsafeTaskStore().mutateTasks(Query.unscoped(), new TaskMutation() {
@Override
public IScheduledTask apply(final IScheduledTask task) {
ScheduledTask builder = task.newBuilder();
populateJobKey(builder.getAssignedTask().getTask(), BACKFILLED_TASK_CONFIG_KEYS);
return IScheduledTask.build(builder);
}
});
LOG.info("Performing shard uniqueness sanity check.");
storeProvider.getUnsafeTaskStore().mutateTasks(Query.unscoped(), new TaskMutation() {
@Override
public IScheduledTask apply(final IScheduledTask task) {
ScheduledTask builder = task.newBuilder();
ConfigurationManager.applyDefaultsIfUnset(builder.getAssignedTask().getTask());
// TODO(ksweeney): Guarantee tasks pass current validation code here and quarantine if they
// don't.
guaranteeShardUniqueness(builder, storeProvider.getUnsafeTaskStore(), clock);
rewriteSandboxDeletedState(builder);
return IScheduledTask.build(builder);