Delete the useless MapreduceAction interface

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122630519
This commit is contained in:
Corey Goldfeder 2016-05-18 07:51:21 -07:00 committed by Justine Tunney
parent 6f4b059cc9
commit 68b75461db
10 changed files with 9 additions and 42 deletions

View file

@ -32,7 +32,6 @@ import com.google.common.collect.ImmutableSet;
import google.registry.config.ConfigModule.Config;
import google.registry.gcs.GcsUtils;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.model.domain.DomainResource;
import google.registry.model.registry.Registry.TldType;
@ -57,7 +56,7 @@ import javax.inject.Inject;
* TLD.txt into the domain-lists bucket. Note that this overwrites the files in place.
*/
@Action(path = "/_dr/task/exportDomainLists")
public class ExportDomainListsAction implements MapreduceAction {
public class ExportDomainListsAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final int MAX_NUM_REDUCE_SHARDS = 100;

View file

@ -26,7 +26,6 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
import google.registry.config.RegistryEnvironment;
import google.registry.mapreduce.MapreduceAction;
import google.registry.util.FormattingLogger;
import org.joda.time.Duration;
@ -45,7 +44,7 @@ public final class AsyncFlowUtils {
/** Enqueues a mapreduce action to perform an async flow operation. */
public static TaskHandle enqueueMapreduceAction(
Class<? extends MapreduceAction> action,
Class<? extends Runnable> action,
ImmutableMap<String, String> params,
Duration executionDelay) {
Queue queue = QueueFactory.getQueue(ASYNC_FLOW_QUEUE_NAME);

View file

@ -34,7 +34,6 @@ import com.googlecode.objectify.Key;
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.Work;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.mapreduce.inputs.EppResourceInputs;
import google.registry.mapreduce.inputs.NullInput;
@ -59,7 +58,7 @@ import javax.inject.Inject;
* A mapreduce to delete the specified EPP resource, but ONLY if it is not referred to by any
* existing DomainBase entity.
*/
public abstract class DeleteEppResourceAction<T extends EppResource> implements MapreduceAction {
public abstract class DeleteEppResourceAction<T extends EppResource> implements Runnable {
/** The HTTP parameter name used to specify the websafe key of the resource to delete. */
public static final String PARAM_RESOURCE_KEY = "resourceKey";

View file

@ -26,7 +26,6 @@ import com.googlecode.objectify.Key;
import com.googlecode.objectify.Ref;
import google.registry.dns.DnsQueue;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.mapreduce.inputs.EppResourceInputs;
import google.registry.model.domain.DomainResource;
@ -46,7 +45,7 @@ import javax.inject.Inject;
* Enqueues DNS refreshes for applicable domains following a host rename.
*/
@Action(path = "/_dr/task/dnsRefreshForHostRename")
public class DnsRefreshForHostRenameAction implements MapreduceAction {
public class DnsRefreshForHostRenameAction implements Runnable {
/** The HTTP parameter name used to specify the websafe key of the host to rename. */
public static final String PARAM_HOST_KEY = "hostKey";

View file

@ -1,24 +0,0 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.mapreduce;
import google.registry.request.Action;
/**
* Marker interface to denote an action intended for the Mapreduce queue.
*
* <p>Classes that implement this interface are expected to have {@link Action} set.
*/
public interface MapreduceAction extends Runnable {}

View file

@ -29,7 +29,6 @@ import com.google.common.collect.Lists;
import com.googlecode.objectify.Key;
import google.registry.config.RegistryEnvironment;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.model.ofy.CommitLogBucket;
import google.registry.model.ofy.CommitLogCheckpointRoot;
@ -42,7 +41,7 @@ import javax.inject.Inject;
/** Deletes all commit logs in datastore. */
@Action(path = "/_dr/task/killAllCommitLogs", method = POST)
public class KillAllCommitLogsAction implements MapreduceAction {
public class KillAllCommitLogsAction implements Runnable {
@Inject MapreduceRunner mrRunner;
@Inject Response response;

View file

@ -26,7 +26,6 @@ import com.googlecode.objectify.Key;
import com.googlecode.objectify.Work;
import google.registry.config.RegistryEnvironment;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.mapreduce.inputs.EppResourceInputs;
import google.registry.model.EppResource;
@ -41,7 +40,7 @@ import javax.inject.Inject;
/** Deletes all {@link EppResource} objects in datastore, including indices and descendants. */
@Action(path = "/_dr/task/killAllEppResources", method = POST)
public class KillAllEppResourcesAction implements MapreduceAction {
public class KillAllEppResourcesAction implements Runnable {
@Inject MapreduceRunner mrRunner;
@Inject Response response;

View file

@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList;
import com.googlecode.objectify.VoidWork;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.model.EppResource;
import google.registry.request.Action;
@ -39,7 +38,7 @@ import javax.inject.Inject;
* commit logs (for backup purposes).
*/
@Action(path = "/_dr/task/resaveAllEppResources")
public class ResaveAllEppResourcesAction implements MapreduceAction {
public class ResaveAllEppResourcesAction implements Runnable {
@Inject MapreduceRunner mrRunner;
@Inject Response response;

View file

@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableSet;
import com.googlecode.objectify.VoidWork;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.model.billing.BillingEvent.Flag;
import google.registry.model.billing.BillingEvent.Recurring;
@ -40,7 +39,7 @@ import javax.inject.Inject;
/** A mapreduce that backfills new {@link Flag#AUTO_RENEW} flag on recurring billing events. */
@Action(path = "/_dr/task/backfillAutorenewBillingFlag")
public class BackfillAutorenewBillingFlagAction implements MapreduceAction {
public class BackfillAutorenewBillingFlagAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();

View file

@ -22,7 +22,6 @@ import com.google.appengine.tools.mapreduce.Mapper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import google.registry.mapreduce.MapreduceAction;
import google.registry.mapreduce.MapreduceRunner;
import google.registry.model.EppResource;
import google.registry.model.billing.BillingEvent.Recurring;
@ -37,7 +36,7 @@ import javax.inject.Inject;
* <p>This is a test of the ChildEntityInput/ChildEntityReader classes.
*/
@Action(path = "/_dr/task/countRecurringBillingEvents")
public class CountRecurringBillingEventsAction implements MapreduceAction {
public class CountRecurringBillingEventsAction implements Runnable {
// TODO(b/27562876): Delete this mapreduce once tested in production.