Move ResaveAllEppResources mapreduce from tools service to backend

It makes sense for all mapreduces to run in backend, especially onces
that are scheduled regularly to run in cron like this one now. We don't
have many instances configured for the tools service anymore on some
of our environments, so backend is the friendliest place for a mapreduce
to run.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168882122
This commit is contained in:
mcilwain 2017-09-15 13:45:49 -07:00 committed by jianglai
parent 3cc44259da
commit 7dc1940cdb
12 changed files with 16 additions and 16 deletions

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.tools.server;
package google.registry.batch;
import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.util.PipelineUtils.createJobPath;
@ -57,7 +57,7 @@ public class ResaveAllEppResourcesAction implements Runnable {
public void run() {
response.sendJavaScriptRedirect(createJobPath(mrRunner
.setJobName("Re-save all EPP resources")
.setModuleName("tools")
.setModuleName("backend")
.runMapOnly(
new ResaveAllEppResourcesActionMapper(),
ImmutableList.of(EppResourceInputs.createKeyInput(EppResource.class)))));

View file

@ -90,7 +90,7 @@
It is needed for "deleteOldCommitLogs" to work correctly.
</description>
<schedule>1st monday of month 09:00</schedule>
<target>tools</target>
<target>backend</target>
</cron>
<cron>

View file

@ -256,6 +256,12 @@
<url-pattern>/_dr/task/deleteProberData</url-pattern>
</servlet-mapping>
<!-- Mapreduce to re-save all EppResources. -->
<servlet-mapping>
<servlet-name>backend-servlet</servlet-name>
<url-pattern>/_dr/task/resaveAllEppResources</url-pattern>
</servlet-mapping>
<!--
Deletes contacts and hosts enqueued for asynchronous deletion if they are
not referenced by any domain.

View file

@ -66,12 +66,6 @@
<url-pattern>/_dr/epptool</url-pattern>
</servlet-mapping>
<!-- Mapreduce to re-save all EppResources. -->
<servlet-mapping>
<servlet-name>tools-servlet</servlet-name>
<url-pattern>/_dr/task/resaveAllEppResources</url-pattern>
</servlet-mapping>
<!-- Mapreduce to re-save all HistoryEntries. -->
<servlet-mapping>
<servlet-name>tools-servlet</servlet-name>

View file

@ -111,7 +111,7 @@
It is needed for "deleteOldCommitLogs" to work correctly.
</description>
<schedule>1st monday of month 09:00</schedule>
<target>tools</target>
<target>backend</target>
</cron>
<cron>

View file

@ -149,7 +149,7 @@
It is needed for "deleteOldCommitLogs" to work correctly.
</description>
<schedule>1st monday of month 09:00</schedule>
<target>tools</target>
<target>backend</target>
</cron>
<cron>

View file

@ -26,6 +26,7 @@ import google.registry.batch.DeleteProberDataAction;
import google.registry.batch.ExpandRecurringBillingEventsAction;
import google.registry.batch.MapreduceEntityCleanupAction;
import google.registry.batch.RefreshDnsOnHostRenameAction;
import google.registry.batch.ResaveAllEppResourcesAction;
import google.registry.batch.VerifyEntityIntegrityAction;
import google.registry.cron.CommitLogFanoutAction;
import google.registry.cron.CronModule;
@ -132,6 +133,7 @@ interface BackendRequestComponent {
RdeReporter rdeReporter();
RefreshDnsAction refreshDnsAction();
RefreshDnsOnHostRenameAction refreshDnsOnHostRenameAction();
ResaveAllEppResourcesAction resaveAllEppResourcesAction();
SyncGroupMembersAction syncGroupMembersAction();
SyncRegistrarsSheetAction syncRegistrarsSheetAction();
TldFanoutAction tldFanoutAction();

View file

@ -44,7 +44,6 @@ import google.registry.tools.server.ListReservedListsAction;
import google.registry.tools.server.ListTldsAction;
import google.registry.tools.server.PollMapreduceAction;
import google.registry.tools.server.RefreshDnsForAllDomainsAction;
import google.registry.tools.server.ResaveAllEppResourcesAction;
import google.registry.tools.server.ResaveAllHistoryEntriesAction;
import google.registry.tools.server.ToolsServerModule;
import google.registry.tools.server.UpdatePremiumListAction;
@ -82,7 +81,6 @@ interface ToolsRequestComponent {
PollMapreduceAction pollMapReduceAction();
PublishDetailReportAction publishDetailReportAction();
RefreshDnsForAllDomainsAction refreshDnsForAllDomainsAction();
ResaveAllEppResourcesAction resaveAllEppResourcesAction();
ResaveAllHistoryEntriesAction resaveAllHistoryEntriesAction();
RestoreCommitLogsAction restoreCommitLogsAction();
UpdatePremiumListAction updatePremiumListAction();

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.tools.server;
package google.registry.batch;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.model.ofy.ObjectifyService.ofy;

View file

@ -31,6 +31,7 @@ PATH CLASS METHOD
/_dr/task/rdeStaging RdeStagingAction GET,POST n INTERNAL APP IGNORED
/_dr/task/rdeUpload RdeUploadAction POST n INTERNAL APP IGNORED
/_dr/task/refreshDnsOnHostRename RefreshDnsOnHostRenameAction GET n INTERNAL APP IGNORED
/_dr/task/resaveAllEppResources ResaveAllEppResourcesAction GET n INTERNAL,API APP ADMIN
/_dr/task/syncGroupMembers SyncGroupMembersAction POST n INTERNAL APP IGNORED
/_dr/task/syncRegistrarsSheet SyncRegistrarsSheetAction POST n INTERNAL APP IGNORED
/_dr/task/tmchCrl TmchCrlAction POST y INTERNAL APP IGNORED

View file

@ -18,6 +18,5 @@ PATH CLASS METHODS OK AUTH
/_dr/task/killAllEppResources KillAllEppResourcesAction POST n INTERNAL APP IGNORED
/_dr/task/pollMapreduce PollMapreduceAction POST n INTERNAL APP IGNORED
/_dr/task/refreshDnsForAllDomains RefreshDnsForAllDomainsAction GET n INTERNAL,API APP ADMIN
/_dr/task/resaveAllEppResources ResaveAllEppResourcesAction GET n INTERNAL,API APP ADMIN
/_dr/task/resaveAllHistoryEntries ResaveAllHistoryEntriesAction GET n INTERNAL,API APP ADMIN
/_dr/task/restoreCommitLogs RestoreCommitLogsAction POST y INTERNAL,API APP ADMIN

View file

@ -33,7 +33,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Unit tests for {@link ResaveAllEppResourcesAction}. */
/** Unit tests for {@link ResaveAllHistoryEntriesAction}. */
@RunWith(JUnit4.class)
public class ResaveAllHistoryEntriesActionTest
extends MapreduceTestCase<ResaveAllHistoryEntriesAction> {